diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index db7c127d..58408965 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -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 --- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bc4eaaba..305b3f1b 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -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 --- diff --git a/[core]/es_extended/server/functions.lua b/[core]/es_extended/server/functions.lua index dd7c1408..5ba47867 100644 --- a/[core]/es_extended/server/functions.lua +++ b/[core]/es_extended/server/functions.lua @@ -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