Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion modules/bridge/nd/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ RegisterNetEvent("ND:characterLoaded", function(character)
client.setPlayerData("groups", reorderGroups(character.groups))
end)

RegisterNetEvent("ND:updateCharacter", function(character)
RegisterNetEvent("ND:updateCharacter", function(character, updatedData)
local validUpdateData = { ["job"] = true, ["groups"] = true, ["jobInfo"] = true }
if not validUpdateData[updatedData] then return end
client.setPlayerData("groups", reorderGroups(character.groups))
end)

Expand Down
5 changes: 4 additions & 1 deletion modules/bridge/nd/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ AddEventHandler("ND:moneyChange", function(src, account, amount, changeType, rea
Inventory.SetItem(src, "money", changeType == "set" and amount or changeType == "remove" and item - amount or changeType == "add" and item + amount)
end)

AddEventHandler("ND:updateCharacter", function(character)
AddEventHandler("ND:updateCharacter", function(character, updatedData)
local validUpdateData = { ["job"] = true, ["groups"] = true, ["jobInfo"] = true }
if not validUpdateData[updatedData] then return end

local inventory = Inventory(character.source)
if not inventory then return end
inventory.player.groups = reorderGroups(character.groups)
Expand Down