mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
Use new esx_status
This commit is contained in:
+25
-1
@@ -8,10 +8,16 @@ Citizen.CreateThread(function()
|
||||
end
|
||||
end)
|
||||
|
||||
AddEventHandler('esx_basicneeds:resetStatus', function()
|
||||
TriggerEvent('esx_status:set', 'hunger', 500000)
|
||||
TriggerEvent('esx_status:set', 'thirst', 500000)
|
||||
|
||||
end)
|
||||
|
||||
AddEventHandler('playerSpawned', function()
|
||||
|
||||
if IsDead then
|
||||
TriggerServerEvent('esx_basicneeds:resetStatus')
|
||||
TriggerEvent('esx_basicneeds:resetStatus')
|
||||
end
|
||||
|
||||
IsDead = false
|
||||
@@ -19,6 +25,24 @@ end)
|
||||
|
||||
AddEventHandler('esx_status:loaded', function(status)
|
||||
|
||||
TriggerEvent('esx_status:registerStatus', 'hunger', 1000000, '#CFAD0F',
|
||||
function(status)
|
||||
return true
|
||||
end,
|
||||
function(status)
|
||||
status.remove(200)
|
||||
end
|
||||
)
|
||||
|
||||
TriggerEvent('esx_status:registerStatus', 'thirst', 1000000, '#0C98F1',
|
||||
function(status)
|
||||
return true
|
||||
end,
|
||||
function(status)
|
||||
status.remove(250)
|
||||
end
|
||||
)
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
|
||||
while true do
|
||||
|
||||
Reference in New Issue
Block a user