mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-28 23:01:29 +00:00
feat (player/status): Added isdead check to hunger/thirst check thread
This commit is contained in:
+2
-2
@@ -11,9 +11,9 @@ end)
|
||||
CreateThread(function()
|
||||
while true do
|
||||
Wait(QBCore.Config.StatusInterval)
|
||||
local PlayerData = QBCore.Functions.GetPlayerData()
|
||||
if LocalPlayer.state.isLoggedIn then
|
||||
if QBCore.Functions.GetPlayerData().metadata['hunger'] <= 0 or
|
||||
QBCore.Functions.GetPlayerData().metadata['thirst'] <= 0 then
|
||||
if (PlayerData.metadata['hunger'] <= 0 or PlayerData.metadata['thirst'] <= 0) and (not PlayerData.metadata['isdead']) then
|
||||
local ped = PlayerPedId()
|
||||
local currentHealth = GetEntityHealth(ped)
|
||||
SetEntityHealth(ped, currentHealth - math.random(5, 10))
|
||||
|
||||
+1
-8
@@ -17,14 +17,7 @@ QBConfig.Player.MaxInvSlots = 41 -- Max inventory slots for a player
|
||||
QBConfig.Player.HungerRate = 4.2 -- Rate at which hunger goes down.
|
||||
QBConfig.Player.ThirstRate = 3.8 -- Rate at which thirst goes down.
|
||||
QBConfig.Player.Bloodtypes = {
|
||||
"A+",
|
||||
"A-",
|
||||
"B+",
|
||||
"B-",
|
||||
"AB+",
|
||||
"AB-",
|
||||
"O+",
|
||||
"O-",
|
||||
"A+", "A-", "B+", "B-", "AB+", "AB-", "O+", "O-",
|
||||
}
|
||||
|
||||
QBConfig.Server = {} -- General server config
|
||||
|
||||
Reference in New Issue
Block a user