Ta ai:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(item.actionid == 65500) then
if getTopCreature({x=32464,y=32378,z=5}).uid > 0 then
doTeleportThing(getTopCreature({x=32464,y=32378,z=5}).uid, {x=32526,y=32421,z=5})
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
else
doPlayerSendCancel(cid, "Menssagem de erro.")
return true
end
elseif (item.actionid == 65501) then
if getTopCreature({x=32526,y=32421,z=5}).uid > 0 then
doTeleportThing(getTopCreature({x=32526,y=32421,z=5}).uid, {x=32464,y=32378,z=5})
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
else
doPlayerSendCancel(cid, "Menssagem de erro.")
end
end
return true
end
fiz correndo porque to sem tempo, se nao funcionar so falar.





info
Grupo: Campones
Registrado: 11/10/13
Posts: 16
Reputação: +1
Boa noite! Eu possuo esse script no meu servidor e queria fazer algumas alterações nele, porém não sei como fazer:
function onUse(cid, item, fromPosition, itemEx, toPosition) if(item.actionid == 65500) then doTeleportThing(getTopCreature({x=32464,y=32378,z=5}).uid, {x=32526,y=32421,z=5}) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) elseif (item.actionid == 65501) then doTeleportThing(getTopCreature({x=32526,y=32421,z=5}).uid, {x=32464,y=32378,z=5}) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end return true endEm getTopCreature({x=32464,y=32378,z=5}) queria adicionar, caso o players não estivesse na posição, uma mensagem de erro IN-GAME. Pois ele pega o player getTopCreature({x=32464,y=32378,z=5}) e manda para a posição {x=32526,y=32421,z=5}) e se o player não tiver na posição correta aparece o erro no ssh: