🔥 Remove unused codes in player class

This commit is contained in:
Gellipapa
2023-09-17 15:24:24 +02:00
parent ddccbc8671
commit d4e32411f3
@@ -32,9 +32,6 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
stateBag:set("name", self.name, true)
stateBag:set("metadata", self.metadata, true)
local jobKey = ("%s:count"):format(self.job.name)
GlobalState[jobKey] = (GlobalState[jobKey] or 0) + 1
function self.triggerEvent(eventName, ...)
TriggerClientEvent(eventName, self.source, ...)
end
@@ -382,13 +379,6 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
TriggerEvent('esx:setJob', self.source, self.job, lastJob)
self.triggerEvent('esx:setJob', self.job, lastJob)
Player(self.source).state:set("job", self.job, true)
local lastJobKey = ('%s:count'):format(lastJob.name)
local jobKey = ('%s:count'):format(self.job.name)
local globalStateLastJob = GlobalState[lastJobKey]
GlobalState[lastJobKey] = ((globalStateLastJob and globalStateLastJob > 0) and globalStateLastJob or 1) - 1
GlobalState[jobKey] = (GlobalState[jobKey] or 0) + 1
else
print(('[es_extended] [^3WARNING^7] Ignoring invalid ^5.setJob()^7 usage for ID: ^5%s^7, Job: ^5%s^7'):format(self.source, job))
end