PantCore = nil
Citizen.CreateThread(function()
while PantCore == nil do
TriggerEvent('PantCore:GetObject', function(obj)
PantCore = obj
end)
Citizen.Wait(0)
end
while PantCore.Functions.GetPlayerData().job == nil do
Citizen.Wait(10)
end
end)
local toghud = true
local tokovoipstate = 1
local isTalking = false
local hunger = 100
local thirst = 100
-- Citizen.CreateThread(function()
-- while true do
-- Citizen.Wait(15000)
-- PantCore.Functions.GetPlayerData(function(PlayerData)
-- hunger = PlayerData['metadata'].hunger
-- thirst = PlayerData['metadata'].thirst
-- end)
-- end
-- end)
RegisterNetEvent('PantCore:Client:OnPlayerLoaded')
AddEventHandler('PantCore:Client:OnPlayerLoaded', function()
firstLogin1()
end)
function firstLogin1()
PlayerData = PantCore.Functions.GetPlayerData()
--PantCore.Functions.GetPlayerData(function(PlayerData)
hunger = PlayerData['metadata'].hunger
thirst = PlayerData['metadata'].thirst
print(thirst)
end
RegisterNetEvent('hud:toggleui')
AddEventHandler('hud:toggleui', function(show)
if show == true then
toghud = true
else
toghud = false
end
end)
RegisterNetEvent('esx:kashacters:hud')
AddEventHandler('esx:kashacters:hud', function(degisken)
toghud = degisken
end)
RegisterNetEvent('SaltyChat_TalkStateChanged')
AddEventHandler('SaltyChat_TalkStateChanged', function(Talking)
isTalking = Talking
end)
Citizen.CreateThread(function()
while true do
if toghud == true then
if (not IsPedInAnyVehicle(PlayerPedId(), false) )then
DisplayRadar(0)
else
DisplayRadar(1)
end
else
DisplayRadar(0)
end
SendNUIMessage({
action = "updateStatusHud",
show = toghud,
hunger = hunger,
thirst = thirst,
state = tokovoipstate,
talking = isTalking,
})
Citizen.Wait(500)
end
end)
RegisterCommand('test31', function()
TriggerServerEvent("PantCore:Server:SetMetaData", "hunger", PantCore.Functions.GetPlayerData().metadata["hunger"] + 100)
TriggerServerEvent("PantCore:Server:SetMetaData", "thirst", PantCore.Functions.GetPlayerData().metadata["thirst"] + 100)
-- PlayerData = PantCore.Functions.GetPlayerData()
-- PantCore.Functions.GetPlayerData(function(PlayerData)
hunger = PlayerData['metadata'].hunger
thirst = PlayerData['metadata'].thirst
print(thirst)
print(hunger)
end)
RegisterCommand('test62', function()
PlayerData = PantCore.Functions.GetPlayerData()
hunger = PlayerData['metadata'].hunger
thirst = PlayerData['metadata'].thirst
end)
Citizen.CreateThread(function()
while true do
local player = PlayerPedId()
local health = (GetEntityHealth(player) - 100)
local armor = GetPedArmour(player)
local oxy = GetPlayerUnderwaterTimeRemaining(PlayerId()) * 10
local stamina = 100 - GetPlayerSprintStaminaRemaining(PlayerId())
if health == 100 and IsEntityPlayingAnim(player, 'misslamar1dead_body', 'dead_idle', 3) then
health = 1
end
PlayerData = PantCore.Functions.GetPlayerData()
hunger = PlayerData['metadata'].hunger
thirst = PlayerData['metadata'].thirst
--print("geldii")
SendNUIMessage({
action = 'updateStatusHud',
show = toghud,
health = health,
armour = armor,
stamina = stamina,
oxygen = oxy,
state = tokovoipstate,
talking = isTalking
})
Citizen.Wait(500)
end
end)