• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua GetPlayerStamina(cid) bugged?

chaito123

New Member
Joined
Jul 19, 2010
Messages
53
Reaction score
0
Code:
if(getPlayerStamina(cid) >= 28 * 60 * 1000) then
  doPlayerSendCancel(cid, "test")
else
  doPlayerSetStamina(cid, 39 * 60 * 1000)
end

This script give to all a full stamina: 42 * 60 * 1000, and he don't verify if stamina area higher 28 hours.


Anyone can resolve? I use tfs 0.4
 
try
LUA:
local cfg = {,
	refuel = 42 * 60 * 1000,
	refuel2 = 42 * 60 * 1000
}
if(getPlayerStamina(cid) >= cfg.refuel) then
doPlayerSendCancel(cid, "test")
else
doPlayerSetStamina(cid, cfg.refuel2)
end
 
Ups..
LUA:
local cfg = {
	refuel = 42 * 60 * 1000,
	refuel2 = 42 * 60 * 1000
}
if(getPlayerStamina(cid) >= cfg.refuel) then
doPlayerSendCancel(cid, "test")
else
doPlayerSetStamina(cid, cfg.refuel2)
end
 
Look my script, have the function doPlayerAddStamina?

function onAdvance(cid, oldLevel, newLevel)
if (getPlayerStamina(cid) <= 26 * 60 * 1000 ) then
doPlayerSetStamina(cid, 32 * 60 * 1000 )
end
return TRUE
end
 
Back
Top