06.01.2011, 07:06
How could i go about setting another players pos based on which cage the player got put in.
example - Player1 gets put in cage1, so player2 would also get put in cage1, if player happened to spawn in cage3, player2 would also spawn in cage3 etc etc.
Thanks in advance.
i tryed this.
example - Player1 gets put in cage1, so player2 would also get put in cage1, if player happened to spawn in cage3, player2 would also spawn in cage3 etc etc.
Thanks in advance.
i tryed this.
pawn Код:
new Float:DuelSpawn[][4] =
{
{-1988.9508, 396.3534, 38.6947, 93.1988}, //cage 1 - if the player randomly gets spawned in here, it will put the other player to spawn in this cage also.
{-1962.7333, 394.0844, 38.6947, 92.2355}, //cage 2 - same as above
{-1962.9875, 378.6306, 38.6947, 88.5222}, //cage 3 -same as above
{-1988.8269, 370.3514, 38.6947, 96.6222} //cage 4 - same as above
};
//This is what i tryed but knew it wouldn't work out.
new rand = random(sizeof(DuelSpawn));
if(rand == 1) cage1[playerid] = 1; //if the player gets put in cage 1, the other player will spawn in cage 1
if(rand == 2) cage2[playerid] = 1; - as above
if(rand == 3) cage3[playerid] = 1; - as above
if(rand == 4) cage4[playerid] = 1; - as above
SetPlayerPos(playerid, DuelSpawn[rand][0], DuelSpawn[rand][1],DuelSpawn[rand][2]);
SetPlayerFacingAngle(playerid, DuelSpawn[rand][3]);
if(cage1[playerid] == 1) SetPlayerPos(giveplayerid, -1980.2439,396.1422,38.6947); //will put the other player in cage1 if the first player got spawned in cage 1
if(cage2[playerid] == 1) SetPlayerPos(giveplayerid, -1953.0988,394.8125,38.6947);
if(cage3[playerid] == 1) SetPlayerPos(giveplayerid, -1953.3700,378.1370,38.6947);
if(cage4[playerid] == 1) SetPlayerPos(giveplayerid, -1979.6733,371.4133,38.6947);