Skip to content

Commit

Permalink
Merge pull request #20 from esx-framework/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Mycroft-Studios authored Jan 2, 2025
2 parents d573090 + 42ea98c commit 06569a6
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ AddEventHandler('esx_status:unregisterStatus', function(name)
end
end)

RegisterNetEvent('esx:onPlayerLogout')
AddEventHandler('esx:onPlayerLogout', function()
ESX.PlayerLoaded = false
RegisterNetEvent('esx:onPlayerLogout', function()
Status = {}
if Config.Display then
SendNUIMessage({
Expand All @@ -57,10 +55,10 @@ AddEventHandler('esx:onPlayerLogout', function()
end
end)

RegisterNetEvent('esx_status:load')
AddEventHandler('esx_status:load', function(status)
RegisterNetEvent('esx_status:load', function(status)
while not ESX.PlayerLoaded do Wait(0) end

OriginalStatus = status
ESX.PlayerLoaded = true
TriggerEvent('esx_status:loaded')

if Config.Display then TriggerEvent('esx_status:setDisplay', 0.5) end
Expand Down Expand Up @@ -96,8 +94,7 @@ AddEventHandler('esx_status:load', function(status)
end)
end)

RegisterNetEvent('esx_status:set')
AddEventHandler('esx_status:set', function(name, val)
RegisterNetEvent('esx_status:set', function(name, val)
for i=1, #Status, 1 do
if Status[i].name == name then
Status[i].set(val)
Expand All @@ -112,8 +109,7 @@ AddEventHandler('esx_status:set', function(name, val)
end
end)

RegisterNetEvent('esx_status:add')
AddEventHandler('esx_status:add', function(name, val)
RegisterNetEvent('esx_status:add', function(name, val)
for i=1, #Status, 1 do
if Status[i].name == name then
Status[i].add(val)
Expand All @@ -128,8 +124,7 @@ AddEventHandler('esx_status:add', function(name, val)
end
end)

RegisterNetEvent('esx_status:remove')
AddEventHandler('esx_status:remove', function(name, val)
RegisterNetEvent('esx_status:remove', function(name, val)
for i=1, #Status, 1 do
if Status[i].name == name then
Status[i].remove(val)
Expand Down

0 comments on commit 06569a6

Please sign in to comment.