3d array.
#1

Is there any way to make one? Or to atleast achieve the same effect?
Please help. Thanks.
Reply
#2

pawn Код:
new array[1][1][1];
Or what you mean ?

At 4 dimensions the compiler complain
Reply
#3

here is something i use on connect so i don't have to keep getting names
pawn Код:
new pName[MAX_PLAYERS][MAX_PLAYER_NAME];
that is 2d and if you want 3d

pawn Код:
enum InventoryItems
{
Drugs
Mats
}
new pInventory[MAX_PLAYERS][InventoryItems][100] //99 drugs or mats allowed
Reply
#4

it works with [1][1][1]... but if you type try to make the 3rd dimension atleast 2 slots deep, you get an error. Please help... I need to save a string as a player flag. There can be 200 players and 300 flags for each one, so I end up with:

new flags[200][300][128];

but that gives an error.
Reply
#5

Pawn only supports up to two-dimensional arrays.
Reply
#6

Try it with an enum
Reply
#7

I think there's no way to walk around this with enums... If you think there is, please give me an idea of how to do it...
Reply
#8

Sorry for double post... not intended to do that.
Reply
#9

3d arrays are possible if i remember right, i have done this in pawn during the 0.2.2 days and will see if i can find the code when i get home.
Reply
#10

Quote:
Originally Posted by KANiS6111
it works with [1][1][1]... but if you type try to make the 3rd dimension atleast 2 slots deep, you get an error. Please help... I need to save a string as a player flag. There can be 200 players and 300 flags for each one, so I end up with:

new flags[200][300][128];

but that gives an error.
No error for me :S - Picture

And I self use some 3d arrays in a gm, wanted a 4d but no chance agains the programm :S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)