SA-MP Forums Archive
[HELP] Warning 208: function with tag result used before definition, forcing reparse - 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: [HELP] Warning 208: function with tag result used before definition, forcing reparse (/showthread.php?tid=601141)



[HELP] Warning 208: function with tag result used before definition, forcing reparse - KONTROWKEN - 17.02.2016

CODE:
Код:
Float: Vehicle_GetSpeed(vehicleid)
{
    new Float: vx, Float: vy, Float: vz, Float: vel;
	vel = GetVehicleVelocity(vehicleid, vx, vy, vz);
	vel = (floatsqroot(((vx*vx)+(vy*vy))+(vz*vz)) * 181.5);
	return vel;
}
Код:
Warning 208: function with tag result used before definition, forcing reparse
------------------------------------------------------------------------------------------------------------------------------
Код:
forward Float: Vehicle_GetSpeed(vehicleid)
{
    new Float: vx, Float: vy, Float: vz, Float: vel;
	vel = GetVehicleVelocity(vehicleid, vx, vy, vz);
	vel = (floatsqroot(((vx*vx)+(vy*vy))+(vz*vz)) * 181.5);
	return vel;
}
Код:
C:\Users\asdasdasd\Desktop\YENİ SERVER\gamemodes\SERVER-2016.pwn(9714) : warning 219: local variable "vel" shadows a variable at a preceding level
C:\Users\asdasdasd\Desktop\YENİ SERVER\gamemodes\SERVER-2016.pwn(10951) : error 004: function "Vehicle_GetSpeed" is not implemented
C:\Users\asdasdasd\Desktop\YENİ SERVER\gamemodes\SERVER-2016.pwn(11372) : error 001: expected token: ";", but found "{"
C:\Users\asdasdasd\Desktop\YENİ SERVER\gamemodes\SERVER-2016.pwn(11374) : error 010: invalid function or declaration
C:\Users\asdasdasd\Desktop\YENİ SERVER\gamemodes\SERVER-2016.pwn(11376) : error 010: invalid function or declaration
C:\Users\asdasdasd\Desktop\YENİ SERVER\gamemodes\SERVER-2016.pwn(12831) : warning 203: symbol is never used: "vel"
C:\Users\asdasdasd\Desktop\YENİ SERVER\gamemodes\SERVER-2016.pwn(12831) : warning 203: symbol is never used: "vx"
C:\Users\asdasdasd\Desktop\YENİ SERVER\gamemodes\SERVER-2016.pwn(12831) : warning 203: symbol is never used: "vy"
C:\Users\asdasdasd\Desktop\YENİ SERVER\gamemodes\SERVER-2016.pwn(12831) : warning 203: symbol is never used: "vz"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: [HELP] Warning 208: function with tag result used before definition, forcing reparse - KONTROWKEN - 17.02.2016

Help Ulan


Re: [HELP] Warning 208: function with tag result used before definition, forcing reparse - HazardouS - 17.02.2016

You declared a function AFTER you used it in the code.
PHP код:
someFunction()
{
myFunc();
}

myFunc() 
{
//code

You should first declare the function, then use it.


Re: [HELP] Warning 208: function with tag result used before definition, forcing reparse - zPain - 17.02.2016

Quote:
Originally Posted by HazardouS
Посмотреть сообщение
You declared a function AFTER you used it in the code.
PHP код:
someFunction()
{
myFunc();
}
myFunc() 
{
//code

You should first declare the function, then use it.
Yes, when it comes to tagged functions.

Wrong:
PHP код:
public OnGameModeInit() {
    
printf("%f"returnFloat());
    return 
1;
}
Float:returnFloat() {
    return 
1.0;

Right:
PHP код:
Float:returnFloat() {
    return 
1.0;
}
public 
OnGameModeInit() {
    
printf("%f"returnFloat());
    return 
1;