SA-MP Forums Archive
multi-dimensional arrays must be fully initialized - 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)
+--- Thread: multi-dimensional arrays must be fully initialized (/showthread.php?tid=521553)



multi-dimensional arrays must be fully initialized - RedbullGD - 23.06.2014

Hey every1 hope everything is fine...i'm having this problem can anyone fix this?
Here is the error
Код:
C:\Users\NAEEM\Desktop\FR 2013\pawno\XS.pwn(75) : error 052: multi-dimensional arrays must be fully initialized
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
And the code

Код:
//Anounncements
new Msg;
new Announcements[6][128] = { // Announcements[number of announcement messages][string lengh]
"{FF0000}SerVer >> {FF00E6}To teleport around, type {FFFF00}/teles",
"{FF0000}SerVer >> {FF00E6}Make sure to visit our web - {FFFF00}www.ngenstunting.com",
"{FF0000}SerVer >> {FF00E6}Basic: {FFFF00}/help {FFFFFF}- {FFFF00}/rules {FFFFFF}- {FFFF00}/t {FFFFFF}- {FFFF00}/v",
"{FF0000}SerVer >> {FF00E6}Donate our server,To keep our server alive"
};
error is happening on the red
If u need more detail please do ask on the reply...


AW: multi-dimensional arrays must be fully initialized - Mellnik - 23.06.2014

It's pretty much what it says. You haven't initialized 128 items, so just remove it.

pawn Код:
new Announcements[6][] =



Re: multi-dimensional arrays must be fully initialized - Konstantinos - 23.06.2014

pawn Код:
new Announcements[][] = { // Announcements[number of announcement messages][string lengh]
"{FF0000}SerVer >> {FF00E6}To teleport around, type {FFFF00}/teles",
"{FF0000}SerVer >> {FF00E6}Make sure to visit our web - {FFFF00}www.ngenstunting.com",
"{FF0000}SerVer >> {FF00E6}Basic: {FFFF00}/help {FFFFFF}- {FFFF00}/rules {FFFFFF}- {FFFF00}/t {FFFFFF}- {FFFF00}/v",
"{FF0000}SerVer >> {FF00E6}Donate our server,To keep our server alive"
};
You used 6 but you have only 4 messages. Removing the size completely won't give any error for this again (in the future since you may add/remove messages).


Re: multi-dimensional arrays must be fully initialized - RenovanZ - 23.06.2014

Try this:
pawn Код:
//Anounncements
new Msg;
new Announcements[5][] = { // Announcements[number of announcement messages][string lengh]
"{FF0000}SerVer >> {FF00E6}To teleport around, type {FFFF00}/teles",
"{FF0000}SerVer >> {FF00E6}Make sure to visit our web - {FFFF00}www.ngenstunting.com",
"{FF0000}SerVer >> {FF00E6}Basic: {FFFF00}/help {FFFFFF}- {FFFF00}/rules {FFFFFF}- {FFFF00}/t {FFFFFF}- {FFFF00}/v",
"{FF0000}SerVer >> {FF00E6}Donate our server,To keep our server alive"
};