try the loop like this:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new rand = random(sizeof(RandomSpawn));
SetPlayerInterior(i, 15);
SetPlayerPos(i, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
SetPlayerFacingAngle(i, RandomSpawn[rand][3]);
// SetSpawnInfo(i, T_ATT, 1, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2],RandomSpawn[rand][3], 24, 500, 26, 500, 34, 500);
// SetSpawnInfo(i, T_DEF, 260, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2],RandomSpawn[rand][3], 24, 500, 26, 500, 34, 500);
GivePlayerWeapon(i, 24, 500);
GivePlayerWeapon(i, 31, 500);
GivePlayerWeapon(i, 34, 500);
TogglePlayerControllable(i, 0);
}
}
if you search for "IsPlayerConnected" it will only work for connected players and won't do it for all IDs..
additionally you used "playerid" at "SetPlayerPos"... this will set the pos for the player that uses the command only, whenever the loop comes to this point... so if there are 4 players it will do it 4 times...
if you use "i" instead it will use it for the ID who's turn it is in the loop