Jump to content

[Help] Take and drop all loot


Mrzeerox

Recommended Posts

function onPlayerMoveItemOutOfInventory ()
if playerMovedInInventory then startRollMessage2("Inventory", "Abusing exploits will result in a ban!", 255, 22, 0 ) return end -- [ID:0000005 - Several grammar + spelling mistakes and typos] //L
local itemName = guiGridListGetItemText ( gridlistItems["inventory"], guiGridListGetSelectedItem ( gridlistItems["inventory"] ), 1 )
    if getElementData(getLocalPlayer(),itemName) and getElementData(getLocalPlayer(),itemName) >= 1 then
        if isPlayerInLoot() then
            local isVehicle = getElementData(isPlayerInLoot(),"vehicle")
            local isTent = getElementData(isPlayerInLoot(),"tent")
            if isVehicle and not isTent then
                local veh = getElementData(isPlayerInLoot(),"parent")
                local tires,engine,parts = getVehicleAddonInfos (getElementModel(veh))
                if itemName == "Tire" and (getElementData(isPlayerInLoot(),"Tire_inVehicle") or 0) < tires  or itemName == "Engine" and (getElementData(isPlayerInLoot(),"Engine_inVehicle") or 0)  < engine or itemName == "Tank Parts" and (getElementData(isPlayerInLoot(),"Parts_inVehicle") or 0) < parts then
                    if itemName == "Tank Parts" then itemName = "Parts" end
                    triggerEvent("onPlayerMoveItemOutOFInventory",getLocalPlayer(),itemName.."_inVehicle",isPlayerInLoot())
                    playerMovedInInventory = true
                    setTimer(function()
                        playerMovedInInventory = false
                    end,700,1)
                elseif isToolbeltItem(itemName) then
                    triggerEvent("onPlayerMoveItemOutOFInventory",getLocalPlayer(),itemName,isPlayerInLoot())
                    playerMovedInInventory = true
                    setTimer(function()
                        playerMovedInInventory = false
                    end,700,1)
                elseif getLootCurrentSlots(getElementData(getLocalPlayer(),"currentCol")) + getItemSlots(itemName) <= getLootMaxAviableSlots(isPlayerInLoot()) then
                    triggerEvent("onPlayerMoveItemOutOFInventory",getLocalPlayer(),itemName,isPlayerInLoot())
                    playerMovedInInventory = true
                    setTimer(function()
                        playerMovedInInventory = false
                    end,700,1)
                else
                    startRollMessage2("Inventory", "Inventory is full!", 255, 22, 0 )
                    return
                end
            elseif isToolbeltItem(itemName) then
                    triggerEvent("onPlayerMoveItemOutOFInventory",getLocalPlayer(),itemName,isPlayerInLoot())    
                    playerMovedInInventory = true
                    setTimer(function()
                        playerMovedInInventory = false
                    end,700,1)
            elseif getLootCurrentSlots(getElementData(getLocalPlayer(),"currentCol")) + getItemSlots(itemName) <= getLootMaxAviableSlots(isPlayerInLoot()) then
                triggerEvent("onPlayerMoveItemOutOFInventory",getLocalPlayer(),itemName,isPlayerInLoot())
                playerMovedInInventory = true
                    setTimer(function()
                    playerMovedInInventory = false
                end,700,1)
            else
                startRollMessage2("Inventory", "Inventory is full!", 255, 22, 0 )
                return
            end    
        else
            triggerEvent("onPlayerMoveItemOutOFInventory",getLocalPlayer(),itemName,isPlayerInLoot())
            playerMovedInInventory = true
            setTimer(function()
                playerMovedInInventory = false
            end,700,1)
        end    
    end
    local gearName = guiGetText(headline["loot"])
    local col = getElementData(getLocalPlayer(),"currentCol")
    setTimer(refreshInventory,200,2)
    if isPlayerInLoot() then
        setTimer(refreshLoot,200,2,col,gearName)
    end
end
addEventHandler ( "onClientGUIClick", buttonItems["inventory"], onPlayerMoveItemOutOfInventory )

How i can chane it to drop all loot? Any scripts?

function onPlayerMoveItemInInventory ()
local itemName = guiGridListGetItemText ( gridlistItems["loot"], guiGridListGetSelectedItem ( gridlistItems["loot"] ), 1 )
if isPlayerInLoot() then
    if getElementData(isPlayerInLoot(),itemName) and getElementData(isPlayerInLoot(),itemName) >= 1 then
        if not isToolbeltItem(itemName) then
            if getPlayerCurrentSlots() + getItemSlots(itemName) <= getPlayerMaxAviableSlots() then
                if not playerMovedInInventory then
                    triggerEvent("onPlayerMoveItemInInventory",getLocalPlayer(),itemName,isPlayerInLoot())
                    playerMovedInInventory = true
                    setTimer(function()
                        playerMovedInInventory = false
                    end,700,1)
                else
                    startRollMessage2("Inventory", "Abusing exploits will result in a ban!", 255, 22, 0 )
                    return
                end    
            else
                startRollMessage2("Inventory", "Inventory is full!", 255, 22, 0 )
                return
            end
        else
            playerMovedInInventory = true
            setTimer(function()
                playerMovedInInventory = false
            end,700,1)
            triggerEvent("onPlayerMoveItemInInventory",getLocalPlayer(),itemName,isPlayerInLoot())
        end
    end
    if isPlayerInLoot() then
        local gearName = guiGetText(headline["loot"])
        local col = getElementData(getLocalPlayer(),"currentCol")
        setTimer(refreshInventory,200,2)
        setTimer(refreshLoot,200,2,col,gearName)
    end
end    
end
addEventHandler ( "onClientGUIClick", buttonItems["loot"], onPlayerMoveItemInInventory )

How i can chane it to take all loot? Any scripts?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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