Jump to content
  • 0

Contagem de itens


wenderotpoke
 Share

Question

Spoiler

function sendMsgCountToItens(cid) -- FUNÇÃO PARA MANDAR A MSG DE QUANTOS ITENS FALTA
    local item1 = getPlayerStorageValue(cid, 251461):explode("|")
    
    if getPlayerItemCount(cid, item1[1]) >= tonumber(item1[3]) then
        valor1 = 0
    else
        valor1 = tonumber(item1[3]) - getPlayerItemCount(cid, item1[1])
    end
        
    if getPlayerItemCount(cid, item1[2]) >= tonumber(item1[4]) then
        valor2 = 0
    else
        valor2 = tonumber(item1[4]) - getPlayerItemCount(cid, item1[2])
    end
                
    if getPlayerItemCount(cid, item1[5]) >= tonumber(item1[7]) then
        valor3 = 0
    else
        valor3 = tonumber(item1[7]) - getPlayerItemCount(cid, item1[5])
    end
                
    if getPlayerItemCount(cid, item1[6]) >= tonumber(item1[8]) then
        valor4 = 0
    else
        valor4 = tonumber(item1[8]) - getPlayerItemCount(cid, item1[6])
    end
        
    selfSay("Ainda falta você me trazer os seguintes itens ["..valor1.."] "..getItemNameById(item1[1])..", ["..valor2.."] "..getItemNameById(item1[2])..", ["..valor3.."] "..getItemNameById(item1[5])..",  ["..valor4.."] "..getItemNameById(item1[6])..".", cid)        
    return true
end

 Salve galerinha beleza? Bom esse codigo faz a contagem dos itens que está na sua bag, mas ela não para após zerar ela começa a contagem negativa, (-1, -2, -3, -4, -5,...) gostaria que ela parace no 0 e não aparecesse mais e após o player entregar os itens não ter mais a contagem pois os itens continuam contando depois que o player entrega como se estivesse fazendo de novo!

 

VLWWW REP++

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...