Jump to content

interior in loots


Shady1

Recommended Posts

I am sorry that I have no direct answer to your inquiry as it seems difficult based on the little amount of information provided by you. Could you share more details about the code that you are looking for? Did you previously find the resource at community.multitheftauto.com? Who was the creator of the code?

Link to comment

I have a dayz server and the code to create items on dayz server is "function createItemLoot(lootPlace,x,y,z)"

I am opening the interior system, I will place loot in the interior and when I place it, the loot does not appear, I want the loots to appear in the interior

:

function createItemLoot(lootPlace,x,y,z)
    local theItemTable = itemTable
    local theItemTableLootPlaceTable = theItemTable[lootPlace]
    local theItemTableLootPlaceTableSize = #theItemTableLootPlaceTable
    local col = createColSphere(x,y,z,1.25)
    local lootMarker = createMarker(x,y,(z-1),"cylinder",0.5,255,255,255,30)
    local hasLoot = false
    lootPilesDataTable[col] = {}
    setElementData(col,"unknownlootpile",true)
    setElementData(col,"itemloot",true)
    setElementData(col,"parent",lootPlace)
    setElementData(col,"marker",lootMarker)
    setElementData(col,"MAX_Slots",100)
    for i = 1,theItemTableLootPlaceTableSize do
        local item = theItemTableLootPlaceTable
        if not ((hasLoot or 0) >= 3) then
            local item5 = item[5]
            local value = 0
            local number = math.random(1,10000)/100
            if number <= item5 then
                value = 1
            end
            if (value > 0) then
                local item1 = item[1]
                local ammoName = weaponAmmoNames(item1)
                if ammoName then
                    hasLoot = ((hasLoot or 0)+1)
                    setElementData(col,ammoName,math.random(1,3))
                end
                hasLoot = ((hasLoot or 0)+1)
                setElementData(col,item1,value)
            end
        else
            break
        end
    end
    if not hasLoot then
        local itemData = theItemTableLootPlaceTable[math.random(1,theItemTableLootPlaceTableSize)][1]
        local ammoName = weaponAmmoNames(itemData)
        if ammoName then
            setElementData(col,ammoName,math.random(1,3))
        end
        setElementData(col,itemData,1)
    end
    refre:~emLoot(col)
end
function createlootpilegroups(pickupPositionsTableTypesIndex)
    local pickupPositionsTableTypes = {"residential","industrial","farm","supermarket","military"}
    local pickupPositionsTableType = pickupPositionsTableTypes[pickupPositionsTableTypesIndex]
    if not pickupPositionsTableType then return end
    local pickupPositionsTableTypeTable = pickupPositions[pickupPositionsTableType]
    local pickupPositionsTableTypeTableSize = #pickupPositionsTableTypeTable
    for i = 1,pickupPositionsTableTypeTableSize do
        local pos = pickupPositionsTableTypeTable
        createItemLoot(pickupPositionsTableType,pos[1],pos[2],pos[3])
        if (i == pickupPositionsTableTypeTableSize) then
            createlootpilegroups(pickupPositionsTableTypesIndex+1)
            return
        end
    end
end

Edited by eoL|Shady
Link to comment
5 hours ago, eoL|Shady said:

opening the interior system

Have you considered the possibility that your "interior system" has no support for assigning interior values to your "item loot"? I suggest you to extend the createItemLoot function with an "interior" parameter and then put the following...

...
    local col = createColSphere(x,y,z,1.25)
    local lootMarker = createMarker(x,y,(z-1),"cylinder",0.5,255,255,255,30)
    local hasLoot = false
    setElementInterior(col, interior)
    setElementInterior(lootMarker, interior)
    lootPilesDataTable[col] = {}
...

Have you been looking at what @Tut has suggested to you? What I have summarized here is what he wanted to tell you anyway so I wonder why you have not responded to him.

In the GTA SA engine an interior is an integer index of the original game world to display. The world with index zero is the main game world with all the buildings. Every other index is special because it has an empty atmosphere. You can only see those elements through the game camera whose interior value matches the one of the camera.

Edited by The_GTA
  • Like 1
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...