String arrays
#1

How can i declare a multi dimensional string array to make all the cells the same?(and equal to something)
Example - every cell (well not cell, because it'll be split in letters) will contain "Test".


thanks,
Reply
#2

You mean this?

pawn Код:
new string[] = "Test";
Reply
#3

pawn Код:
new Bob[2][MAX_PLAYERS] =
{
    {10,...},
    {20,...}
};
Bob[0][ALL] = 10
Bob[1][ALL] = 20

Good Luck!!!
Reply
#4

Quote:
Originally Posted by snoob
pawn Код:
new Bob[2][MAX_PLAYERS] =
{
    {10,...},
    {20,...}
};
Bob[0][ALL] = 10
Bob[1][ALL] = 20

Good Luck!!!
thanks for the try but: first, i wanted it to be a string array... and you made int. and second:
Quote:

error 029: invalid expression, assumed zero

Reply
#5

Uhm, I guess you ment it like this. That's the way I do it in my gamemode.

pawn Код:
new iData[ MAX_SIZE ][ 128 ];

// OnGameModeInit ?
for(new _i; _i < sizeof(iData); _i++) format(iData[_i], sizeof(iData[_i]), "Test");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)