mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 03:01:31 +00:00
Add Config Value and logic inside core / player class
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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")
|
||||
Reference in New Issue
Block a user