error 052: multi-dimensional arrays must be fully initialized
#1

Код:
#define MAX_ZONES 6
enum dZones
{
	Name[128],
	Float:MinX,
	Float:MinY,
	Float:MaxX,
	Float:MaxY,
	Float:Z,
	Team,
	ID
}
new Zones[MAX_ZONES][dZones] =
{
	{"Soviet Union Base", 1.0, 1.0, 1.0, 1.0, 20.0, -1, 0},
	{"Germany Base", 1.0, 1.0, 1.0, 1.0, 20.0, -1, 0},
	{"United States Base", 1.0, 1.0, 1.0, 1.0, 20.0, -1, 0},
	{"Great Britain Base", 1.0, 1.0, 1.0, 1.0, 20.0, -1, 0},
	{"Test Gangzone", 19.532827, 2013.186401, 67.532829, 2061.186523, 234, -1, 0} // error line
}; //error line
Код:
C:\Users\TheSimpleGuy\Desktop\SA-MP Server\gamemodes\wfr.pwn(62) : warning 213: tag mismatch
C:\Users\TheSimpleGuy\Desktop\SA-MP Server\gamemodes\wfr.pwn(63) : error 052: multi-dimensional arrays must be fully initialized
Reply
#2

You say the array has to have 6 elements and you put only 5. Hence, error. What you should do is remove the MAX_ZONES define and let the compiler set the size. In loops, use sizeof.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
You say the array has to have 6 elements and you put only 5. Hence, error. What you should do is remove the MAX_ZONES define and let the compiler set the size. In loops, use sizeof.
Ready code:

Код:
enum dZones
{
	Name[128],
	Float:MinX,
	Float:MinY,
	Float:MaxX,
	Float:MaxY,
	Float:Z,
	Team,
	ID
}
new Zones[][dZones] =
{
	{"Soviet Union Base", 1.0, 1.0, 1.0, 1.0, 20.0, -1, 0},
	{"Germany Base", 1.0, 1.0, 1.0, 1.0, 20.0, -1, 0},
	{"United States Base", 1.0, 1.0, 1.0, 1.0, 20.0, -1, 0},
	{"Great Britain Base", 1.0, 1.0, 1.0, 1.0, 20.0, -1, 0},
	{"Test Gangzone", 19.532827, 2013.186401, 67.532829, 2061.186523, 234, -1, 0}
};
Reply
#4

Thank you! But now, I don't understand, my line 62 is still on its error, "tag mismatch". My parameters were correct, right?
Reply
#5

#define MAX_ZONES 5
enum dZones
{
Name[128],
Float:MinX,
Float:MinY,
Float:MaxX,
Float:MaxY,
Float:Z,
Team,
ID
}
new Zones[MAX_ZONES][dZones] =
{
{"Soviet Union Base", 1.0, 1.0, 1.0, 1.0, 20.0, -1, 0},
{"Germany Base", 1.0, 1.0, 1.0, 1.0, 20.0, -1, 0},
{"United States Base", 1.0, 1.0, 1.0, 1.0, 20.0, -1, 0},
{"Great Britain Base", 1.0, 1.0, 1.0, 1.0, 20.0, -1, 0},
{"Test Gangzone", 19.532827, 2013.186401, 67.532829, 2061.186523, 234, -1, 0}
};
Try this
Reply
#6

Quote:
Originally Posted by TheSimpleGuy
Посмотреть сообщение
Thank you! But now, I don't understand, my line 62 is still on its error, "tag mismatch". My parameters were correct, right?
The error:

Код:
{"Test Gangzone", 19.532827, 2013.186401, 67.532829, 2061.186523, 234, -1, 0}
Need:

Код:
{"Test Gangzone", 19.532827, 2013.186401, 67.532829, 2061.186523, 234.0, -1, 0}
Try this.

234 - integer
234.0 - float
Reply
#7

Thanks for Integer-Float tip!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)