ja um um topico sobre esse asunto
http://www.xtibia.com/forum/TalkAction-Tel...do-t121048.html
mas o meu script (adaptado)tem varias funçoes
pks podem ou n usarse quiser nessesita estar em local de pz
se estiver em battle n pode usar
apenas vip podem usar (caso seu ot n tiver vip vo colocar para qualq um usar)
vamos ao script (com vip sistem)
data/talkactions/scripts
copie e cole um arquivo qualquer e renomeio para templo.lua
cole isso dentro
function onSay(cid, words, param)config = {
pid=getPlayerGUID(cid), -- não mecha
skull="no", -- players com white skull podem teleportar? ("yes" or "no").
redskull="no", -- players com red skull podemr teleportar? ("yes" or "no").
prot="no", -- players precisam estar em protection zone pra teleportar? ("yes" or "no").
bat="yes" --players precisam estar sem fight pra teleportar? ("yes" or "no").
}
if(config.skull == "no") and (getCreatureSkullType(cid) == 3) then
doPlayerSendTextMessage(cid,22,"apenas players sem white skull usar este comando.")
return TRUE
end
if(config.redskull == "no") and (getCreatureSkullType(cid) == 4) then
doPlayerSendTextMessage(cid,22,"apenas player sem red skull podem usar este comando.")
return TRUE
end
if(config.prot == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid,22,"você precisa estar em protection zone pra poder usar este comando.")
return TRUE
end
if(config.bat == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid,22,"você precisa estar sem battler pra poder usar este comando.")
return TRUE
end
timenow = os.time()
quantity = math.floor((getPlayerStorageValue(cid,13540) - timenow)/(3600*24))
if isPlayer(cid) then
if quantity > 0 then
createConditionObject(CONDITION_INFIGHT)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você ainda tem ".. quantity .." dia(s) restante(s) de VIP.")
doTeleportThing(cid, {x=160, y=51, z=7})
else
dir = getPlayerLookDir(cid)
pos = getCreaturePosition(cid)
if dir == 0 then
newpos = {x=pos.x, y=pos.y, z=pos.z}
elseif dir == 2 then
newpos = {x=pos.x, y=pos.y, z=pos.z}
elseif dir == 1 then
newpos = {x=pos.x, y=pos.y, z=pos.z}
elseif dir == 3 then
newpos = {x=pos.x, y=pos.y, z=pos.z}
end
doTeleportThing(cid, newpos, dir)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Somente jogadores VIPs podem usar este comando.")
end
end
end
em vermelho vc pode mudas pa yes or no
em roxo vc muda para o id da vip (caso o ot n tenho vip sistem eu vo postar logo abaixo)
em azul vc muda para aonde o player sera teleportado
em talkactions.xml
<talkaction words="/teleportar" event="script" value="templo.lua"/>
agora o mesmo script so q sem o negocio da vip (qualquer player podera usar)
function onSay(cid, words, param)config = {
pid=getPlayerGUID(cid), -- não mecha
skull="no", -- players com white skull podem teleportar? ("yes" or "no").
redskull="no", -- players com red skull podem teleportar ("yes" or "no").
prot="no", -- players precisam estar em protection zone pra teleportar ("yes" or "no").
bat="yes" --players precisam estar sem fight pra teleportar ("yes" or "no").
}
if(config.skull == "no") and (getCreatureSkullType(cid) == 3) then
doPlayerSendTextMessage(cid,22,"apenas players sem white skull usar este comando.")
return TRUE
end
if(config.redskull == "no") and (getCreatureSkullType(cid) == 4) then
doPlayerSendTextMessage(cid,22,"apenas player sem red skull podem usar este comando.")
return TRUE
end
if(config.prot == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid,22,"você precisa estar em protection zone pra poder usar este comando.")
return TRUE
end
if(config.bat == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid,22,"você precisa estar sem battler pra poder usar este comando.")
return TRUE
end
doTeleportThing(cid, {x=160, y=51, z=7})
end
em azul vc muda po lugar de teleport
em talkactions.xml
<talkaction words="/tp" event="script" value="templo.lua"/>