function heading differs from prototype
#1

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
Reply
#2

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!
Reply
#3

Nope didn't help.
Reply
#4

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
Reply
#5

"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...
Reply
#6

Try to read it again. sorry for my mistakes. as even i re-read it. and didn't understand so. check my edited reply.
Reply
#7

Thanks will try this +1!
Reply
#8

That error is pretty straight forward.

public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)

doesn't match the forwarded part
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)