Ir para conteúdo

Featured Replies

Postado


Minha db buga toda vez que tento fazer um acréscimo de storage

 

ex:

 setPlayerStorageValue(cid, 3131, getPlayerStorageValue(cid, 3131)+1)

 

chega uma hora que buga o valor da storage e vira simbolos  "$%#C "
dai buga tudo que faz acréscimo, ex: task..

sabe como posso resolver? 

Se alguém souber como setar 0 a storage nao for numero, ja ajuda.



 

Citar

 

local storage = 19387
local tempo = 550
local minutes = 1
local limit = 2520

function onAttack(cid, target)
    if getPlayerStamina(cid) >= limit then
        return true
    end
    
    if isMonster(target) and getCreatureName(target) == 'Target' then
        doPlayerSetStorageValue(cid, storage, getPlayerStorageValue(cid, storage)+1)
        if getPlayerStorageValue(cid, storage) >= tempo then
        doPlayerAddStamina(cid, minutes)
        doPlayerSetStorageValue(cid, storage, 0)
        doCreatureSay(cid, "You received 1 minute of stamina.", TALKTYPE_ORANGE_1)
        end
    end
    return true
end

 

 

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

  • Respostas 12
  • Visualizações 1.9k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local storage = 19387 local tempo = 550 local minutes = 1 local limit = 2520 function onAttack(cid, target) if getPlayerStamina(cid) >= limit then return true end if type(get

Postado
  • Administrador

Faz um teste ai ... 

 

local storage = 19387
local tempo = 550
local minutes = 1
local limit = 2520

function onAttack(cid, target)
    if getPlayerStamina(cid) >= limit then
        return true
    end
    
    if isMonster(target) and getCreatureName(target) == 'Target' then
	   local value = getPlayerStorageValue(cid, storage) +1
	    setPlayerStorageValue(cid, storage, value)
        if getPlayerStorageValue(cid, storage) >= tempo then
        doPlayerAddStamina(cid, minutes)
        doPlayerSetStorageValue(cid, storage, 0)
        doCreatureSay(cid, "You received 1 minute of stamina.", TALKTYPE_ORANGE_1)
        end
    end
    return true
end

 

TibiaKing Team- KingTópicos
www.tibiaking.com

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 96k
  • Posts 512.6k

Informação Importante

Confirmação de Termo