[Talkaction] Exhaust Em Talk

lucas502
em Scripts
  • 1
  • 2

lucas502

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 31/03/07Posts: 122

Como colocar exhaust de 15 segundos nesta talkaction?

 

tk = {x= 32360, y= 31782, z= 7}
tk2 = {x= 32346, y= 32220, z= 7}
tk3 = {x= 32386, y= 31821, z= 6}
tk4 = {x= 32310, y= 32210, z= 6}
tk5 = {x= 32985, y= 31540, z= 1}
tk6 = {x= 32794, y= 31248, z= 7}
tk7 = {x= 33171, y= 31815, z= 7}
tk8 = {x= 31920, y= 32240, z= 9}
function onSay(cid, words, param, channel)
		    if getTilePzInfo(getPlayerPosition(cid)) then
										    if(param == 'carlin') then
										    doTeleportThing(cid,tk)
										    doSendMagicEffect(getPlayerPosition(cid), 10)
										    elseif (param == 'thais') then
										    doTeleportThing(cid, tk2)
										    doSendMagicEffect(getPlayerPosition(cid), 10)
										    elseif (param == 'barco carlin') then
										    doTeleportThing(cid, tk3)
										    doSendMagicEffect(getPlayerPosition(cid), 10)
										    elseif (param == 'barco thais') then
										    doTeleportThing(cid, tk4)
										    doSendMagicEffect(getPlayerPosition(cid), 10)
										    elseif (param == 'farmine') then
										    doTeleportThing(cid, tk5)
										    doSendMagicEffect(getPlayerPosition(cid), 10)
										    elseif (param == 'yalahar') then
										    doTeleportThing(cid, tk6)
										    doSendMagicEffect(getPlayerPosition(cid), 10)
										    elseif (param == 'edron') then
										    doTeleportThing(cid, tk7)
										    doSendMagicEffect(getPlayerPosition(cid), 10)
										    elseif (param == 'trainer') then
										    doTeleportThing(cid, tk8)
										    doSendMagicEffect(getPlayerPosition(cid), 10)
										    else
										    local str = "Palavras para !fly X: \ncarlin \nthais \nbarco carlin \nbarco thais \ntrainer \nfarmine \nedron \nyalahar"
										    doShowTextDialog(cid, 2160, str)
										    end
		    else
		    doPlayerSendCancel(cid, "Voce so pode usar em area Protect Zone.")
		    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		    end
end

 

vlw

Makelin1

Absoft User =D
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 21/03/12Posts: 651Char no Tibia: Pussycat !
tk = {x= 32360, y= 31782, z= 7}

tk2 = {x= 32346, y= 32220, z= 7}

tk3 = {x= 32386, y= 31821, z= 6}

tk4 = {x= 32310, y= 32210, z= 6}

tk5 = {x= 32985, y= 31540, z= 1}

tk6 = {x= 32794, y= 31248, z= 7}

tk7 = {x= 33171, y= 31815, z= 7}

tk8 = {x= 31920, y= 32240, z= 9}

function onSay(cid, words, param, channel)

if getTilePzInfo(getPlayerPosition(cid)) then

setPlayerStorageValue(cid,config.s,os.time()+config.exhausth)

if (getPlayerStorageValue(cid, config.s) <= os.time()) then

s = 11548, -- nao mexa

local exhausth = 15 --em quantos segundos podera usar denovo

 

 

 

if(param == 'carlin') then

doTeleportThing(cid,tk)

doSendMagicEffect(getPlayerPosition(cid), 10)

elseif (param == 'thais') then

doTeleportThing(cid, tk2)

doSendMagicEffect(getPlayerPosition(cid), 10)

elseif (param == 'barco carlin') then

doTeleportThing(cid, tk3)

doSendMagicEffect(getPlayerPosition(cid), 10)

elseif (param == 'barco thais') then

doTeleportThing(cid, tk4)

doSendMagicEffect(getPlayerPosition(cid), 10)

elseif (param == 'farmine') then

doTeleportThing(cid, tk5)

doSendMagicEffect(getPlayerPosition(cid), 10)

elseif (param == 'yalahar') then

doTeleportThing(cid, tk6)

doSendMagicEffect(getPlayerPosition(cid), 10)

elseif (param == 'edron') then

doTeleportThing(cid, tk7)

doSendMagicEffect(getPlayerPosition(cid), 10)

elseif (param == 'trainer') then

doTeleportThing(cid, tk8)

doSendMagicEffect(getPlayerPosition(cid), 10)

else

local str = "Palavras para !fly X: \ncarlin \nthais \nbarco carlin \nbarco thais \ntrainer \nfarmine \nedron \nyalahar"

doShowTextDialog(cid, 2160, str)

end

else

doPlayerSendCancel(cid, "Voce so pode usar em area Protect Zone.")

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)

end

end

end

 

espero ter ajudado

ate

 

 

EDIT :

 

lordbug99 ja estava arrumado =D Nao irei fazer o outro post para n floodar

Att

Smartbox

 

 

Ajudei ? + REP

 

Absoft Map

http://www.xtibia.co...__fromsearch__1

 

2575910.gif

Vinc

The white fox
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 30/10/11Posts: 625Gênero: Masculino

ta errado ,esqueceu de acrecenta um end e a função de que faz o exhaustion ta antes do check logo nuca vai ir

e parametros errados

e é mais facil usar exhaustion.make pra esse tipo de coisa

 

corrigido, mensagem de erro adicionada

tk = {x= 32360, y= 31782, z= 7}
tk2 = {x= 32346, y= 32220, z= 7}
tk3 = {x= 32386, y= 31821, z= 6}
tk4 = {x= 32310, y= 32210, z= 6}
tk5 = {x= 32985, y= 31540, z= 1}
tk6 = {x= 32794, y= 31248, z= 7}
tk7 = {x= 33171, y= 31815, z= 7}
tk8 = {x= 31920, y= 32240, z= 9}
function onSay(cid, words, param, channel)
if getTilePzInfo(getPlayerPosition(cid)) then
if (getPlayerStorageValue(cid, config.s) <= os.time()) then
s = 11548, -- nao mexa
local exhausth = 15 --em quantos segundos podera usar denovo
setPlayerStorageValue(cid,s,os.time()+exhausth)



if(param == 'carlin') then
doTeleportThing(cid,tk)
doSendMagicEffect(getPlayerPosition(cid), 10)
elseif (param == 'thais') then
doTeleportThing(cid, tk2)
doSendMagicEffect(getPlayerPosition(cid), 10)
elseif (param == 'barco carlin') then
doTeleportThing(cid, tk3)
doSendMagicEffect(getPlayerPosition(cid), 10)
elseif (param == 'barco thais') then
doTeleportThing(cid, tk4)
doSendMagicEffect(getPlayerPosition(cid), 10)
elseif (param == 'farmine') then
doTeleportThing(cid, tk5)
doSendMagicEffect(getPlayerPosition(cid), 10)
elseif (param == 'yalahar') then
doTeleportThing(cid, tk6)
doSendMagicEffect(getPlayerPosition(cid), 10)
elseif (param == 'edron') then
doTeleportThing(cid, tk7)
doSendMagicEffect(getPlayerPosition(cid), 10)
elseif (param == 'trainer') then
doTeleportThing(cid, tk8)
doSendMagicEffect(getPlayerPosition(cid), 10)
else
local str = "Palavras para !fly X: \ncarlin \nthais \nbarco carlin \nbarco thais \ntrainer \nfarmine \nedron \nyalahar"
doShowTextDialog(cid, 2160, str)
end
else
doPlayerSendCancel(cid, "espere para usar o comando novamente.")
end
else
doPlayerSendCancel(cid, "Voce so pode usar em area Protect Zone.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
end

^w^

caotic

Afinal de contas,sou um mordomo e tanto
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 04/03/11Posts: 1599Char no Tibia: No Have

Nao tem jeito Smartbox a nao te reportar

 

Por realizaçao de scripts com defeitos notaveis sem pelo menos voce testasse voce expressa tabelas que nem existem.

 

Me desculpe reportado.

Zmovir

Shadow Worlds rpg
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 28/09/10Posts: 237

@Lordbug você colocou config.s sendo que não existe nenhuma tabela no script portando o exhausted não funcionara

Conheça o shadow worlds clique na imagen

xd9c6.jpg

 

 

 

Metas:

 

Ter uma meta [x]

 

lucas502

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 31/03/07Posts: 122

erro: unexpected symbol near 'local'

caotic

Afinal de contas,sou um mordomo e tanto
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 04/03/11Posts: 1599Char no Tibia: No Have

Zmovir nao foi o Smartbox e interresante ele coloca um tabela expressada em uma funçao sendo que ela nem existe o.O.

O LORDBUG nao percebeu mais valeu a intençao

 

o certo msn entao seria:

 

 

local temp = {

exhausted = 100, -- tempo de espera

storage = 2864 -- storage usada

 

}

 

 

 

 

tk = {x= 32360, y= 31782, z= 7}

tk2 = {x= 32346, y= 32220, z= 7}

tk3 = {x= 32386, y= 31821, z= 6}

tk4 = {x= 32310, y= 32210, z= 6}

tk5 = {x= 32985, y= 31540, z= 1}

tk6 = {x= 32794, y= 31248, z= 7}

tk7 = {x= 33171, y= 31815, z= 7}

tk8 = {x= 31920, y= 32240, z= 9}

function onSay(cid, words, param, channel)

if(getPlayerStorageValue(cid, temp.storage) > os.time() and getPlayerStorageValue(cid, temp.storage) < 100+os.time()) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Espere " .. getPlayerStorageValue(cid, temp.storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, temp.storage) - os.time()) == 1 and "" or "s") .. " para usar o teleport.")

return true

end

setPlayerStorageValue(cid, temp.storage, os.time() + temp.exhausted)

if getTilePzInfo(getPlayerPosition(cid)) then

if(param == 'carlin') then

doTeleportThing(cid,tk)

doSendMagicEffect(getPlayerPosition(cid), 10)

elseif (param == 'thais') then

doTeleportThing(cid, tk2)

doSendMagicEffect(getPlayerPosition(cid), 10)

elseif (param == 'barco carlin') then

doTeleportThing(cid, tk3)

doSendMagicEffect(getPlayerPosition(cid), 10)

elseif (param == 'barco thais') then

doTeleportThing(cid, tk4)

doSendMagicEffect(getPlayerPosition(cid), 10)

elseif (param == 'farmine') then

doTeleportThing(cid, tk5)

doSendMagicEffect(getPlayerPosition(cid), 10)

elseif (param == 'yalahar') then

doTeleportThing(cid, tk6)

doSendMagicEffect(getPlayerPosition(cid), 10)

elseif (param == 'edron') then

doTeleportThing(cid, tk7)

doSendMagicEffect(getPlayerPosition(cid), 10)

elseif (param == 'trainer') then

doTeleportThing(cid, tk8)

doSendMagicEffect(getPlayerPosition(cid), 10)

else

local str = "Palavras para !fly X: \ncarlin \nthais \nbarco carlin \nbarco thais \ntrainer \nfarmine \nedron \nyalahar"

doShowTextDialog(cid, 2160, str)

end

else

doPlayerSendCancel(cid, "Voce so pode usar em area Protect Zone.")

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)

end

end

Vilden

Loading. . .
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 09/05/08Posts: 1597

Smartbox alertado verbalmente pela ultima vez.

Atenciosamente, Vilden.

lucas502

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 31/03/07Posts: 122

agora não deu erros, mas também ta sem exhaust. Mesmo com o tempo ali (testei até exhaust = 1000000) só para testar, mesmo assim, ta sem exhaust ainda..

caotic

Afinal de contas,sou um mordomo e tanto
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 04/03/11Posts: 1599Char no Tibia: No Have

Vai funcionar agr e que eu tinha posto no else.....

Concertado.

 

FLW

Vodkart

Sumus Validus
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 21/05/10Posts: 3406Gênero: Masculino

Vai funcionar agr e que eu tinha posto no else.....

Concertado.

 

FLW

 

ainda tem erro, se ele não tiver em pz e dar aquela msg ele vai receber o exausted sem ter teleportado

bossisg.png

caotic

Afinal de contas,sou um mordomo e tanto
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 04/03/11Posts: 1599Char no Tibia: No Have

Não e bem erro...

 

Foi de proposito mais se quiser retiriar msg e so colocar dentro da verificaçao de pz

Vodkart

Sumus Validus
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 21/05/10Posts: 3406Gênero: Masculino

Não entendo porque persistir no erro, de vez de fazer a coisa certa uma única vez, fazem ao contrário e só perdem mais tempo.

 

local config = {
pz = true,
exausted = 120,
storage = 5487545,
tps = {
["carlin"] = {x= 32360, y= 31782, z= 7},
["thais"] = {x= 32346, y= 32220, z= 7},
["barco carlin"] = {x= 32386, y= 31821, z= 6},
["barco thais"] = {x= 32310, y= 32210, z= 6},
["farmine"] = {x= 32985, y= 31540, z= 1},
["yalahar"] = {x= 32794, y= 31248, z= 7},
["edron"] = {x= 33171, y= 31815, z= 7},
["trainer"] = {x= 31920, y= 32240, z= 9}
}
}

function onSay(cid, words, param, channel)
param = string.lower(param)
if config.pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.") return true
elseif (getPlayerStorageValue(cid, config.storage) >= os.time()) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"wait " .. getPlayerStorageValue(cid, config.storage) - os.time() .. " seconds to fly again") return true
elseif not config.tps[param] then
doShowTextDialog(cid, 2160, "Palavras para !fly X: \ncarlin \nthais \nbarco carlin \nbarco thais \ntrainer \nfarmine \nedron \nyalahar") return true
end
doTeleportThing(cid, config.tps[param])
doSendMagicEffect(getPlayerPosition(cid), 10)
setPlayerStorageValue(cid, config.storage, os.time()+config.exausted)
return true
end

bossisg.png

caotic

Afinal de contas,sou um mordomo e tanto
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 04/03/11Posts: 1599Char no Tibia: No Have

E pq nao vejo como bug.....

Vodkart

Sumus Validus
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 21/05/10Posts: 3406Gênero: Masculino

E pq nao vejo como bug.....

 

Entendo, isso é normal pois o conceito de como vemos o nosso código vem junto com o conhecimento, a cada experiência ficamos melhores e isso vem com o tempo, mas continue ajudando a comunidade, você é muito inteligente também, obrigado pelo esforço que vem fazendo.

bossisg.png

  • 1
  • 2