Ir para conteúdo

Featured Replies

Postado
funcionou mas o problema é quando reseta o lvl a mana e a vida reseta tbm :\

Você provavelmente devia estar usando o segundo script, era pra ter feito uso do primeiro que eu postei.

Mas, como você quer que tenha os resets como descrição no look, use estes códigos:

levelreset.lua (data\talkactions\scripts):

function onSay(cid)
    local time = 5 -- time to logout
    local lvl = {1000, 100} -- {minLevel, newLevel}
    local rstor = 78910 -- reset storage
    
    if getTileInfo(getThingPos(cid)).protection then
        if getPlayerLevel(cid) >= lvl[1] then
            setPlayerStorageValue(cid, rstor, getPlayerStorageValue(cid, rstor) + 1)
            db.executeQuery("UPDATE `players` SET `description` = ' [Resets: "..getPlayerStorageValue(cid, rstor).."]' WHERE `players`.`id`= "..getPlayerGUID(cid).."")
            db.executeQuery("UPDATE `players` SET `level`="..lvl[2]..",`experience`= "..getExperienceForLevel(lvl[2]).." WHERE `players`.`id`= "..getPlayerGUID(cid).."")
            doCreatureSetNoMove(cid, true)
            addEvent(doRemoveCreature, time * 1000, cid, true)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You will be logged out within '..time..' seconds.')
        else
            doPlayerSendCancel(cid, 'You need at least level '..lvl[1]..' to reset.')
        end
    else
        doPlayerSendCancel(cid, 'You can only reset within a protected zone.')
    end
    
    return true
end

Tag - talkactions.xml (data\talkactions\scripts):

<talkaction words="!reset" event="script" value="levelreset.lua"/>

noresets.lua (data\creaturescripts\scripts):

function onLogin(cid)
    local rstor = 78910 -- reset storage
    
    if getPlayerStorageValue(cid, rstor) < 0 then
        setPlayerStorageValue(cid, rstor, 0)
        db.executeQuery("UPDATE `players` SET `description` = ' [Resets: 0]' WHERE `players`.`id`= "..getPlayerGUID(cid).."")
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Please, log out and sign in again.')
    end
    
    return true
end

Tag - creaturescripts.xml (data\creaturescripts):

<event type="login" name="NoResets" event="script" value="noresets.lua"/>

The corrupt fear us.

The honest support us.

The heroic join us.

  • Respostas 16
  • Visualizações 1.3k
  • Created
  • Última resposta

Top Posters In This Topic

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