Ir para conteúdo

Featured Replies

Postado

Boa tarde Galera,

 

estou com problemas na talkaction /t ela manda o GOD para o templo mas não consigo mandar nenhum player para o templo.

 

/t:

function onSay(player, words, param)
	if not player:getGroup():getAccess() then
		return true
	end

	player:teleportTo(player:getTown():getTemplePosition())
	return false
end

Podem me ajudar?

Um dos servidores mais atualizados e idêntico ao TIBIARL da atualidade, acesse

 

sigin.gif

  • 2 weeks later...
Postado


function onSay(cid, words, param, channel)
    local master = false
    if(words == '/t') then
        master = true
    elseif(param == '') then
        local str = ""
        for i, town in ipairs(getTownList()) do
            str = str .. town.name .. "\n"
        end

        doShowTextDialog(cid, 2160, str)
        return true
    end

    local tid, t = cid, string.explode(param, ",")
    if(t[(master and 1 or 2)]) then
        tid = getPlayerByNameWildcard(t[(master and 1 or 2)])
        if(not tid or (isPlayerGhost(tid) and getPlayerAccess(tid) > getPlayerAccess(cid))) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[(master and 1 or 2)] .. " not found.")
            return true
        end
    end

    local tmp = getPlayerTown(cid)
    if(not master) then
        tmp = t[1]
        if(not tonumber(tmp)) then
            tmp = getTownId(tmp)
            if(not tmp) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Town " .. t[1] .. " does not exists.")
                return true
            end
        end
    end

    local pos = getTownTemplePosition(tmp)
    if(type(pos) ~= 'table' or isInArray({pos.x, pos.y}, 0)) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Town " .. t[1] .. " does not exists or has invalid temple position.")
        return true
    end

    pos = getClosestFreeTile(tid, pos)
    if(type(pos) ~= 'table' or isInArray({pos.x, pos.y}, 0)) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Destination not reachable.")
        return true
    end

    tmp = getCreaturePosition(tid)
    if(doTeleportThing(tid, pos) and not isPlayerGhost(tid)) then
        doSendMagicEffect(tmp, CONST_ME_POFF)
        doSendMagicEffect(pos, CONST_ME_TELEPORT)
    end

    return true
end
 

[progress=green]50[/progress]

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo