11.11.2013, 18:50
Well what you can do first is to make a new randomspawn for all of your classes like this
and under PlayerSpawn use this
So you can do this for all of your classes and if you have like colors and stuff for the different team just add them under SetPlayerPos
Don't know if it works, tell me if you get errors
pawn Код:
new Float:mexicanspawn[][6] = // change the 6 after how many positions you have
{
{-2814.9235, 86.0277, -2614.9511, 573.7998}, // change all these to your own, I just used yours in the topic as an example
{-2261.0000, -59.9213, -2003.0356, 395.8932},
{-2818.9230, -327.8485, -2426.9771, 64.0359},
{-2524.9636, 571.8009, -2276.9978, 959.5567},
{-1899.0500, 609.7795, -1563.0963, 941.5693},
{-2255.859375, 1022.4609375, -1599.609375, 1280.2734375}
};
new Float:bikerspawn[][6] =
{
{-2814.9235, 86.0277, -2614.9511, 573.7998},
{-2261.0000, -59.9213, -2003.0356, 395.8932},
{-2818.9230, -327.8485, -2426.9771, 64.0359},
{-2524.9636, 571.8009, -2276.9978, 959.5567},
{-1899.0500, 609.7795, -1563.0963, 941.5693},
{-2255.859375, 1022.4609375, -1599.609375, 1280.2734375}
};
pawn Код:
new rand = random(sizeof(mexicanspawn)), rand2 = random(sizeof(bikerspawn));
if(gTeam[playerid] == TEAM_MEXICANS) // Checks if the player is mexican team
{
SetPlayerPos(playerid,mexicanspawn[rand][0],[rand][1],mexicanspawn[rand][2]); // This will set the positions we used on Float:mexicanspawn
}
if(gTeam[playerid] == TEAM_BIKER) // same thing
{
SetPlayerPos(playerid,bikerspawn[rand2][0],bikerspawn[rand2][1],bikerspawn[rand2][2]); // same thing
}
Don't know if it works, tell me if you get errors