String arrays - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: String arrays (
/showthread.php?tid=143873)
String arrays -
Mr. Potato - 24.04.2010
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,
Re: String arrays -
¤Adas¤ - 24.04.2010
You mean this?
Re: String arrays -
snoob - 24.04.2010
pawn Код:
new Bob[2][MAX_PLAYERS] =
{
{10,...},
{20,...}
};
Bob[0][ALL] = 10
Bob[1][ALL] = 20
Good Luck!!!
Re: String arrays -
Mr. Potato - 24.04.2010
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
|
Re: String arrays -
woot - 24.04.2010
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");