01.02.2012, 13:38
I'm trying to make arrays for spawnpoints. The data is class > city > random > the 4 cells that contain x y z and angle.
The number of random spawns, however, can vary. I tried using sizeof() but I'm getting errors.
How am I meant to store this data without using 15 different fucking arrays? Seriously annoyed.
I have to stress this again: the number of random spawns will vary. Cops will have ~4 per city. Civilians will have 50+. Paramedics will have ~2.
The number of random spawns, however, can vary. I tried using sizeof() but I'm getting errors.
pawn Code:
new Float:cop_spawns[][][4] =
{
{ // Los Santos
{0.0, 0.0, 0.0, 0.0},
{0.0, 0.0, 0.0, 0.0},
{0.0, 0.0, 0.0, 0.0}
} // Los Santos
};
new city = 0;
new rand = random(sizeof(cop_spawns[city]));
SetPlayerPos(0, cop_spawns[city][rand][0], cop_spawns[city][rand][1], cop_spawns[city][rand][2]);
I have to stress this again: the number of random spawns will vary. Cops will have ~4 per city. Civilians will have 50+. Paramedics will have ~2.