What are THOOOOSE
#1

Код:
error 052: multi-dimensional arrays must be fully initialized
Код:
new GZone[MAX_GANG_ZONES][__zoneInfo] =
{
	{{-2010.468017, 835.596069, -1890.468017, 931.596069}, {-1979.951538, 882.668945, 45.203125}},
	{{-1461.562500, -224.193298, -1213.562500, -8.193290}, {-1326.793090, -113.037841, 14.148437}},
	{{-2683.191406, 140.280532, -2563.191406, 268.280517}, {-2613.484130, 203.175033, 4.739866}},
	{{-2693.258789, 1321.876708, -2533.258789, 1465.876708}, {-2626.436279, 1365.055664, 7.086853}},
	{{-2789.775634, 311.090301, -2605.775634, 439.090301}, {-2696.391113, 378.596984, 4.374998}},
	{{-2089.952148, -115.997756, -2001.952148, 36.002246}, {-2068.896728, -3.998784, 35.340000}},
	{{-1672.704223, 7.394767, -1512.704223, 167.394775}, {-1589.698120, 75.215591, 3.554687}},
	{{-2523.148193, 716.738586, -2387.148193, 804.738586}, {-2442.796630, 740.018737, 35.015625}}
};
This is that code, Moreover, the number of line this shows error at is the last closing brace and semi-colon.
Код:
enum __zoneInfo
{
	Float:gzonePos[4],
	Float:gzoneCPPos[3],
	gZone,
	gzoneCP,
	Text3D:gzoneTitle,
	gzoneStatus,
	gzoneLocked,
	gzoneTime,
	gzoneAttack,
	gzoneOwner
}
This is the enum, just in case.

Код:
 warning 208: function with tag result used before definition, forcing reparse
 warning 208: function with tag result used before definition, forcing reparse
warning 219: local variable "using_deprecated_foreach_syntax" shadows a variable at a preceding level
Any ideas what the 3 above warning want to indicate?
Reply
#2

Fixed the error, Redefined MAX_GANG_ZONES as 8, any explanation for the warnings? What can trigger them?
Reply
#3

« 208 - function with tag result used before definition, forcing
reparse
When a function is “used” (invoked) before being declared, and that function returns a value with a tag name, the parser must make an extra pass over the source code, because the presence of the tag name may change the interpretation of operators (in the presence of user-defined operators). You can speed up the parsing/compilation process by declaring the relevant functions before using them. »
Reply
#4

What
._.
the fuck am i supposed to do to fix it :3
Reply
#5

EDIT : Double post - Failed sorry :$
Reply
#6

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
«You can speed up the parsing/compilation process by declaring the relevant functions before using them. »
Do this.

If you declare the function (with tag) before calling it, the warnings will go away.
Reply
#7

Quote:
Originally Posted by iggy1
Посмотреть сообщение
Do this.

If you declare the function (with tag) before calling it, the warnings will go away.
Yep! Try to put your function at the "top" of your script. (2fast4me iggy :$)
Reply
#8

With an example would be easier to understand. When a function returns a value with tag and it is added after the part of code it is called such as:
PHP код:
public OnFilterScriptInit()
{
    
ReturnFloat();
    return 
1;
}
FloatReturnFloat()
{
    return 
0.0;

will give 208 - function with tag result used before definition, forcing reparse.

If you however have the function BEFORE, it will not give that warning:
PHP код:
FloatReturnFloat()
{
    return 
0.0;
}
public 
OnFilterScriptInit()
{
    
ReturnFloat();
    return 
1;

Another solution is using forward keyword such as:
PHP код:
forward FloatReturnFloat();
public 
OnFilterScriptInit()
{
    
ReturnFloat();
    return 
1;
}
FloatReturnFloat()
{
    return 
0.0;

Reply
#9

1. You didn't properly create the array.
2. The variable "using_deprecated_foreach_syntax" is already created.
3. "error 052: multi-dimensional arrays must be fully initialized": use this:
Код:
new GZone[__zoneInfo][MAX_GANG_ZONES] =
Reply
#10

using_deprecated_foreach_syntax: This is foreach/y_iterate's way of telling you that you are using the old foreach format.

Old: foreach(Player, i)
New: foreach(new i: Player)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)