OnPlayerTakeDamage
#1

Hello so i made a one shot headshot with a sniper in OnPlayerTakeDamage callback
but it seems that i have a error

here is my code
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        SetPlayerHealth(playerid, 0.0);
        PlayAudioStreamForPlayer(issuerid,"http://audioformat.com/download/headshot.mp3");
    }
    return 1;
}
Here is the error
pawn Код:
TDMv1.0.pwn(789) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

And i have the full version of 0.3z i just forgot that this sections if for RC versions
Any help guys i dont know whats the problem and i have the updated version
Reply
#3

You must be having the latest 0.3z include, make sure that the 'pawno.exe' application is being opened from the location where it got 3z includes. Or,
pawn Код:
//before onplayertakedamage
#if defined OnPlayerTakeDamage
    #undef OnPlayerTakeDamage
#endif

forward OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        SetPlayerHealth(playerid, 0.0);
        PlayAudioStreamForPlayer(issuerid,"http://audioformat.com/download/headshot.mp3");
    }
    return 1;
}
Reply
#4

But when i compile it says that i have this symbol defined already and i have the latest samp server version i have downloaded the offical release of the full version and i get this problem and i cant use pawn i am using Notpad++ because of a problem that pawno launches the game after compiling
Reply
#5

Ah can i get any help guys?
I dont know why i get this problem i even checked a_samp.inc to check if its there and it is with the body part thing
Reply
#6

Are you sure that it's having problems with your script or any other includes? Because if you're using any libraries before the 0.3z release, you must update them too as if they might collide with the older versions.
Reply
#7

I have updated all the server files even server.cfg and anti lag shoot works but the OnPlayerTakeDamage isnt everything works except that
Reply
#8

check all the includes you used... maybe one of them is using OnPlayerTakeDamage update the callback.
Reply
#9

You need to update YSI by ******
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)