Skip to content

Commit

Permalink
feat(es_extended): allow users to change identifier type
Browse files Browse the repository at this point in the history
  • Loading branch information
Mycroft-Studios committed Feb 5, 2025
1 parent 0787a49 commit 14b381f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions [core]/es_extended/server/classes/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
if Config.Multichar then
local startIndex = identifier:find(":", 1)
if startIndex then
self.license = ("license%s"):format(identifier:sub(startIndex, identifier:len()))
self.license = ("%s%s"):format(Config.Identifer, identifier:sub(startIndex, identifier:len()))
end
else
self.license = ("license:%s"):format(identifier)
self.license = ("%s:%s"):format(Config.Identifer, identifier)
end

if type(self.metadata.jobDuty) ~= "boolean" then
Expand Down Expand Up @@ -968,4 +968,4 @@ local function runStaticPlayerMethod(src, method, ...)

return xPlayer[method](...)
end
exports("RunStaticPlayerMethod", runStaticPlayerMethod)
exports("RunStaticPlayerMethod", runStaticPlayerMethod)
6 changes: 3 additions & 3 deletions [core]/es_extended/server/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ function ESX.GetIdentifier(playerId)

playerId = tostring(playerId)

local identifier = GetPlayerIdentifierByType(playerId, "license")
return identifier and identifier:gsub("license:", "")
local identifier = GetPlayerIdentifierByType(playerId, Config.Identifier)
return identifier and identifier:gsub(Config.Identifier .. ":", "")
end

---@param model string|number
Expand Down Expand Up @@ -650,4 +650,4 @@ end
---@return CExtendedVehicle?
function ESX.GetExtendedVehicleFromPlate(plate)
return Core.vehicleClass.getFromPlate(plate)
end
end
1 change: 1 addition & 0 deletions [core]/es_extended/shared/config/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ if GetResourceState("ox_inventory") ~= "missing" then
end

Config.EnableDefaultInventory = Config.CustomInventory == false -- Display the default Inventory ( F2 )
Config.Identifier = GetConvar("esx:identifier", "license")

0 comments on commit 14b381f

Please sign in to comment.