Ir para conteúdo

-=[TFS]=- 0.3.6 - 8.60 DO USE NA CHEST E SÓ RECEBO 360000K eu não recebo 1kk

Featured Replies

Postado

NÃO RECEBO 1KK DO ID

 

function onUse(cid, item, frompos, item2, topos)
    local requiredCapacity = 360001.42 -- Minimum inventory capacity in oz
    local chestUID = 1624
    
    if item.uid == chestUID then
        if getPlayerStorageValue(cid, chestUID) == -1 then
            if getPlayerLevel(cid) >= 0 then
                -- Check if the player has enough space in the inventory
                if getPlayerFreeCap(cid) < requiredCapacity then
                    doPlayerSendCancel(cid, "You need at least 360001.42 oz of free capacity to use this chest.")
                    return true
                end
                
                -- Add backpacks with ID 10518 to the player's inventory
                for i = 1, 42 do
                    if not doPlayerAddItem(cid, 10518, 1) then
                        doPlayerSendCancel(cid, "You don't have enough space for the backpacks.")
                        return true
                    end
                end

                -- Add 1,000,000 coins (ID 6527) inside a backpack (ID 10518) and repeat 100 times
                for i = 1, 100 do
                    local backpack = doCreateItemEx(10518, 1)
                    if backpack ~= 0 then
                        for j = 1, 42 do
                            doAddContainerItem(backpack, 6527, 1000000)
                        end
                        doPlayerAddItemEx(cid, backpack, false)
                    else
                        doPlayerSendCancel(cid, "You don't have enough space for the backpacks.")
                        return true
                    end
                end

                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You have won a prize.")
                setPlayerStorageValue(cid, chestUID, 1)
            else
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to be level 0 to use this chest.")
            end
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already received the bonus from this chest.")
        end
    end
    return true
end

 

Resolvido por estopa

Ir para solução
Postado
  • Solução

tenta assim!

 

 

function onUse(cid, item, frompos, item2, topos)
    local requiredCapacity = 360001.42 -- Minimum inventory capacity in oz
    local chestUID = 1624
    
    if item.uid == chestUID then
        if getPlayerStorageValue(cid, chestUID) == -1 then
            if getPlayerLevel(cid) >= 0 then
                -- Check if the player has enough space in the inventory
                if getPlayerFreeCap(cid) < requiredCapacity then
                    doPlayerSendCancel(cid, "You need at least 360001.42 oz of free capacity to use this chest.")
                    return true
                end
                
                -- Add backpacks with ID 10518 to the player's inventory
                for i = 1, 42 do
                    if not doPlayerAddItem(cid, 10518, 1) then
                        doPlayerSendCancel(cid, "You don't have enough space for the backpacks.")
                        return true
                    end
                end

                -- Add 1,000,000 coins (ID 6527) inside a backpack (ID 10518) and repeat 100 times
                for i = 1, 100 do
                    local backpack = doCreateItemEx(10518, 1)
                    if backpack ~= 0 then
                        for j = 1, 42 do
                            doAddContainerItem(backpack, 6527, 100)
                        end
                        doPlayerAddItemEx(cid, backpack, false)
                    else
                        doPlayerSendCancel(cid, "You don't have enough space for the backpacks.")
                        return true
                    end
                end

                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You have won a prize.")
                setPlayerStorageValue(cid, chestUID, 1)
            else
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to be level 0 to use this chest.")
            end
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already received the bonus from this chest.")
        end
    end
    return true
end

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.7k

Informação Importante

Confirmação de Termo