Add Config Value and logic inside core / player class

This commit is contained in:
zykem#0643
2025-07-21 01:27:03 +02:00
parent 84f10fd176
commit a92852298c
3 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -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.Identifier, identifier:sub(startIndex, identifier:len()))
end
else
self.license = ("license:%s"):format(identifier)
self.license = ("%s:%s"):format(Config.Identifier, identifier)
end
if type(self.metadata.jobDuty) ~= "boolean" then
+3 -2
View File
@@ -380,8 +380,9 @@ function ESX.GetIdentifier(playerId)
playerId = tostring(playerId)
local identifier = GetPlayerIdentifierByType(playerId, "license")
return identifier and identifier:gsub("license:", "")
local identifierType = Config.Identifier
local identifier = GetPlayerIdentifierByType(playerId, identifierType)
return identifier and identifier:gsub(("%s:"):format(identifierType), "")
end
---@param model string|number
@@ -72,3 +72,4 @@ if GetResourceState("ox_inventory") ~= "missing" then
end
Config.EnableDefaultInventory = Config.CustomInventory == false -- Display the default Inventory ( F2 )
Config.Identifier = GetConvar("esx:identifier", "license")