easier file management

This commit is contained in:
GhzGarage
2021-04-08 19:11:32 -05:00
parent a89baa5619
commit 36a139cc09
19 changed files with 0 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
Citizen.CreateThread(function()
while true do
Citizen.Wait(7)
if NetworkIsSessionStarted() then
Citizen.Wait(10)
TriggerServerEvent('QBCore:PlayerJoined')
return
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(7)
if isLoggedIn then
Citizen.Wait((1000 * 60) * 10)
TriggerEvent("QBCore:Player:UpdatePlayerData")
else
Citizen.Wait(5000)
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(7)
if isLoggedIn then
Citizen.Wait(30000)
TriggerEvent("QBCore:Player:UpdatePlayerPosition")
else
Citizen.Wait(5000)
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(math.random(3000, 5000))
if isLoggedIn then
if QBCore.Functions.GetPlayerData().metadata["hunger"] <= 0 or QBCore.Functions.GetPlayerData().metadata["thirst"] <= 0 then
local ped = PlayerPedId()
local currentHealth = GetEntityHealth(ped)
SetEntityHealth(ped, currentHealth - math.random(5, 10))
end
end
end
end)