Seriously had enough of arrays now.
#1

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.

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]);
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.
Reply


Messages In This Thread
Seriously had enough of arrays now. - by MP2 - 01.02.2012, 13:38
Re: Seriously had enough of arrays now. - by Konstantinos - 01.02.2012, 13:40
Re: Seriously had enough of arrays now. - by MP2 - 01.02.2012, 14:17
Re: Seriously had enough of arrays now. - by Konstantinos - 01.02.2012, 14:48
Re: Seriously had enough of arrays now. - by MP2 - 01.02.2012, 15:28
Re: Seriously had enough of arrays now. - by MP2 - 01.02.2012, 16:58
Re: Seriously had enough of arrays now. - by MP2 - 01.02.2012, 17:46

Forum Jump:


Users browsing this thread: 2 Guest(s)