• 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!

[help] stamina global event

tiagoduuarte

New Member
Joined
May 14, 2012
Messages
1
Reaction score
0
Hello guys this is my old problem,'ve looked everywhere and always is a mistake ...
The stamina on my server does not rise (REV 3777 ~ 8.60), I tried changing everything in my config.lua but is never right ... Then I got a global event that was supposed to work as follows, every thirty minutes in actual time adicionava thirty stamina for each player logged out, but this script is not working right, we have that gets logged out all day and not anything rises stamina please help me!

globalevents.xml
<globalevent name="stamina" interval="1800000" event="script" value="stamina.lua"/>

stamina.lua
function onThink(interval, lastExecution, thinkInterval)
local total,minutes = 151200000,1800000
local query = db.getResult("SELECT `id`, `stamina` FROM `players` WHERE `id` > 6 AND `group_id` < 3;")
if (query:getID() ~= -1) then
while true do
local id, stamina_now = query:getDataInt("id"), query:getDataInt("stamina")
if stamina_now < (total-minutes) then
db.executeQuery("UPDATE `players` SET `stamina` = "..stamina_now+minutes.." WHERE `id` = "..id)
end
if not(query:next()) then
break
end
end
query:free()
end
return true
end

Should help on something here in my part of config.lua stamina ...

rateStaminaLoss = 1
rateStaminaGain = 3
rateStaminaThresholdGain = 12
staminaRatingLimitTop = 41 * 60
staminaRatingLimitBottom = 14 * 60
rateStaminaAboveNormal = 1.0
rateStaminaUnderNormal = 0.5
staminaThresholdOnlyPremium = true

Sorry for my poor english
 
Back
Top