A pedido de um carinha do fórum no PM eu decidi fazer o script.
Como Funciona:
http://youtu.be/08o9uoM6bQA
Em data/talkactions/scripts crie um arquivo chamado prisiontp.lua e adicione o seguinte código:
--[[
By leonardobo
Diretamente para o Tibia King.
http://www.tibiaking.com/forum/index
]]--
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Precisa de um nome Exemplo: !prender Joao")
return true
end
local tid = cid
if(param ~= '') then
tid = getPlayerByNameWildcard(param)
if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " nao encontrado.")
return true
end
end
pos = {x=1017, y=1034, z=7} -- POSIÇÃO AONDE SERA TELEPORTADO.
if(doTeleportThing(tid, pos, true) and not isPlayerGhost(tid)) then
doSendMagicEffect(pos, CONST_ME_TELEPORT)
if tid then
doPlayerSendTextMessage(tid, MESSAGE_STATUS_WARNING, "Voce foi preso !")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce prendeu ".. getPlayerName(tid) ..". ")
end
end
return true
end
Em data/talkactions/scripts crie um arquivo chamado liberartp.lua e adicione o seguinte código:
--[[
By Enself = leonardobo
Diretamente para o Tibia King.
http://www.tibiaking.com/forum/index
]]--
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Precisa de um nome Exemplo: !liberar Joao")
return true
end
local tid = cid
if(param ~= '') then
tid = getPlayerByNameWildcard(param)
if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " nao encontrado.")
return true
end
end
local pos = getPlayerTown(tid)
if(doTeleportThing(tid, getTownTemplePosition(pos), true) and not isPlayerGhost(tid)) then
if tid then
doPlayerSendTextMessage(tid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce foi liberado !")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce liberou ".. getPlayerName(tid) ..". ")
end
end
return true
end
Em data/talkactions em talkactions.xml adicione as seguintes tags:
<talkaction log="yes" words="/prender" access="5" event="script" value="prisiontp.lua"/>
<talkaction log="yes" words="/liberar" access="5" event="script" value="liberartp.lua.lua"/>
Para configurar a posição, é no script prisiontp.lua, que no caso seria a sua prisão, o centro dela ou sei la.
{x=1017, y=1034, z=7}
Bom galera é o meu primeiro script, postado evidentemente e o meu primeiro vídeo, aceito criticas construtivas, Abraços.