Ir para conteúdo
  • Cadastre-se

(Resolvido)erro teleporttiles.lua


Ir para solução Resolvido por Naze,

Posts Recomendados

alguem poderia me ajudar com o comando /a, parou de funcionar toda vez q tento usar no jogo aparece essa mensagem no executável, ja tentei alguns script mas sem sucesso. esse e o script q estou usando. teleporttiles.lua

 

 

function onSay(cid, words, param, channel)
    local t = {}
    if(param ~= '') then
        t = string.explode(param, ",")
    end

    local n = tonumber(t[1])
    if(not n) then
        n = 1
    end

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

    local pos = getClosestFreeTile(pid, getPosByDir(getCreaturePosition(pid), getCreatureLookDirection(pid), n), false, false)
    if(not pos or isInArray({pos.x, pos.y}, 0)) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Destination not reachable.")
        return true
    end

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

    return true
end
 

Sem título.png

Link para o post
Compartilhar em outros sites
  • Solução

coloque essa função na sua lib

 

function getPosByDir(position, direction, size)
    local n = size or 1
    if(direction == NORTH) then
        position.y = position.y - n
    elseif(direction == SOUTH) then
        position.y = position.y + n
    elseif(direction == WEST) then
        position.x = position.x - n
    elseif(direction == EAST) then
        position.x = position.x + n
    elseif(direction == NORTHWEST) then
        position.y = position.y - n
        position.x = position.x - n
    elseif(direction == NORTHEAST) then
        position.y = position.y - n
        position.x = position.x + n
    elseif(direction == SOUTHWEST) then
        position.y = position.y + n
        position.x = position.x - n
    elseif(direction == SOUTHEAST) then
        position.y = position.y + n
        position.x = position.x + n
    end

    return position
end

 

Discord: Naze#3578

 

Ter Linux Dentro de Windows com Acesso 'localhost' para testes e +

AutoLoot Otimizado Direto na Source (tfs 0.4/otx)

 

// Pirataria é crime, original é roubo, compartilhar é legal.

 

tumblr_muk78tEwDQ1qah4nko1_500.gif

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo