Files
esx_core/[esx]/es_extended/imports.lua
T
Linden e3113ab7f9 improvement(esx/client): Send both new and old value of playerdata with event; properly set job/grade display for hud
- Makes the event a viable alternative to esx:setJob as we can compare if the value has changed.

- Formatting for job/grade would not update when going to or from unemployed
2021-06-26 03:49:21 +10:00

10 lines
344 B
Lua

ESX = exports['es_extended']:getSharedObject()
if not IsDuplicityVersion() then -- Only register this event for the client
AddEventHandler('esx:setPlayerData', function(key, val, last)
if GetInvokingResource() == 'es_extended' then
ESX.PlayerData[key] = val
if OnPlayerData ~= nil then OnPlayerData(key, val, last) end
end
end)
end