- Fórum
- OTServ
- Recursos
- Scripting
- Actions e Talkactions
- Prender um player usando /prender
LA
action
Prender um player usando /prender
Por larissaots, 30 de mai. de 2015 em Actions e Talkactions
otserv
tibia
script
1
710
Por larissaots, 30 de mai. de 2015 em Actions e Talkactions
info
Grupo: Banidos
Registrado: 07/04/13
Posts: 648
Reputação: +163
Créditos à leonardobo.
Tutorial
Em talkactions/scripts crie um arquivo chamado prisiontp.lua e então coloque esse conteúdo dentro:
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 endAgora na mesma pasta, talkactions/scripts crie um arquivo chamado liberartp.lua e então coloque esse conteúdo dentro:
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 endNo talkactions.xml coloque:
Editado Maio 30 por Larissa Azhaurn