diff --git a/client/main.lua b/client/main.lua index 3799159..d855b47 100644 --- a/client/main.lua +++ b/client/main.lua @@ -45,8 +45,7 @@ AddEventHandler('esx_status:unregisterStatus', function(name) end end) -RegisterNetEvent('esx:onPlayerLogout') -AddEventHandler('esx:onPlayerLogout', function() +RegisterNetEvent('esx:onPlayerLogout', function() ESX.PlayerLoaded = false Status = {} if Config.Display then @@ -57,8 +56,7 @@ AddEventHandler('esx:onPlayerLogout', function() end end) -RegisterNetEvent('esx_status:load') -AddEventHandler('esx_status:load', function(status) +RegisterNetEvent('esx_status:load', function(status) OriginalStatus = status ESX.PlayerLoaded = true TriggerEvent('esx_status:loaded') @@ -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) @@ -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) @@ -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)