mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 05:56:01 +01:00
update: compat for get admin and update ace on group
This commit is contained in:
@@ -196,6 +196,13 @@ function NDCore.Functions.UpdateLastLocation(characterId, location)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function NDCore.Functions.IsPlayerAdmin(src)
|
||||||
|
local player = NDCore.getPlayer(src)
|
||||||
|
if player.groups["admin"] then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Getting all the characters the player has and returning them to the client.
|
-- Getting all the characters the player has and returning them to the client.
|
||||||
RegisterNetEvent("ND:GetCharacters", function()
|
RegisterNetEvent("ND:GetCharacters", function()
|
||||||
local src = source
|
local src = source
|
||||||
|
|||||||
@@ -111,6 +111,9 @@ local function createCharacterTable(info)
|
|||||||
-- Unload and save character
|
-- Unload and save character
|
||||||
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
|
||||||
|
ExecuteCommand(("remove_principal identifier.%s group.%s"):format(self.identifier, name))
|
||||||
|
end
|
||||||
local ped = GetPlayerPed(self.source)
|
local ped = GetPlayerPed(self.source)
|
||||||
if ped then
|
if ped then
|
||||||
local coords = GetEntityCoords(ped)
|
local coords = GetEntityCoords(ped)
|
||||||
@@ -235,6 +238,9 @@ local function createCharacterTable(info)
|
|||||||
local char = NDCore.players[self.source]
|
local char = NDCore.players[self.source]
|
||||||
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
|
||||||
|
ExecuteCommand(("add_principal identifier.%s group.%s"):format(self.identifier, name))
|
||||||
|
end
|
||||||
NDCore.players[self.source] = self
|
NDCore.players[self.source] = self
|
||||||
TriggerEvent("ND:characterLoaded", self)
|
TriggerEvent("ND:characterLoaded", self)
|
||||||
self.triggerEvent("ND:characterLoaded", self)
|
self.triggerEvent("ND:characterLoaded", self)
|
||||||
|
|||||||
Reference in New Issue
Block a user