AN? EXPLICA MELHOR PQP
info
Grupo: Marquês
Registrado: 02/08/12
Posts: 1k
Reputação: +234
Char no Tibia: Maurolkit

info
Grupo: Infante
Registrado: 13/10/08
Posts: 1.6k
Reputação: +420
Char no Tibia: Demonbholder

Não entendi muito bem, mas se for para remover o addEvent, usa one(cid)
info
Grupo: Visconde
Registrado: 06/04/11
Posts: 350
Reputação: +8
Char no Tibia: Mulekepirado

bom vou tentar explicar melhor, eu tenho um script que é de transformar o player e trocar a vocação, ai eu coloquei um addEvent(one ,1 * 1000, cid) para ficar retirando mana a cada segundo, ai eu estava tentando fazer com que o addEvent(one ,1 * 1000, cid) parase de retirar mana quando a mana chegase abaixo de 100, entendeu? se não tiver entendido só falar, que eu tento explicar melhor.
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

eh soh editar a funçao 'one'...
if getCreatureMana(cid) <= 100 then return true end
info
Grupo: Visconde
Registrado: 06/04/11
Posts: 350
Reputação: +8
Char no Tibia: Mulekepirado

como assim explica melhor por favor ![]()
sou iniciante.
info
Grupo: Marquês
Registrado: 02/08/12
Posts: 1k
Reputação: +234
Char no Tibia: Maurolkit

Posta a função ai.
info
Grupo: Visconde
Registrado: 06/04/11
Posts: 350
Reputação: +8
Char no Tibia: Mulekepirado

cara vou postar o script enteiro logo:
local function one(cid)
if getPlayerLevel(cid) >= 40 then
doCreatureAddMana(cid, -10)
addEvent(one ,2 * 1000, cid)
end
end
local function two(cid)
if getPlayerLevel(cid) >= 80 then
doCreatureAddMana(cid, -20)
addEvent(two ,2 * 1000, cid)
end
end
local function three(cid)
if getPlayerLevel(cid) >= 120 then
doCreatureAddMana(cid, -30)
addEvent(three ,2 * 1000, cid)
end
end
local function four(cid)
if getPlayerLevel(cid) >= 150 then
doCreatureAddMana(cid, -40)
addEvent(four ,2 * 1000, cid)
end
end
local function five(cid)
if getPlayerLevel(cid) >= 300 then
doCreatureAddMana(cid, -50)
addEvent(five ,2 * 1000, cid)
end
end
function onCastSpell(cid, var)
local outfit1 = 372
local level1 = 40
local outfit2 = 371
local level2 = 80
local outfit3 = 165
local level3 = 120
local outfit4 = 167
local level4 = 150
local outfit5 = 407
local level5 = 300
if getPlayerLevel(cid) >= level1 then
doSetCreatureOutfit(cid, {lookType = outfit1}, -1)
doPlayerSetVocation(cid, 70)
doSendMagicEffect(getCreaturePosition(cid), 106)
addEvent(one ,2 * 1000, cid)
end
if getPlayerLevel(cid) >= level2 then
doSetCreatureOutfit(cid, {lookType = outfit2}, -1)
doPlayerSetVocation(cid, 71)
doSendMagicEffect(getCreaturePosition(cid), 106)
addEvent(two ,2 * 1000, cid)
end
if getPlayerLevel(cid) >= level3 then
doSetCreatureOutfit(cid, {lookType = outfit3}, -1)
doPlayerSetVocation(cid, 72)
doSendMagicEffect(getCreaturePosition(cid), 106)
addEvent(three ,2 * 1000, cid)
end
if getPlayerLevel(cid) >= level4 then
doSetCreatureOutfit(cid, {lookType = outfit4}, -1)
doPlayerSetVocation(cid, 73)
doSendMagicEffect(getCreaturePosition(cid), 106)
addEvent(four ,2 * 1000, cid)
end
if getPlayerLevel(cid) >= level5 then
doSetCreatureOutfit(cid, {lookType = outfit5}, -1)
doPlayerSetVocation(cid, 82)
doSendMagicEffect(getCreaturePosition(cid), 106)
addEvent(five ,2 * 1000, cid)
return true
end
end
info
Grupo: Marquês
Registrado: 02/08/12
Posts: 1k
Reputação: +234
Char no Tibia: Maurolkit

Só muda a função one pra isso.
local function one(cid) if getPlayerMana(cid) <= 100 then return true end if getPlayerLevel(cid) >= 40 then doCreatureAddMana(cid, -10) addEvent(one ,2 * 1000, cid) end end
info
Grupo: Visconde
Registrado: 06/04/11
Posts: 350
Reputação: +8
Char no Tibia: Mulekepirado

valeu cara vc mim ajudou muito ^^
rep +
info
Grupo: Infante
Registrado: 13/10/08
Posts: 1.6k
Reputação: +420
Char no Tibia: Demonbholder

no fim não tinha nada a ver com o addEvent rsrsrs.
beleza, movido.
info
Grupo: Infante
Registrado: 13/10/08
Posts: 1.6k
Reputação: +420
Char no Tibia: Demonbholder

Tópico movido para a seção de dúvidas e pedidos resolvidos.




info
Grupo: Visconde
Registrado: 06/04/11
Posts: 350
Reputação: +8
Char no Tibia: Mulekepirado
galera eu queria saber se e possivel tirar uma funçao dessas addEvent(one ,1 * 1000, cid), pois não vi nenhuma forma de retira-la.