An error headshot system
#1

Hello, i'm tring to do headshot system only for sniper, but it won't work with me, and giving me one Error.



Code
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart) // this line is 7981
{
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        SetPlayerHealth(playerid, 0);
        SetPlayerArmour(playerid, 0);
    }
    return 1;
}
Error
pawn Код:
(7981) : error 025: function heading differs from prototype
Reply
#2

Maybe, this can help you:
https://sampforum.blast.hk/showthread.php?tid=488198
Reply
#3

I'm not sure what is wrong, there seems to be nothing wrong with it and it looks fine. Because, the error is on the top of the callback (OnPlayerTakeDamage), it could mean there is something wrong with the script a few lines above it.

I have the same script in my GameMode, and it seems to be running perfectly fine with no errors. This is what I've got:

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        SetPlayerHealth(playerid, 0.0);
    }
    return 1;
}
And, I don't think you really need the armour set to 0 because when someone's health is set to 0 their armour automatically is set to 0 aswell. That's what I think

EDIT: I have tested your script out in my GameMode, and it comes up with no errors. As I've mentioned before, there could be a problem with the script a few lines above this callback. Would you mind posting what's above it?
Reply
#4

that means that you have two callbacks of OnPlayerTakeDamage, search for the other one and remove it
Reply
#5

Quote:
Originally Posted by Sawalha
Посмотреть сообщение
that means that you have two callbacks of OnPlayerTakeDamage, search for the other one and remove it
If he had two, wouldn't the error message be something like,

Код:
error 021: symbol already defined: "S@@_OnPlayerTakeDamage
Reply
#6

ah wait, i have OnPlayerShootPlayer and OnPlayerTakeDamage and onplayershootplayer dosen't have bodypart, and i'm using it, what should i do?
Reply
#7

Ok, I had managed to find a fix for this. Go into your server directory then find your,

Код:
pawno/include
folder and find the YSI folder and the YSI include and replace it with this download below. Just extract and move it into your pawno/include folder and it should fix your problem

http://www.mediafire.com/download/yx...pl/include.zip
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)