Quote:
Originally Posted by Grant Johnston
Instead of writing a whole new Thread I will just Comment here. :P
Im trying to make a random spawn system
But I Need it to Randomly Choose the Spawn Coordinates.
I Have some Code
..
Код:
SetPlayerPos(playerid,coordx[random(sizeof(coordx))],coordy[random(sizeof(coordy))],coordz[random(sizeof(coordz))]
Basically Its Choosing them randomly so Im getting destroyed by World Boundaries. How Can I Make the system so It chooses one column And they all Choose the same coloumn of there own Coordinate Variables.
Hard to explain but here it is.
PHP код:
new coordx[] = // coordx
{
2010.1997,
2217.0286,
2008.1178,
1652.7507,
2019.7411
};
new coordy[] =
{
1158.7738,
2373.9978,
930.7737,
1652.7507,
1158.4047
};
new coordz[] =
{
10.8203,
10.6719,
10.8203,
10.6669,
10.6585
};
So when one is chosen, from one Row. They all choose the same row.
So Far Im Just getting destroyed by World Boundaries because they are random coords. :P
|
Instead of creating 3 times 3 random numbers, create first a random number (The row number), then set the pos.
Код:
new rand = random(sizeof(coordx));
SetPlayerPos(playerid,coordx[rand],coordy[rand],coordz[rand]);