04.05.2011, 23:00
But if you are using 2D arrays so you should use it like this:
pawn Код:
enum SpawnInfos
{
Float:X_POS,
Float:Y_POS,
Float:Z_POS,
Float:Z_ROT,
}
SpawnInfo[][SpawnInfos] = {
{0.0, 0.0, 0.0, 0.0,}, //For the zeros please add correct values to make the player spawn correctly later
{0.0, 0.0, 0.0, 0.0,},
{0.0, 0.0, 0.0, 0.0,},
{0.0, 0.0, 0.0, 0.0,},
//You can add here more if you want..
{0.0, 0.0, 0.0, 0.0,}//<-- Important! In the last 1D array you shouldn't add the comma there excepted you want to add more 1D arrays.
};
//Then later just do
public OnPlayerSpawn(playerid)
{
//Add this stuff below after those another code you added before.
new spawnid = random(...); //Add inside the 'random' the max amount of spawns (if you have 5 spawns so write '5' there)
SetPlayerPos(playerid, SpawnInfo[spawnid][X_POS], SpawnInfo[spawnid][Y_POS], SpawnInfo[spawnid][Z_POS]);
SetPlayerFacingAngle(playerid, SpawnInfo[spawnid][Z_ROT]);
return 1;
}