Whats wrong?
#1

Can some1 explain me how to fiz this compiler error?

Quote:

error 025: function heading differs from prototype

ty vm
Reply
#2

That happens when you give a public function the wrong parameters. Like this.

pawn Код:
forward Blah(playerid,gun);

public Blah()
{
  //
}
Reply
#3

the green //?
So i must delete that?
Reply
#4

no, he means that you have to make Blah() the same as what you did "forward" to.
Reply
#5

Quote:
Originally Posted by Pawn documentation, the thing you should read before posting:
025 function heading differs from prototype

The number of arguments given at a previous declaration of the function does not match the number of arguments given at the current declaration.
Reply
#6

ok the prototype is:

Quote:

forward OnVehicleMod(vehicleid, componentid);

and what is wrong is: (at least it tells that difers from prototype)

Quote:

public OnVehicleMod(vehicleid, componentid)
{
if(vehicleid >= nstaticcars)
{
vehicleid = vehicleid - nstaticcars;
SaveComponent(vehicleid,componentid);
}

Quote:

public OnVehiclePaintjob(vehicleid, paintjobid)
{
if(vehicleid >= nstaticcars)
{
if(IsaCarforsell(vehicleid) == 0)
{
new carnfoid;
carnfoid = vehicleid - nstaticcars;
CarsInfo[carnfoid][cpaintjob] = paintjobid;
}
}

}

and

Quote:

public OnVehicleRespray(vehicleid, color1, color2)
{
if(vehicleid >= nstaticcars)
{
if(IsaCarforsell(vehicleid) == 0)
{
new carnfoid;
carnfoid = vehicleid - nstaticcars;
CarsInfo[carnfoid][ccolor1] = color1;
CarsInfo[carnfoid][ccolor2] = color2;
}
}

}

Reply
#7

no, in 0.2.x it was changed to OnVehicleMod(playerid,vehid,componentid);
Reply
#8

Quote:
Originally Posted by Shellegg
the green //?
So i must delete that?
Wow..
That's all what I have to say.
public name changed.
Reply
#9

chaged to what?
already added "vehid," and it stills gives me the same error

Quote:

(111)error 025: function heading differs from prototype

line 111
Quote:

forward OnVehicleMod(vehicleid, vehid, componentid);

Reply
#10

get rid of the forward and change the function to be
pawn Код:
public OnVehicleMod(playerid,vehicleid,componentid)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)