Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: pragnienia
1. Nie zabiera głodu i pragnienia
Siema. Ostatnio pobra?em sobie GM DayZ na serwer MTA i mam pewien problem poniewa? podczas chodzenia nie zabierana ani pragnienia ani g?odu.
Ni?ej podaj? kod na zabieranie owych status?w

GAMEMODE: https://github.com/mtadayz/MTADayZ




KOD:


Kod:

--[[
function setHunger()
for i,player in ipairs(getElementsByType("player")) do
if getElementData(player,"logedin") then
value = gameplayVariables["loseHunger"]
addPlayerStats (player,"food",value)
end
end
end
setTimer(setHunger,60000,0)

function setThirsty()
for i,player in ipairs(getElementsByType("player")) do
if getElementData(player,"logedin") then
value = gameplayVariables["loseThirst"]
addPlayerStats (player,"thirst",value)
end
end
end
setTimer(setThirsty,60000,0)

function checkThirsty()
for i,player in ipairs(getElementsByType("player")) do
if getElementData(player,"logedin") then
value = 0
if getControlState (player,"sprint") then
value = gameplayVariables["sprintthirst"]
end
addPlayerStats (player,"thirst",value)
end
end
end
setTimer(checkThirsty,10000,0)
]]