SA-MP Forums Archive
error 025: function heading differs from prototype - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: error 025: function heading differs from prototype (/showthread.php?tid=223184)



error 025: function heading differs from prototype - Master_Gangster - 09.02.2011

alright so this is my only error and I want to know how to fix it at last.

here is the code(s):
Код:
stock IsPlayerInZone(playerid, zone[])
{
	new TmpZone[MAX_ZONE_NAME];
	GetPlayer3DZone(playerid, TmpZone, sizeof(TmpZone));
	for(new i = 0; i != sizeof(gSAZones); i++)
	{
		if(strfind(TmpZone, zone, true) != -1)
			return 1;
	}
	return 0;
}
I also have the forward if you want:
Код:
forward IsPlayerInZone(playerid, zoneid);



Re: error 025: function heading differs from prototype - Stigg - 09.02.2011

Here try.

forward IsPlayerInZone(playerid, zone);

You had zoneid.

Peace...


Re: error 025: function heading differs from prototype - Master_Gangster - 09.02.2011

Quote:
Originally Posted by Stigg
Посмотреть сообщение
Here try.

forward IsPlayerInZone(playerid, zone);

You had zoneid.

Peace...
still the same error bro...


Re: error 025: function heading differs from prototype - Stigg - 09.02.2011

You have the function as stock, it dont need forwarding.
Delete the: forward IsPlayerInZone(playerid, zone);

Should work then.

Peace...


Re: error 025: function heading differs from prototype - [L3th4l] - 09.02.2011

Can you show the code using that stock?


Re: error 025: function heading differs from prototype - Master_Gangster - 09.02.2011

Quote:
Originally Posted by Stigg
Посмотреть сообщение
You have the function as stock, it dont need forwarding.
Delete the: forward IsPlayerInZone(playerid, zone);

Should work then.

Peace...
haha thanks bro, that did the job.


Re: error 025: function heading differs from prototype - Stigg - 09.02.2011

No probs m8, glad i could help.

Peace...


Re: error 025: function heading differs from prototype - Mean - 09.02.2011

pawn Код:
forward IsPlayerInZone ( playerid, zoneid );
public IsPlayerInZone ( playerid, zoneid ) // PUBLIC!!!
{
    new TmpZone[ MAX_ZONE_NAME ];
    GetPlayer3DZone ( playerid, TmpZone, sizeof ( TmpZone ) );
    for ( new i = 0; i != sizeof(gSAZones); i++ )
    {
        if ( strfind ( TmpZone, zone, true ) != -1 )
        return 1;
    }
    return 0;
}
Re-Written
If you want to use a forward, you need to make that stock as a public!
Tip for the future