gostei,mais nao entendi uma coisa,oque essa funçao faz local tid = getPlayerByNameWildcard(t[1])
abçs !
Por satan666, 06 de abr. de 2010 em Actions e Talkactions
gostei,mais nao entendi uma coisa,oque essa funçao faz local tid = getPlayerByNameWildcard(t[1])
abçs !
info
Grupo: Conde
Registrado: 07/05/08
Posts: 612
Reputação: +12
Char no Tibia: leviana luciferiana

ele retorna o uid ( identificador ) do player se não existir o player ou ele estiver off-line então ela retorna 0 ( zero ) sem enviar erro algum no console como faz a função getCreatureByName(cid) se não existir a criatura ou estiver off aparece uma mensagem de error no console e o restante do script não pode ser executado.
info
Grupo: Conde
Registrado: 07/05/08
Posts: 612
Reputação: +12
Char no Tibia: leviana luciferiana
Com esse código você não precisa mais ir ao templo e dar /c player para puxa-lo para o templo.
você pode escolher o templo que quer envia-lo ou pode manda-lo para o templo dele.
em data/talkaction/talkaction.xml adicione essa tag:
renomeio o words, access e o nome do arquivo.
agora vá na pasta script e crie um arquivo com extensão Lua e nomeie de acordo com o que foi colocado na tag do xml adicione isso dentro dele:
--[[( Marcryzius )]]-- function onSay(cid, words, param) local MSCB = MESSAGE_STATUS_CONSOLE_BLUE if(param == "") then return TRUE,doPlayerSendTextMessage(cid,18, "Command param required.")end local t = string.explode(param, ",") local tid = getPlayerByNameWildcard(t[1]) local townid = (tonumber(t[2]) == nil) and getPlayerTown(tid) or tonumber(t[2]) local posplayer = getCreaturePosition(tid) local pos = getTownTemplePosition(townid) if(pos == LUA_ERROR)then return TRUE,doPlayerSendTextMessage(cid,18,"Town temple position not found.")end if(tid == 0 or (isPlayerGhost(tid) == TRUE))then doPlayerSendTextMessage(cid,MSCB, "Player " .. t[1] .. " is not currently online.") elseif(getPlayerAccess(tid) > getPlayerAccess(cid))then doPlayerSendTextMessage(cid,MSCB, "you can not perform this action in people with group id equal to or above its.") else doTeleportThing(tid, pos, TRUE) doSendMagicEffect(pos, 49) doSendMagicEffect(pos, 39) doSendMagicEffect(posplayer, 66) doSendMagicEffect(posplayer, 10) doPlayerSendTextMessage(cid,MSCB,"player "..getCreatureName(tid).." was sent to the temple of ("..getTownName(townid)..") town id ("..townid..").") end return TRUE endExmplos de uso:
Editado Abril 7 por Marcryzius