[HELP] Warning 208: function with tag result used before definition, forcing reparse
#1

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.
Reply
#2

Help Ulan
Reply
#3

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.
Reply
#4

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;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)