21.05.2010, 07:38
hi, i have 4 basses in my fs and i need to know if there is a way to get a player to spawn at a random base not just a random position i have looked on the wiki and i made this.
Is there a way i can get it to pick one of the sets of co-ords at random and not just completly randomise the spawn. Im fairly new to scripting so sorry if my question annoys u
Thanks in advance.
Code:
new Float:randspawn[][4]=
{
-1631.6195,-2238.2793,31.4766,96.3710,
-1352.3009,-2403.2361,35.4450,81.5111,
-1418.8741,-2597.6355,68.8439,348.0974,
-1277.3259,-2064.2441,24.0359,178.2503
};
COMMAND:rspawn(playerid,params[])
{
new rand = random(sizeof(randspawn));
SetPlayerPos(playerid,randspawn[rand][0],randspawn[rand][1],randspawn[rand][2]);
SetPlayerFacingAngle(playerid,randspawn[rand][3]);
return 1;
}
Thanks in advance.

