Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #20

Merged
merged 3 commits into from
Jan 2, 2025
Merged

Dev #20

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading