# Locations..

## Recommended Posts

Hi! Is possible to create element for all coordinates?

I know how to spawn for random locations but I don't need it.

```local locationtest = {
{2422.3,-2261.6,16},
{1758.9,-2767.9,1.7},
{2493.3,-951.8,82.25},
{815.7,-1108.2,25.8},
{390.9,-2054.3,13.8},
{-719.05,-1938.8,8.35},
{-625.7,-2249.5,23.05},
{-1812.3,-168.5,18.2},
{-2659.5,1528.05,54.79},
{-1733.76,194.75,3.6},
{-2535.5,40.15,8.5},
{-1804.85,558.45,35.15},
{-752.6,-131.6,65.8},
}

function locationSpawn()
element = createPickup( #locationtest [all][1], #locationtest [all][2], #locationtest [all][3], 3, 1550 ) -- It spawns one pickup. Why? --
bl = createBlipAttachedTo(element ,37)
end
```

##### Link to comment
```
local locationtest = {
{2422.3,-2261.6,16},
{1758.9,-2767.9,1.7},
{2493.3,-951.8,82.25},
{815.7,-1108.2,25.8},
{390.9,-2054.3,13.8},
{-719.05,-1938.8,8.35},
{-625.7,-2249.5,23.05},
{-1812.3,-168.5,18.2},
{-2659.5,1528.05,54.79},
{-1733.76,194.75,3.6},
{-2535.5,40.15,8.5},
{-1804.85,558.45,35.15},
{-752.6,-131.6,65.8},
}

function locationSpawn()
for i, v in ipairs( locationtest ) do
local x, y, z = v[1], v[2], v[3]
element = createPickup( x, y, z, 3, 1550 )
bl = createBlipAttachedTo( element, 37 )
end
end
addEventHandler("onResourceStart", getResourceRootElement( getThisResource ( ) ), createBag)

```

##### Link to comment
```
local locationtest = {
{2422.3,-2261.6,16},
{1758.9,-2767.9,1.7},
{2493.3,-951.8,82.25},
{815.7,-1108.2,25.8},
{390.9,-2054.3,13.8},
{-719.05,-1938.8,8.35},
{-625.7,-2249.5,23.05},
{-1812.3,-168.5,18.2},
{-2659.5,1528.05,54.79},
{-1733.76,194.75,3.6},
{-2535.5,40.15,8.5},
{-1804.85,558.45,35.15},
{-752.6,-131.6,65.8},
}

function locationSpawn()
for i, v in ipairs( locationtest ) do
local x, y, z = v[1], v[2], v[3]
element = createPickup( x, y, z, 3, 1550 )
bl = createBlipAttachedTo( element, 37 )
end
end
addEventHandler("onResourceStart", getResourceRootElement( getThisResource ( ) ), createBag)

```

Oh, it works! Thx dude!

##### Link to comment

No problem, next time try yourself.

## 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

• ### Recently Browsing   0 members

• No registered users viewing this page.
×

• #### Social Media

×
• Create New...