Functions heading ...
#1

Код:
public OnVehicleMod(playerid,vehicleid,componentid)
{
	if (playerid!=GetPlayerFromCarlistCar(vehicleid)) {return 1;}
	if(playerid!=-1)
	{
		new mod=GetModType(componentid);
		switch (mod)
		{
		  case 1: { Carlist[playerid][mod1]=componentid; }
		  case 2: { Carlist[playerid][mod2]=componentid; }
		  case 3: { Carlist[playerid][mod3]=componentid; }
		  case 4: { Carlist[playerid][mod4]=componentid; }
		  case 5: { Carlist[playerid][mod5]=componentid; }
		  case 6: { Carlist[playerid][mod6]=componentid; }
		  case 7: { Carlist[playerid][mod7]=componentid; }
		  case 8: { Carlist[playerid][mod8]=componentid; }
		  case 9: { Carlist[playerid][mod9]=componentid; }
		  case 10: { Carlist[playerid][mod10]=componentid; }
		  case 11: { Carlist[playerid][mod11]=componentid; }
		  case 12: { Carlist[playerid][mod12]=componentid; }
		  case 13: { Carlist[playerid][mod13]=componentid; }
		  case 14: { Carlist[playerid][mod14]=componentid; }
		  case 15: { Carlist[playerid][mod15]=componentid; }
		  case 16: { Carlist[playerid][mod16]=componentid; }
		  case 17: { Carlist[playerid][mod17]=componentid; }
		  default: { new string[128]; format(string,128,"Unknown component id: %i",componentid); print(string); }
		}
	}
	return 1;
}

public OnVehiclePaintjob(playerid,vehicleid, paintjobid)
{
	if (playerid!=GetPlayerFromCarlistCar(vehicleid)) {return 1;}
	if(playerid!=-1)
	{
	  Carlist[playerid][Paintjob]=paintjobid;
	}
	return 1;
}

public OnVehicleRespray(playerid,vehicleid, color1, color2)
{
	if (playerid!=GetPlayerFromCarlistCar(vehicleid)) {return 1;}
	if(playerid!=-1)
	{
	  Carlist[playerid][Color1]=color1;
	  Carlist[playerid][Color2]=color2;
	}
	return 1;
}
Quote:

C:\DOCUME~1\17FE8~1.MRK\SKRIVB~1\serv\pawno\CnR.pw n(3261) : error 025: function heading differs from prototype
C:\DOCUME~1\17FE8~1.MRK\SKRIVB~1\serv\pawno\CnR.pw n(3292) : error 025: function heading differs from prototype
C:\DOCUME~1\17FE8~1.MRK\SKRIVB~1\serv\pawno\CnR.pw n(3302) : error 025: function heading differs from prototype

Need some help.
Reply
#2

Quote:
Originally Posted by a_samp.inc
//Prototypes are the forward lines
forward OnVehicleMod(vehicleid, componentid);
forward OnVehiclePaintjob(vehicleid, paintjobid);
forward OnVehicleRespray(vehicleid, color1, color2);
If you read the errors you will know what you did wrong
Reply
#3

Quote:
Originally Posted by ♣ ⓐⓢⓢ
Quote:
Originally Posted by a_samp.inc
//Prototypes are the forward lines
forward OnVehicleMod(vehicleid, componentid);
forward OnVehiclePaintjob(vehicleid, paintjobid);
forward OnVehicleRespray(vehicleid, color1, color2);
If you read the errors you will know what you did wrong
Try downloading the new version of SA:MP. 0.2x has the playerid parameter.
Reply
#4

I got the newest -.-
Reply
#5

any time i have this problem , it has to do with forwarding;

how i see the stuff, is the variables that you define in forward are diffrent then the one on public:
for example:

pawn Код:
forward OnVehicleMod(playerid,vehiclIEd,componentid);
public OnVehicleMod(playerid,vehicleid,componentid)
{
return 1;
}
NOTE THAT THIS IS WRONG!, if i would compile this code, it will errror with the same error you got;

make sure the variables are completely the same;

for example i did above it would be:
pawn Код:
forward OnVehicleMod(playerid,vehicleid,componentid);
public OnVehicleMod(playerid,vehicleid,componentid)
{
return 1;
}
so, check if this is right in your script/includes
Reply
#6

Something wrong in this function I believe:
pawn Код:
GetPlayerFromCarlistCar(vehicleid)
By the way, why are you using this:
pawn Код:
new string[128]; format(string,128,"Unknown component id: %i",componentid); print(string);
if you could just do:
pawn Код:
printf("Unknown component id: %i", componentid);
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)