SA-MP Forums Archive
one weird error - 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: one weird error (/showthread.php?tid=460111)



one weird error - kaos999 - 26.08.2013

i got this filterscript and when i compile it i get one error
Код:
error 025: function heading differs from prototype
Код:
CMD:ltc6( playerid, params[ ] )
{
    new Float:x, Float:y, Float:z, Float:Angle, carid;

	VipCheck( playerid, 1 );

	if ( IsPlayerInAnyVehicle( playerid ) )
		return SendClientMessage( playerid, RED, "ERROR: You already have a vehicle" );

	#if defined VIPS_SEND_COMMAND
	SendVipsCommand( playerid, "/ltc6" );
	#endif
	GetPlayerPos( playerid, x, y, z );
	GetPlayerFacingAngle( playerid, Angle );
    carid = CreateVehicle( 558, x, y, z, Angle, 1, -1, -1 );
	PutPlayerInVehicle( playerid, carid, 0 );//-------------------------ERROR LINE??????<><><><><><><><>
	AddVehicleComponent( carid, 1088 ); 	AddVehicleComponent( carid, 1092 );     AddVehicleComponent( carid, 1073 );
 	AddVehicleComponent( carid, 1139 ); 	AddVehicleComponent( carid, 1010 );  	ChangeVehiclePaintjob( carid, 1 );
   	SetVehicleVirtualWorld( carid, GetPlayerVirtualWorld( playerid ) );
  	LinkVehicleToInterior( carid, GetPlayerInterior( playerid ) );
	return 1;
}



Re: one weird error - DanishHaq - 26.08.2013

Quote:
Originally Posted by kaos999
Посмотреть сообщение
i got this filterscript and when i compile it i get one error
Код:
error 025: function heading differs from prototype
Код:
CMD:ltc6( playerid, params[ ] )
{
    new Float:x, Float:y, Float:z, Float:Angle, carid;

	VipCheck( playerid, 1 );

	if ( IsPlayerInAnyVehicle( playerid ) )
		return SendClientMessage( playerid, RED, "ERROR: You already have a vehicle" );

	#if defined VIPS_SEND_COMMAND
	SendVipsCommand( playerid, "/ltc6" );
	#endif
	GetPlayerPos( playerid, x, y, z );
	GetPlayerFacingAngle( playerid, Angle );
    carid = CreateVehicle( 558, x, y, z, Angle, 1, -1, -1 );
	PutPlayerInVehicle( playerid, carid, 0 );//-------------------------ERROR LINE??????<><><><><><><><>
	AddVehicleComponent( carid, 1088 ); 	AddVehicleComponent( carid, 1092 );     AddVehicleComponent( carid, 1073 );
 	AddVehicleComponent( carid, 1139 ); 	AddVehicleComponent( carid, 1010 );  	ChangeVehiclePaintjob( carid, 1 );
   	SetVehicleVirtualWorld( carid, GetPlayerVirtualWorld( playerid ) );
  	LinkVehicleToInterior( carid, GetPlayerInterior( playerid ) );
	return 1;
}
What happens you remove that line? It compiles perfectly?


Re: one weird error - kaos999 - 26.08.2013

removed it still gives same error?


Re: one weird error - kaos999 - 26.08.2013

any more help


Re: one weird error - kaos999 - 26.08.2013

this needs to be done before i 2daii please(uk time)


Re: one weird error - kaos999 - 26.08.2013

please people


Re: one weird error - DanishHaq - 26.08.2013

Firstly, spamming the topic isn't going to help at all, read the forum rules.

Secondly, try to add this under the first open swigly bracket:

pawn Код:
#pragma unused params
It's just a guess... I'm not sure it will work or not but give it a go.


Re: one weird error - Kirollos - 27.08.2013

um do you have "#include <zcmd>" ?


AW: one weird error - NaS - 27.08.2013

change this:

Код:
CMD:ltc6( playerid, params[ ] )
to this:

Код:
CMD:ltc6(playerid, params[])



Re: AW: one weird error - IceCube! - 27.08.2013

Quote:
Originally Posted by NaS
Посмотреть сообщение
change this:

Код:
CMD:ltc6( playerid, params[ ] )
to this:

Код:
CMD:ltc6(playerid, params[])
Spaces have no effect in pawn... this would not cause the error. THe correct answer was posted above; he was missing
pawn Код:
#include <zcmd>