Ir para conteúdo
  • 0

[Resolvido] Remover Storage


Fjinst

Pergunta

Olá a todos, existe alguma maneira de remover varias storages de uma vez só, ao invéz de fazer isso que eu fiz?

 

 

Citar

function resetStorage(cid, pos)
if getPlayerStorageValue(cid, 60613) >= 0 then
setPlayerStorageValue(cid, 331412, os.time())
setPlayerStorageValue(cid, 60612, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60613, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60614, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60615, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60616, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60617, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60618, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60619, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60620, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60621, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60622, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60623, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60624, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60625, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60626, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60627, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60628, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60629, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60630, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60631, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60632, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60633, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60634, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60635, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60636, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60637, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60638, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60639, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60640, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60641, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60642, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60643, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60644, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60645, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60646, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60647, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60648, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60649, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60650, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60651, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60652, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60653, -1) -- reset storage from players online
setPlayerStorageValue(cid, 60654, -1) -- reset storage from players online
doPlayerSendTextMessage(cid, 19, 'Voce perdeu todas as suas quests.')
end
end

 

 

 

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 1

(OBS: Não testei nenhum dos 2 )

 

Versão 1 : ( Voce coloca os valores que quer da storage )

 

function resetStorage(cid, pos)local Storages = {60612,60613,60614,60615,60616,60617,60618,}if getPlayerStorageValue(cid, 60613) >= 0 then    for i=1, #Storages do        setPlayerStorageValue(cid, Storages[i], -1)    end            doPlayerSendTextMessage(cid, 19, 'Voce perdeu todas as suas quests.')    endend

 

Versão 2 : ( Os valores ficam no for )

 

function resetStorage(cid, pos)if getPlayerStorageValue(cid, 60613) >= 0 then    for i=60612, 60654 do        setPlayerStorageValue(cid, i, -1)    end            doPlayerSendTextMessage(cid, 19, 'Voce perdeu todas as suas quests.')    endend
Editado por Crypter
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...