function heading differs from prototype -
jakejohnsonusa - 13.03.2013
I keep getting "error 025: function heading differs from prototype" on the following and I can't figure out what's wrong!
This is my code:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && PlayerInfo[playerid][pAdminDuty] != 1)
{
SetPlayerHealth(playerid, 0.0) // One shot to kill with sniper rifle
}
new Float:health;
GetPlayerHealth(playerid,health);
if (health < 20.0)
{
DeathOnTimer[playerid] = SetTimerEx("DeathTimer",22000,true, "i", playerid);
}
}
I get it on this line:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
Anyone know? I have been trying to figure this out for a while, so maybe someone here can help. Yes a_samp is defined.
Thanks: jakejohnsonusa
Re: function heading differs from prototype -
Scenario - 13.03.2013
That code seems fine to me, the only thing I could think of is adding a
return 1 at the end of the callback- but according to the SA:MP wiki that callback doesn't handle returns. However, it's worth a shot, mate!
Re: function heading differs from prototype -
jakejohnsonusa - 13.03.2013
Nope didn't help.
Re: function heading differs from prototype - Patrick - 13.03.2013
i tried to compile your code and it compiles fine. probably the problem is in your a_samp include try replacing it with a latest 0.3x one
EDIT
as i searched on some topic that your a_samp could be modified/edited. try to re-extract your
#include <a_samp>
as your
a_samp include could be modified modified/edited
Simple word. download the latest sa-mp package and replace all include you have now with a new one's
PS: i just rechecked my reply and it doesn't make sense xD. so i edited it. hope you understand it
Re: function heading differs from prototype -
jakejohnsonusa - 13.03.2013
"try to re-extract your #include <a_samp> as a_samp include has been modified/edited"
What do you mean by this? My guess is this is the problem, as I added the code into a FS and it compiled...
Re: function heading differs from prototype - Patrick - 13.03.2013
Try to read it again. sorry for my mistakes. as even i re-read it. and didn't understand so. check my edited reply.
Re: function heading differs from prototype -
jakejohnsonusa - 13.03.2013
Thanks will try this +1!
Re: function heading differs from prototype -
ReneG - 13.03.2013
That error is pretty straight forward.
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
doesn't match the forwarded part