diff --git a/server/player.lua b/server/player.lua index 4251c45..aa93343 100644 --- a/server/player.lua +++ b/server/player.lua @@ -112,7 +112,7 @@ local function createCharacterTable(info) function self.unload() if not NDCore.players[self.source] then return end for name, _ in pairs(self.groups) do - ExecuteCommand(("remove_principal identifier.%s group.%s"):format(self.identifier, name)) + lib.removePrincipal(self.source, ("group.%s"):format(name)) end local ped = GetPlayerPed(self.source) if ped then @@ -239,7 +239,7 @@ local function createCharacterTable(info) if char and char.id == self.id then return true end if char then char.unload() end for name, _ in pairs(self.groups) do - ExecuteCommand(("add_principal identifier.%s group.%s"):format(self.identifier, name)) + lib.addPrincipal(self.source, ("group.%s"):format(name)) end NDCore.players[self.source] = self TriggerEvent("ND:characterLoaded", self) @@ -268,7 +268,7 @@ local function createCharacterTable(info) isJob = isJob } self.triggerEvent("ND:updateCharacter", self) - ExecuteCommand(("add_principal identifier.%s group.%s"):format(self.identifier, name)) + lib.addPrincipal(self.source, ("group.%s"):format(name)) return true end @@ -285,7 +285,7 @@ local function createCharacterTable(info) end self.groups[name] = nil self.triggerEvent("ND:updateCharacter", self) - ExecuteCommand(("remove_principal identifier.%s group.%s"):format(self.identifier, name)) + lib.removePrincipal(self.source, ("group.%s"):format(name)) end ---@param name string