30.08.2016, 17:02
Код:
new Float:Spawns [][4] = { {x, y, z, angle}, //Spawn 1 {x, y, z, angle}, //Spawn 2 {x, y, z, angle} //Spawn 3 }; public OnPlayerSpawn(playerid) { new spawn = random(sizeof(Spawns)); SetPlayerPos(playerid, Spawns[spawn][0], Spawns[spawn][1], Spawns[spawn][2]); SetPlayerFacingAngle(playerid, Spawns[spawn][3]); return 1; }
EDIT:
Another easy way of making random spawns:
Код:
public OnPlayerSpawn(playerid) { new spawn = random(3); switch(random) { case 0: { SetPlayerPos(playerid, x, y, z); SetPlayerFacingAngle(playerid, angle); } // Spawn 1 case 1: { SetPlayerPos(playerid, x, y, z); SetPlayerFacingAngle(playerid, angle); } // Spawn 2 case 2: { SetPlayerPos(playerid, x, y, z); SetPlayerFacingAngle(playerid, angle); } // Spawn 3 } return 1; }