mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-28 17:01:16 +00:00
Add check for 'isinlaststand'
Prevents player taking damage from hunger after they are already downed.
This commit is contained in:
+1
-1
@@ -12,7 +12,7 @@ end)
|
||||
CreateThread(function()
|
||||
while true do
|
||||
if LocalPlayer.state.isLoggedIn then
|
||||
if (QBCore.PlayerData.metadata['hunger'] <= 0 or QBCore.PlayerData.metadata['thirst'] <= 0) and not QBCore.PlayerData.metadata['isdead'] then
|
||||
if (QBCore.PlayerData.metadata['hunger'] <= 0 or QBCore.PlayerData.metadata['thirst'] <= 0) and not (QBCore.PlayerData.metadata['isdead'] or QBCore.PlayerData.metadata["inlaststand"]) then
|
||||
local ped = PlayerPedId()
|
||||
local currentHealth = GetEntityHealth(ped)
|
||||
local decreaseThreshold = math.random(5, 10)
|
||||
|
||||
Reference in New Issue
Block a user