error 018: initialization data exceeds declared size
#1

I don't understand why im getting theses errors for the following code
Код:
new Float:GroveRandomSpawns[3][3] = {
	{2488.4663,-1685.7067,13.5092},
	{2505.3184,-1656.6368,13.5938},
	{2505.5000,-1682.6000,13.5469},
};

new Float:BallasRandomSpawns[3][3] = {
	{2012.7721,-1107.1403,26.2032},
	{2004.1615,-1121.5463,26.7073},
	{1998.9436,-1142.8440,25.5315},
};
What do I have to fix?
Reply
#2

Try and remove the comma of the last float in the { and } brackets, as follows:

pawn Код:
new Float:Name[3][3] = {
        {...},
        {...},
        {...} // there is no comma here
};
So:

pawn Код:
new Float:GroveRandomSpawns[3][3] = {
    {2488.4663,-1685.7067,13.5092},
    {2505.3184,-1656.6368,13.5938},
    {2505.5000,-1682.6000,13.5469}
};

new Float:BallasRandomSpawns[3][3] = {
    {2012.7721,-1107.1403,26.2032},
    {2004.1615,-1121.5463,26.7073},
    {1998.9436,-1142.8440,25.5315}
};
Reply
#3

Wow thanks silly me for not knowing
Reply
#4

Can I give you a suggestion try doing this.

pawn Код:
enum XYZ { xPos, yPos, zPos }

stock const Float:BallasRandomSpawns[][XYZ] = {
    {2012.7721,-1107.1403,26.2032},
    {2004.1615,-1121.5463,26.7073},
    {1998.9436,-1142.8440,25.5315}
};
That will help out a lot in the long run.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)