Skip to content

Commit 592ba38

Browse files
AlexRXWindyN0tNvll
authored andcommitted
refactor(player-stats): improve code structure in ESX
1 parent 288ec56 commit 592ba38

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

[core]/es_extended/client/modules/adjustments.lua

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,4 +351,25 @@ function Adjustments:Load()
351351
self:WantedLevel()
352352
self:DisableRadio()
353353
self:Multipliers()
354+
355+
AddEventHandler('esx:playerLoaded', function(xPlayer, isNew, skin)
356+
self:ApplyPlayerStats()
357+
end)
358+
359+
if not Config.PlayerStatsByGender.useCharacterData then
360+
AddEventHandler('skinchanger:modelLoaded', function()
361+
self:ApplyPlayerStats()
362+
end)
363+
end
364+
365+
AddEventHandler('esx:onPlayerSpawn', function()
366+
self:ApplyPlayerStats()
367+
end)
368+
369+
if Config.PlayerStatsByGender.enabled and Config.EnableDebug then
370+
print('[^2adjustments^7] player stats by gender loaded')
371+
print('[^3adjustments^7] enabled: ' .. tostring(Config.PlayerStatsByGender.enabled))
372+
print('[^3adjustments^7] use character data: ' .. tostring(Config.PlayerStatsByGender.useCharacterData))
373+
print('[^3adjustments^7] debug mode: active')
374+
end
354375
end

0 commit comments

Comments
 (0)