reset branch

This commit is contained in:
Kakarot
2025-05-10 09:29:59 -05:00
parent 49ba87e216
commit a437265c68
44 changed files with 6371 additions and 15718 deletions
+3 -13
View File
@@ -1,11 +1,6 @@
-- CreateThread(function()
-- while not NetworkIsSessionStarted() do Wait(500) end
-- print('player has loaded at this point')
-- end)
CreateThread(function()
while true do
local sleep = 1000
local sleep = 0
if LocalPlayer.state.isLoggedIn then
sleep = (1000 * 60) * QBCore.Config.UpdateInterval
TriggerServerEvent('QBCore:UpdatePlayer')
@@ -17,16 +12,11 @@ end)
CreateThread(function()
while true do
if LocalPlayer.state.isLoggedIn then
if (LocalPlayer.state['metadata:hunger'] <= 0 or LocalPlayer.state['metadata:thirst'] <= 0)
and not (LocalPlayer.state['metadata:isdead'] or LocalPlayer.state['metadata:inlaststand']) 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)
if currentHealth - decreaseThreshold > 0 then
SetEntityHealth(ped, currentHealth - decreaseThreshold)
else
SetEntityHealth(ped, 0)
end
SetEntityHealth(ped, currentHealth - decreaseThreshold)
end
end
Wait(QBCore.Config.StatusInterval)