OnPlayerTakeDamage
#1

I got error when i added OnPlayerTakeDamage to my GM

Code
PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    if(
issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        
// One shot to the head to kill with sniper rifle
        
SetPlayerHealth(playerid0.0);
    }
    return 
1;

Error
PHP код:
C:\Users\Euronics Latvija\Desktop\LCRP\gamemodes\nlrp.pwn(13322) : error 025: function heading differs from prototype 
Reply
#2

That means that
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
is already emplemented somewhere else.
Reply
#3

You using 0.3x a_samp.inc you need to use 0.3z a_samp.inc, because "BodyPart" was added only in 0.3z Or you just can remove Bodypart
Reply
#4

You are using a 0.3x a_samp, but using a 0.3z funtion. Download the 0.3z pawno.
Reply
#5

Thanks guys.
Reply
#6

Mmmmmmmmmmm nice step to kill damaged i'm waiting for 0.3z to be released for all =)
Reply
#7

0.3z is currectly released -.-
Reply
#8

If you wanna stay on 0.3x remove bodypart.

Quote:

bodypart The body part that was hit. (NOTE: This parameter was added in 0.3z. Leave it out if using an older version!)

Read wiki next time.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)