SA-MP Forums Archive
[OnPlayerTakeDamage]: 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)
+--- Thread: [OnPlayerTakeDamage]: function heading differs from prototype (/showthread.php?tid=551401)



[OnPlayerTakeDamage]: function heading differs from prototype - zT KiNgKoNg - 18.12.2014

Its a problem that I've never ran into before, still using all the update includes and so that i started my project with, but for some reason its giving me the error (Code can bee seen below), and i know for a fact its correct.

Код:
F:\SA-MP\scripts\gamemodes\this-script.pwn(938) : error 025: function heading differs from prototype
Code:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(IsLogged(playerid) && CharSpawned(playerid))
    {
        if(IsLogged(issuerid) && CharSpawned(issuerid))
            return -1;

        if(IsWearingKevlar(playerid))
        {
            if(bodypart == BODY_PART_TORSO || bodypart == BODY_PART_GROIN)
            {

            }
        }
    }  
    return true;
}



Re: [OnPlayerTakeDamage]: function heading differs from prototype - HydraHumza - 18.12.2014

https://sampforum.blast.hk/showthread.php?tid=488198

Please +Rep if i help you


Re: [OnPlayerTakeDamage]: function heading differs from prototype - zT KiNgKoNg - 18.12.2014

Quote:
Originally Posted by Humza
Посмотреть сообщение
Thanks for you assistance, I wasn't able to find this while search (As for giving you rep, that isn't going to happen because you asked for it. Reputation is earned)


Re: [OnPlayerTakeDamage]: function heading differs from prototype - Luicy. - 18.12.2014

Test this
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(IsLogged(playerid) && CharSpawned(playerid))
    {
        if(IsLogged(issuerid) && CharSpawned(issuerid))
            return 1;

        if(IsWearingKevlar(playerid))
        {
            if(bodypart == BODY_PART_TORSO || bodypart == BODY_PART_GROIN)
            {

            }
        }
    }   
    return true;
}



Re: [OnPlayerTakeDamage]: function heading differs from prototype - HydraHumza - 18.12.2014

Quote:
Originally Posted by zT KiNgKoNg
Посмотреть сообщение
Thanks for you assistance, I wasn't able to find this while search (As for giving you rep, that isn't going to happen because you asked for it. Reputation is earned)
Roger Sir But i see some people doing the same that i did , for now u tell me now i will don't do this thing again thx sir for notifying my mistake


Sorry i am not good in English language

Regards,
Humza


Re: [OnPlayerTakeDamage]: function heading differs from prototype - Threshold - 19.12.2014

Quote:
Originally Posted by SA-MP Wiki
bodypart The body part that was hit. (NOTE: This parameter was added in 0.3z. Leave it out if using an older version!)
Basically, you're using an older version of the 'a_samp' include, which means that the 'bodypart' parameter has not been included, thus you just need to update your SA-MP includes for this error to disappear.