Ir para conteúdo
  • Cadastre-se

(Resolvido)Help comando em talkactions


Ir para solução Resolvido por klipstyle,

Posts Recomendados

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

Link para o post
Compartilhar em outros sites

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
Link para o post
Compartilhar em outros sites
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%
 

Link para o post
Compartilhar em outros sites

 

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

Link para o post
Compartilhar em outros sites
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%
 

Link para o post
Compartilhar em outros sites

 

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.

 

desse modo deu certo tem como fazer para quando player tentar utilizar comando novamente mostrar quantos minutos falta ? tentei  "..exhaustion.get.." mais não deu certo

I like

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

tenta checar dessa forma amigo.

" .. exhaustion.get(cid, 502) .. "

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

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.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo