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



error 052: multi-dimensional arrays must be fully initialized - iGetty - 14.06.2012

Код:
(110) : error 052: multi-dimensional arrays must be fully initialized
This is the script:

pawn Код:
new Float:FireLocations[MAX_FIRES][3]=
{
    {0.0,0.0,0.0},
    {0.0,0.0,0.0}
};//line 110
Thanks!


Re: error 052: multi-dimensional arrays must be fully initialized - Azazelo - 14.06.2012

new Float:FireLocations[MAX_FIRES][3]=
{
{0.0,0.0,0.0},
{0.0,0.0,0.0},
{0.0,0.0,0.0}
};//line 110

You say 3 and make just 2 . I think this is a problem.


Re: error 052: multi-dimensional arrays must be fully initialized - iGetty - 14.06.2012

That doesn't do anything Azazelo. I knew that it wouldn't. Because it's only looking at 2, not 3.


Re: error 052: multi-dimensional arrays must be fully initialized - Vince - 14.06.2012

No, the 3 refers to the number of arguments in the third dimension (in this case: x, y, z). The problem is that MAX_FIRES is not defined 2, but something else. You can just leave the first dimension empty, though. The compiler can calculate the size itself.
pawn Код:
new Float:FireLocations[][3]=
{
    {0.0,0.0,0.0},
    {0.0,0.0,0.0}
};

// the following > might < work
#define MAX_FIRES sizeof(FireLocations)



Re: error 052: multi-dimensional arrays must be fully initialized - iGetty - 14.06.2012

Thanks Vince, helped a lot.