mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 05:56:01 +01:00
update(server/player): use lib acl wrapper
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user