Errors occur when using latest Zeex compiler. - 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: Errors occur when using latest Zeex compiler. (
/showthread.php?tid=645043)
Errors occur when using latest Zeex compiler. -
RageCraftLV - 18.11.2017
Код:
C:\Users\Madars\Desktop\Motion-RP\gamemodes\motiongm.pwn(2966) : error 092: functions may not return arrays of unknown size (symbol "Convert")
C:\Users\Madars\Desktop\Motion-RP\gamemodes\motiongm.pwn(3372) : warning 213: tag mismatch
C:\Users\Madars\Desktop\Motion(ions may not return arrays of unknown size (symbol "Convert")
C:\Users\Madars\Desktop\Motion-RP\gamemodes\motiongm.pwn(4997) : error 092: functions may not return arrays of unknown size (symbol "Convert")
C:\Users\Madars\Desktop\Motion-RP\gamemodes\motiongm.pwn(7094) : error 092: functions may not return arrays of unknown size (symbol "Convert")
C:\Users\Madars\Desktop\Motion-RP\gamemodes\motiongm.pwn(7134) : error 092: functions may not return arrays of unknown size (symbol "Convert")
C:\Users\Madars\Desktop\Motion-RP\gamemodes\motiongm.pwn(7174) : error 092: functions may not return arrays of unknown size (symbol "Convert")
C:\Users\Madars\Desktop\Motion-RP\gamemodes\motiongm.pwn(12426) : error 092: functions may not return arrays of unknown size (symbol "Cof unknown size (symbol "Cof unknown size (symbol "Convert")
C:\Users\Madars\Desktop\Motion-RP\gamemodes\motiongm.pwn(22094) : error 092: functions may not return arrays of unknown size (symbol "Convert")
C:\Users\Madars\Desktop\Motion-RP\gamemodes\motiongm.pwn(23359) : error 092: functions may not return arrays of unknown size (symbol "Convert")
Pawn compiler 3.10.4 Copyright © 1997-2006, ITB CompuPhase
9 Errors.
These show up after I put in Zeex pawn patch v3.10.4. All the v3 versions give me this error. For now I'm using Zeex compiler from 2015.
Here's Convert function
Код:
stock Convert(seconds, stringTo[], size = sizeof(stringTo))
{
stringTo[0] = 0x0;
new result[4];
result[0] = floatround(seconds / (3600 * 24));
result[1] = floatround(seconds / 3600);
result[2] = floatround((seconds / 60) - (result[1] * 60));
result[3] = floatround(seconds - ((result[1] * 3600) + (result[2] * 60)));
switch(result[0])
{
case 0:
{
switch(result[1])
{
case 0: format(stringTo,size,"%02d:%02d",result[2],result[3]);
default: format(stringTo,size,"%d:%02d:%02d",result[1],result[2],result[3]);
}
}
}
return stringTo;
}
For example line 2966
Код:
for(new i = 0; i < sizeof(GZInfo); i++)
{
if(GZSafeTime[i] > 0)
{
GZSafeTime[i]--;
foreach(new x: Player)
{
if(PI[x][pMember] == GZInfo[i][gNapad] || PI[x][pMember] == GZInfo[i][gFrak])
{
Convert(GZSafeTime[i], stringText); // line 2966
PlayerTextDrawSetString(x, CaptureTD[x][2], stringText);
}
}
}
}
Really want to use Zeex compiler because of the speed improvement. GM takes a while to compile.
Re: Errors occur when using latest Zeex compiler. -
Konstantinos - 18.11.2017
What's the point of passing the array string by reference and at the same time return it? Use one way or another, not both.
Re: Errors occur when using latest Zeex compiler. -
RageCraftLV - 18.11.2017
So I can just rename "return stringTo;" to "return 1;"?
Re: Errors occur when using latest Zeex compiler. -
Konstantinos - 18.11.2017
Yes, either return a value or don't return anything - it is not a mandatory thing.
Re: Errors occur when using latest Zeex compiler. -
RageCraftLV - 18.11.2017
It worked, thanks! Just gotta check if Convert still works as intended. Love how fast it compiles now.