RANDOM POSITION ??
#1

PROBLEM SOLVED 1 YEAR+ AGO, STOP BUMPING THIS THREAD

i got all this

pawn Код:
//At the top i got
new Float:RandomSpawn2[6][3] = {
{4505.9125976563,472.86169433594,34.201229095459},
{4467.1752929688,440.80676269531,34.886543273926},
{4484.0966796875,538.9677734375,52.043884277344},
{4456.326171875,495.46887207031,51.698280334473},
{4498.04296875,427.70236206055,34.49084854126},
{4373.0122070313,448.24356079102,34.037418365479}
};

//then later on i got
new rand = random(sizeof(RandomSpawn2));
SetPlayerPos(i, RandomSpawn2[rand][0], RandomSpawn2[rand][1], RandomSpawn2[rand][2]);
Reply
#2

ok i simplified it ;p
I got the random pos but now i need each player to go to one of these random position
Reply
#3

try this
SetPlayerPos(i, RandomSpawn2[i][0], RandomSpawn2[i][1], RandomSpawn2[i][2]);

each playerid is different so they all have different lines from RandomSpawn
so u have 6 different pos atm
Reply
#4

pawn Код:
new randspawn = random( 6 );
switch( randspawn )
{
    case 0: SetPlayerPos( i, 4505.9125976563,472.86169433594,34.201229095459 );
    case 1: SetPlayerPos( i, 4467.1752929688,440.80676269531,34.886543273926 );
    case 2: SetPlayerPos( i, 4484.0966796875,538.9677734375,52.043884277344 );
    case 3: SetPlayerPos( i, 4456.326171875,495.46887207031,51.698280334473 );
    case 4: SetPlayerPos( i, 4498.04296875,427.70236206055,34.49084854126 );
    case 5: SetPlayerPos( i, 4373.0122070313,448.24356079102,34.037418365479 );
}
Reply
#5

Man change [i] to [playerid] i think it will work
Reply
#6

Quote:
Originally Posted by dino_d_carter
Посмотреть сообщение
Man change [i] to [playerid] i think it will work
Why did you just bump 1 year old topic ?
Reply
#7

Lol, too many noobs here.
Reply
#8

LOL! too many noobs XD

Dude, try this

pawn Код:
//At the top i got
new Float:RandomSpawn2[][] = { // <--------| dont add arrays. the system will define the arrays :D
{4505.9125976563,472.86169433594,34.201229095459},
{4467.1752929688,440.80676269531,34.886543273926},
{4484.0966796875,538.9677734375,52.043884277344},
{4456.326171875,495.46887207031,51.698280334473},
{4498.04296875,427.70236206055,34.49084854126},
{4373.0122070313,448.24356079102,34.037418365479}
};

//then later on i got
new rand = random(sizeof(RandomSpawn2));
/* if you use i for each players then use this
for(new i=0;i<MAX_PLAYERS;i++) if(IsPlayerConnected(i)) */
// <----- dont forget to use this code
SetPlayerPos(playerid, RandomSpawn2[rand][0], RandomSpawn2[rand][1], RandomSpawn2[rand][2]);
Reply
#9

let me quote my self again
Quote:
Originally Posted by park4bmx
Посмотреть сообщение
Why did you just bump 1 year old topic ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)