Little Problem.
#8

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]);
Reply


Messages In This Thread
Little Problem. - by Grant Johnston - 11.09.2011, 02:06
Re: Little Problem. - by Sasino97 - 11.09.2011, 02:16
Re: Little Problem. - by Grant Johnston - 11.09.2011, 02:18
Re: Little Problem. - by Grant Johnston - 11.09.2011, 02:26
Re: Little Problem. - by Sasino97 - 11.09.2011, 02:30
Re: Little Problem. - by Amel_PAtomAXx - 11.09.2011, 02:47
Re: Little Problem. - by Grant Johnston - 11.09.2011, 03:01
Re: Little Problem. - by Sasino97 - 11.09.2011, 03:07
Re: Little Problem. - by Grant Johnston - 11.09.2011, 03:15
Re: Little Problem. - by Grant Johnston - 11.09.2011, 03:24

Forum Jump:


Users browsing this thread: 1 Guest(s)