SA-MP Forums Archive
Scripting help - 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: Scripting help (/showthread.php?tid=522978)



Scripting help - kirostar - 30.06.2014

I got this error :

Код:
warning 235: public function lacks forward declaration (symbol "Speedometer")
Code :

Код:
public Speedometer(playerid) // This line that have the error :?
{
	new vehicleid,Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,speed_string[256],final_speed_int;
	vehicleid = GetPlayerVehicleID(playerid);
	if(vehicleid != 0)
	{
		GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z);
		final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*250.666667; // 250.666667 = kmph  // 199,4166672 = mph
		final_speed_int = floatround(final_speed,floatround_round);
		format(speed_string,256,"Speed: %i",final_speed_int);
		TextDrawSetString(SPEEDOS[playerid], speed_string);
	}
	else
	{
		TextDrawSetString(SPEEDOS[playerid], " ");
	}
    return 1;
}



Re: Scripting help - Lynn - 30.06.2014

pawn Код:
//TOP OF SCRIPT
forward Speedometer(playerid);
When you see 'Lacks forward declaration' it means you forgot to add
forward FunctionName(); to your script.
In this case;
forward Speedometer(playerid);


Re: Scripting help - kirostar - 30.06.2014

Thanks @Lynn