update(server/player): use lib acl wrapper

This commit is contained in:
Andyyy7666
2023-08-25 04:25:48 +02:00
parent 97e175d4fd
commit fc1ef7b7b3

View File

@@ -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