Skip to content

Commit

Permalink
feat(routing-buckets): Add routing buckets for initial character (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheiLLeniumStudios authored Feb 2, 2023
1 parent 0f8f45b commit efad1f6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ function InitializeCharacter(gender, onSubmit, onCancel)
client.setPedHair(ped, Config.InitialPlayerClothes[gender].Hair, {})
ClearPedDecorations(ped)
local config = getNewCharacterConfig()
TriggerServerEvent("illenium-appearance:server:ChangeRoutingBucket")
client.startPlayerCustomization(function(appearance)
if (appearance) then
TriggerServerEvent("illenium-appearance:server:saveAppearance", appearance)
Expand All @@ -236,6 +237,7 @@ function InitializeCharacter(gender, onSubmit, onCancel)
onCancel()
end
Framework.CachePed()
TriggerServerEvent("illenium-appearance:server:ResetRoutingBucket")
end, config)
end

Expand Down
10 changes: 10 additions & 0 deletions server/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,16 @@ RegisterNetEvent("illenium-appearance:server:resetOutfitCache", function()
end
end)

RegisterNetEvent("illenium-appearance:server:ChangeRoutingBucket", function()
local src = source
SetPlayerRoutingBucket(src, src)
end)

RegisterNetEvent("illenium-appearance:server:ResetRoutingBucket", function()
local src = source
SetPlayerRoutingBucket(src, 0)
end)

if Config.EnablePedMenu then
lib.addCommand(Config.PedMenuGroup, "pedmenu", function(source, args)
local target = source
Expand Down

0 comments on commit efad1f6

Please sign in to comment.