mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-19 14:56:02 +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()
|
function self.unload()
|
||||||
if not NDCore.players[self.source] then return end
|
if not NDCore.players[self.source] then return end
|
||||||
for name, _ in pairs(self.groups) do
|
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
|
end
|
||||||
local ped = GetPlayerPed(self.source)
|
local ped = GetPlayerPed(self.source)
|
||||||
if ped then
|
if ped then
|
||||||
@@ -239,7 +239,7 @@ local function createCharacterTable(info)
|
|||||||
if char and char.id == self.id then return true end
|
if char and char.id == self.id then return true end
|
||||||
if char then char.unload() end
|
if char then char.unload() end
|
||||||
for name, _ in pairs(self.groups) do
|
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
|
end
|
||||||
NDCore.players[self.source] = self
|
NDCore.players[self.source] = self
|
||||||
TriggerEvent("ND:characterLoaded", self)
|
TriggerEvent("ND:characterLoaded", self)
|
||||||
@@ -268,7 +268,7 @@ local function createCharacterTable(info)
|
|||||||
isJob = isJob
|
isJob = isJob
|
||||||
}
|
}
|
||||||
self.triggerEvent("ND:updateCharacter", self)
|
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
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -285,7 +285,7 @@ local function createCharacterTable(info)
|
|||||||
end
|
end
|
||||||
self.groups[name] = nil
|
self.groups[name] = nil
|
||||||
self.triggerEvent("ND:updateCharacter", self)
|
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
|
end
|
||||||
|
|
||||||
---@param name string
|
---@param name string
|
||||||
|
|||||||
Reference in New Issue
Block a user