Ir para conteúdo

Featured Replies

Postado

local tempo = 10 -- em segundos
local strg = 12980 -- Storage onde salvará o tempo (Não Mexa)

function onSay(cid, words, param)    
    
if not exhaustion.check(cid, strg) then
        if doPlayerRemoveItem(cid, 2160, 10) == TRUE then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce Desbugou!")
            doSendMagicEffect(getPlayerPosition(cid), 12)
            exhaustion.set(cid, strg, tempo)
            addLevel(cid, 1)
        else
            doPlayerSendCancel(cid, "Presisa De 10 Gold Para Desbugar!")
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Presisa De 10 Gold Para Desbugar!")
            doSendMagicEffect(getPlayerPosition(cid), 2)
        end
    else
        doPlayerSendCancel(cid, "Voce precisa aguardar "..exhaustion.get(cid, strg).." segundos para usar novamente.")
    end
end

 

 

 

 

 

 

ta  dando erro no local strg = 12980 <<< me ajuda

  • Respostas 10
  • Visualizações 587
  • Created
  • Última resposta

Top Posters In This Topic

Postado

Adicione à lib do seu servidor:

exhaustion =
{
    check = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        return getPlayerStorageValue(cid, storage) >= os.time(t)
    end,

    get = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        local exhaust = getPlayerStorageValue(cid, storage)
        if(exhaust > 0) then
            local left = exhaust - os.time(t)
            if(left >= 0) then
                return left
            end
        end

        return false
    end,

    set = function (cid, storage, time)
        setPlayerStorageValue(cid, storage, os.time(t) + time)
    end,

    make = function (cid, storage, time)
        local exhaust = exhaustion.get(cid, storage)
        if(not exhaust) then
            exhaustion.set(cid, storage, time)
            return true
        end

        return false
    end
}

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

The corrupt fear us.

The honest support us.

The heroic join us.

Postado
  • Autor

 

Tente:

function onSay(cid)
    local t = {cost = 10, exhausted = {12980, 10}}
    if (exhaustion.check(cid, t.exhausted[1])) then
        return doPlayerSendCancel(cid, "Voce precisa aguardar "..exhaustion.get(cid, t.exhausted[1]).." segundos para usar novamente.")
    elseif (getPlayerMoney(cid) < t.cost * 10000) then
        return doSendMagicEffect(getPlayerPosition(cid), 2) and doPlayerSendCancel(cid, "Precisa de "..t.cost.." gold bars para desbugar!")
    end
    
    addLevel(cid, 1)
    doPlayerRemoveMoney(cid, t.cost * 10000)
    exhaustion.set(cid, t.exhausted[1], t.exhausted[2])
    doSendMagicEffect(getPlayerPosition(cid), 12)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce Desbugou!")
    return true
end

 

 

ta com o mesmo erro ainda =(

sera que nao tem que coloca nada no actions?

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