fera holy kina
Ubuntu 10.04
- Joined
- Jan 27, 2009
- Messages
- 192
- Reaction score
- 5
How to modify this code to work on TFS 1.2
Player gain stamina in the tile treiner
Player gain stamina in the tile treiner
Code:
addSta = {}
local config = {
timeToAdd = 1, -- intervalo de tempo para adicionar.
addTime = 5, -- quanto vai adicionar.
}
local function addStamina(cid, check)
if not isPlayer(cid) then
addSta[cid] = nil
return true
end
if check then return true end
doPlayerSetStamina(cid, getPlayerStamina(cid) + config.addTime)
doPlayerSendTextMessage(cid, 25, "Você recebeu "..config.addTime.." minutos de stamina.")
addSta[cid] = addEvent(addStamina, config.timeToAdd * 60 * 1000, cid, false)
end
function onStepIn(cid)
if isPlayer(cid) then
addSta[cid] = addEvent(addStamina, config.timeToAdd * 60 * 1000, cid, false)
end
return true
end
function onStepOut(cid)
if isPlayer(cid) then
stopEvent(addSta[cid])
addSta[cid] = nil
addStamina (cid, true)
end
return true
end