Question about arrays?
#4

Quote:
Originally Posted by kvann
View Post
No, sadly pawn only supports 3-dimensional arrays. You would have to do it like this:

pawn Code:
enum gInfo
{
    Float:g_VehiclePosX[MAX_GANG_VEHICLES],
    Float:g_VehiclePosY[MAX_GANG_VEHICLES],
    Float:g_VehiclePosZ[MAX_GANG_VEHICLES],
    Float:g_VehiclePosA[MAX_GANG_VEHICLES],
}
new GangInfo[MAX_GANGS][gInfo];
Everything else is fine in this code.
Well actually that isn't entirely true sorta.

http://slice-vps.nl:7070/
pawn Code:
#include <a_samp>
#include <ppg>

enum etest
{
    test1[3],
    test2[3],
    test3[3],
}

new test[3][3][etest];

main() {

    test[0][0][test1][0] = 1;
    test[0][0][test1][1] = 2;
    test[0][0][test1][2] = 3;

    printf("%i,%i,%i", test[0][0][test1][0], test[0][0][test1][1], test[0][0][test1][2]);
   
}
Reply


Messages In This Thread
Question about arrays? - by AndySedeyn - 11.10.2014, 20:14
Re: Question about arrays? - by kristo - 11.10.2014, 20:30
Re: Question about arrays? - by AndySedeyn - 11.10.2014, 20:32
Re: Question about arrays? - by Pottus - 11.10.2014, 21:19
Re: Question about arrays? - by AndySedeyn - 11.10.2014, 21:42
Re: Question about arrays? - by ThePhenix - 11.10.2014, 22:13
Re: Question about arrays? - by AndySedeyn - 11.10.2014, 22:33
Re: Question about arrays? - by Pottus - 12.10.2014, 08:35

Forum Jump:


Users browsing this thread: 1 Guest(s)