Ir para conteúdo

Featured Replies

Postado

Olá, é possível criar um comando !cp que após o player digitar isso ele seja teleportado para sua town city (seu cp) porém mostrando 10, 9, 8, .. 3,2,1 e aí sim ocorrer o teleport?

 

Em outras palavras, adicionar um delay mostrando no default o tempo para ser teleportado...

Seria genial para mim;

Postado
  • Autor

Não Possuo, utilizei o mesmo /t que o god tem porem coloquei acess: 0 para os players tb usarem... Só que assim se o player tiver morrendo fica facil correr, facilitando demais.

Então pretendo dar um delay no teleport !cp ou só deixar usar quando tiver sem PZ .. pode ser um script assim porem que só funcione sem battle

Postado

function onSay(cid, words, param, channel)

 

local store = 19290 -- storage q salva o delay
local delay = 10 -- tempo em segundos de dela

 

    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 .. " not found.")
            return true
        end
    end

    local pos = getPlayerTown(tid)
    local tmp = getTownName(pos)
    if(not tmp) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Home town does not exists.")
        return true
    end

    pos = getTownTemplePosition(pos)
    if(not pos or isInArray({pos.x, pos.y}, 0)) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong temple position for town " .. tmp .. ".")
        return true
    end
    
    if getPlayerStorageValue(cid, store) - os.time() <= 0 then
    setPlayerStorageValue(cid, store, os.time() + delay)
    doPlayerSendCancel(cid, "Vc Tem Quer Espera ".. getPlayerStorageValue(cid, store) - os.time() .." second(s) to cast it again.")
    end 
    
    pos = getClosestFreeTile(tid, pos)
    if(not pos 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, true) and not isPlayerGhost(tid)) then
        doSendMagicEffect(tmp, CONST_ME_POFF)
        doSendMagicEffect(pos, CONST_ME_TELEPORT)
    end

    return true
end

 

tag

 

<talkaction log="yes" words="!cp" access="1" event="script" value="teleportmaster.lua"/>

Editado por 345sat (veja o histórico de edições)

Postado
  • Autor
15 horas atrás, 345sat disse:

o seu não deu mas consegui com este:

local teleport_time, exhaust = 10, 20               --Respectivamente, tempo para teleportar e cooldown.
 
function channel_teleport(cid, time)
    if not isPlayer(cid) then
        return true
    elseif getCreatureCondition(cid, CONDITION_INFIGHT) then
        doPlayerSendCancel(cid, "You can't teleport while in battle.")
        return true
    elseif time <= 0 then
        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
        setPlayerStorageValue(cid, 2910, os.time() + exhaust * 60)
        return true
    end
    
    doPlayerSendTextMessage(cid, 27, time)
    addEvent(channel_teleport, 1000, cid, time - 1)
end
 
function onSay(cid)
    if getPlayerStorageValue(cid, 2910) > os.time() then
        doPlayerSendCancel(cid, "This command is still in cooldown. Wait "..(getPlayerStorageValue(cid, 2910) - os.time()).." seconds to use it again.")
        return true
    elseif getCreatureCondition(cid, CONDITION_INFIGHT) then
        doPlayerSendCancel(cid, "You can't use this command in battle.")
        return true
    end
    
    channel_teleport(cid, teleport_time)
    return true
end

15 horas atrás, 345sat disse:

 

 

 

 

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