NB
dúvida

duvida sobre addEvent(one ,1 * 1000, cid)

Por nbb147, 12 de mar. de 2013 em Scripts

resolvido
12
870
nbb147N
12 de março de 2013 às 21:48

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.

SkymagnumS
12 de março de 2013 às 21:53

AN? EXPLICA MELHOR PQP

12 de março de 2013 às 22:30

Não entendi muito bem, mas se for para remover o addEvent, usa one(cid)

nbb147N
12 de março de 2013 às 22:35

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.

SlicerS
12 de março de 2013 às 22:45

eh soh editar a funçao 'one'...

if getCreatureMana(cid) <= 100 then
return true
end

nbb147N
12 de março de 2013 às 22:51

como assim explica melhor por favor :D

sou iniciante.

SkymagnumS
12 de março de 2013 às 23:06

Posta a função ai.

nbb147N
12 de março de 2013 às 23:10

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

SkymagnumS
12 de março de 2013 às 23:11

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

nbb147N
12 de março de 2013 às 23:49

valeu cara vc mim ajudou muito ^^

rep +

13 de março de 2013 às 00:17

no fim não tinha nada a ver com o addEvent rsrsrs.

 

beleza, movido.

13 de março de 2013 às 00:17

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