GetIsFrameworkAdmin
This commit is contained in:
1 parent
d55c13ab31
commit
3a141cb8f2
3 files changed
+28
No files matched your search
@@ -13,6 +13,18 @@ Framework.GetFrameworkName = function()
|
|||||||
return 'es_extended'
|
return 'es_extended'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---This will return if the player is an admin in the framework.
|
||||||
|
---@param src any
|
||||||
|
---@return boolean
|
||||||
|
Framework.GetIsFrameworkAdmin = function(src)
|
||||||
|
if not src then return false end
|
||||||
|
local xPlayer = Framework.GetPlayer(src)
|
||||||
|
if not xPlayer then return false end
|
||||||
|
local group = xPlayer.getGroup()
|
||||||
|
if group == 'admin' or group == 'superadmin' then return true end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
---This will get the players birth date
|
---This will get the players birth date
|
||||||
---@return string|nil
|
---@return string|nil
|
||||||
Framework.GetPlayerDob = function(src)
|
Framework.GetPlayerDob = function(src)
|
||||||
|
|||||||
@@ -14,6 +14,14 @@ Framework.GetFrameworkName = function()
|
|||||||
return 'qb-core'
|
return 'qb-core'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---This will return if the player is an admin in the framework.
|
||||||
|
---@param src any
|
||||||
|
---@return boolean
|
||||||
|
Framework.GetIsFrameworkAdmin = function(src)
|
||||||
|
if not src then return false end
|
||||||
|
return QBCore.Functions.HasPermission(src, 'admin')
|
||||||
|
end
|
||||||
|
|
||||||
-- Framework.GetPlayerIdentifier(src)
|
-- Framework.GetPlayerIdentifier(src)
|
||||||
-- Returns the citizen ID of the player.
|
-- Returns the citizen ID of the player.
|
||||||
---@param src number
|
---@param src number
|
||||||
|
|||||||
@@ -11,6 +11,14 @@ Framework.GetFrameworkName = function()
|
|||||||
return 'qbx_core'
|
return 'qbx_core'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---This will return if the player is an admin in the framework.
|
||||||
|
---@param src any
|
||||||
|
---@return boolean
|
||||||
|
Framework.GetIsFrameworkAdmin = function(src)
|
||||||
|
if not src then return false end
|
||||||
|
return IsPlayerAceAllowed(src, 'admin')
|
||||||
|
end
|
||||||
|
|
||||||
---Returns the player date of birth.
|
---Returns the player date of birth.
|
||||||
---@param src number
|
---@param src number
|
||||||
---@return string|nil
|
---@return string|nil
|
||||||
|
|||||||
Reference in new issue
Block a user