mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
Merge pull request #1618 from iSentrie/patch-12
fix(es_extended/server/functions.lua): IsPlayerAdmin group fix
This commit is contained in:
@@ -3,9 +3,7 @@ name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: "[Bug] - esx_script - Issue"
|
||||
labels: bug
|
||||
assignees:
|
||||
- TheFantomas
|
||||
- Gellipapa
|
||||
assignees: Arctos2win, Kenshiin13
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -3,9 +3,7 @@ name: Feature Request
|
||||
about: Help us improve esx with your ideas
|
||||
title: "[Feature Request] - esx_script - Add better configuration"
|
||||
labels: enhancement
|
||||
assignees:
|
||||
- TheFantomas
|
||||
- Gellipapa
|
||||
assignees: Arctos2win, Kenshiin13
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -626,16 +626,19 @@ function ESX.DoesJobExist(job, grade)
|
||||
return (ESX.Jobs[job] and ESX.Jobs[job].grades[tostring(grade)] ~= nil) or false
|
||||
end
|
||||
|
||||
---@param playerId string | number
|
||||
---@param playerSrc number
|
||||
---@return boolean
|
||||
function Core.IsPlayerAdmin(playerId)
|
||||
playerId = tostring(playerId)
|
||||
if (IsPlayerAceAllowed(playerId, "command") or GetConvar("sv_lan", "") == "true") then
|
||||
function Core.IsPlayerAdmin(playerSrc)
|
||||
if type(playerSrc) ~= "number" then
|
||||
return false
|
||||
end
|
||||
|
||||
if IsPlayerAceAllowed(playerSrc --[[@as string]], "command") or GetConvar("sv_lan", "") == "true" then
|
||||
return true
|
||||
end
|
||||
|
||||
local xPlayer = ESX.Players[playerId]
|
||||
return (xPlayer and Config.AdminGroups[xPlayer.group] and true) or false
|
||||
local xPlayer = ESX.GetPlayerFromId(playerSrc)
|
||||
return xPlayer and Config.AdminGroups[xPlayer.getGroup()] or false
|
||||
end
|
||||
|
||||
---@param owner string
|
||||
|
||||
Reference in New Issue
Block a user