Ir para conteúdo

Featured Replies

Postado

galerinha estou fazendo um script para quando player tiver perdido utilizar comando !dp, fiz o script ta tudo certo só gostaria de por uma exhausted de 10 minutos para ser usado comando novamente alguém pode ajudar?

creio eu que tenha que utilizar uma storage +ou- assim

    local STORAGE_IR = 12701    local delay = 1 * 10
    local lastUse = getPlayerStorageValue(cid, STORAGE_IR)
    local ticks = os.time() - lastUse
    if ticks < delay then
        return true
    else
        setPlayerStorageValue(cid, STORAGE_IR, os.time())

script

function onSay(cid, words, param, channel)
        local tmp = getCreaturePosition(cid)
        local pos = {x = 162, y = 49, z = 7}
        local minlevel = 8
		local config = {
              battle = true,
                     }

        if getPlayerLevel(cid) >= minlevel then
            if getPlayerSkullType(cid) >= 3 then
			    elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
                doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Voce nao pode ir para templo com pk, nem com battle.")
                return true
            end
            doTeleportThing(cid, pos, true)
            doSendMagicEffect(tmp, CONST_ME_POFF)
            doSendMagicEffect(pos, CONST_ME_TELEPORT)
        else
            doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Você deve ter level ".. minlevel ..".")
    end
    return true
end

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

I like

Resolvido por klipstyle

Ir para solução
  • Respostas 7
  • Visualizações 561
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • pode ser feito sem storage. use isso para verificar exaust.   if exhaustion.get(cid, 502) then  doPlayerSendCancel(cid, 'You can use this command only once per 10 minuts.') return true end   e ao se

  • tenta checar dessa forma amigo. " .. exhaustion.get(cid, 502) .. "

Postado

Aqui está:

function onSay(cid, words, param, channel)
        local storage, temp = 343444, 1 -- Storage e tempo.
        local tmp = getCreaturePosition(cid)
        local pos = {x = 162, y = 49, z = 7}
        local minlevel = 8
        local config = {
              battle = true,
                     }
    if getPlayerStorageValue(cid, storage) < os.time() then
        if getPlayerLevel(cid) >= minlevel then
            if getPlayerSkullType(cid) >= 3 then
                elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
                doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Voce nao pode ir para templo com pk, nem com battle.")
                return true
            end
            setPlayerStorageValue(cid, storage, temp * 60 + os.time())
            doTeleportThing(cid, pos, true)
            doSendMagicEffect(tmp, CONST_ME_POFF)
            doSendMagicEffect(pos, CONST_ME_TELEPORT)
        else
            doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Você deve ter level ".. minlevel ..".")
        end
    else
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você precisa esperar "..math.ceil((getPlayerStorageValue(cid, storage) - os.time())/60).." minuto(s) para usar novamente.")
    end
   return true
end
Postado
pode ser feito sem storage.
use isso para verificar exaust.
 
if exhaustion.get(cid, 502) then 
doPlayerSendCancel(cid, 'You can use this command only once per 10 minuts.')
return true
end
 
e ao ser teleportado use isso para adicionar o exaust.
exhaustion.set(cid, 502, 600)
 
obg: ja esta certo para os 10 minutos.

www.pokemiw.com
24 Horas Online - 1º 2º 3º 4º 5º 6º 7º gerações 100%
 

Postado
  • Autor
  Em 27/05/2015 em 23:50, Wakon disse:

 

Aqui está:

function onSay(cid, words, param, channel)
        local storage, temp = 343444, 1 -- Storage e tempo.
        local tmp = getCreaturePosition(cid)
        local pos = {x = 162, y = 49, z = 7}
        local minlevel = 8
        local config = {
              battle = true,
                     }
    if getPlayerStorageValue(cid, storage) < os.time() then
        if getPlayerLevel(cid) >= minlevel then
            if getPlayerSkullType(cid) >= 3 then
                elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
                doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Voce nao pode ir para templo com pk, nem com battle.")
                return true
            end
            setPlayerStorageValue(cid, storage, temp * 60 + os.time())
            doTeleportThing(cid, pos, true)
            doSendMagicEffect(tmp, CONST_ME_POFF)
            doSendMagicEffect(pos, CONST_ME_TELEPORT)
        else
            doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Você deve ter level ".. minlevel ..".")
        end
    else
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você precisa esperar "..math.ceil((getPlayerStorageValue(cid, storage) - os.time())/60).." minuto(s) para usar novamente.")
    end
   return true
end

não ta te teletransportando só fica com a mensagem 

Voce nao pode ir para templo com pk, nem com battle.

mesmo eu sem battle

I like

Postado
function onSay(cid, words, param)
pos = {x=162, y=49, z=7}
local config = {
battle = true
}
 if getPlayerLevel(cid) <= 8 then
 doPlayerSendCancel(cid, 'Você deve ter level 8.')
return true
end
if exhaustion.get(cid, 502) then
doPlayerSendCancel(cid, 'Você precisa esperar 10 minutos para usar novamente.')
return true
end
if config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then
doPlayerSendCancel(cid, "Voce nao pode ir para templo com pk, nem com battle.")
return true
end
doTeleportThing(cid,pos)
exhaustion.set(cid, 502, 600)
return true
end 

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

www.pokemiw.com
24 Horas Online - 1º 2º 3º 4º 5º 6º 7º gerações 100%
 

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