OnPlayerTakeDamage - 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 (
/showthread.php?tid=493958)
OnPlayerTakeDamage -
FaZeRs - 10.02.2014
I got error when i added OnPlayerTakeDamage to my GM
Code
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
{
// One shot to the head to kill with sniper rifle
SetPlayerHealth(playerid, 0.0);
}
return 1;
}
Error
PHP код:
C:\Users\Euronics Latvija\Desktop\LCRP\gamemodes\nlrp.pwn(13322) : error 025: function heading differs from prototype
Re: OnPlayerTakeDamage -
EmilLykke - 10.02.2014
That means that
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
is already emplemented somewhere else.
Re: OnPlayerTakeDamage -
[EnErGyS]KING - 10.02.2014
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
Re: OnPlayerTakeDamage -
Mattakil - 10.02.2014
You are using a 0.3x a_samp, but using a 0.3z funtion. Download the 0.3z pawno.
Re: OnPlayerTakeDamage -
FaZeRs - 10.02.2014
Thanks guys.
Re: OnPlayerTakeDamage -
Mahde - 11.02.2014
Mmmmmmmmmmm nice step to kill damaged i'm waiting for 0.3z to be released for all =)
Re: OnPlayerTakeDamage -
M3HR4N - 11.02.2014
0.3z is currectly released -.-
Re: OnPlayerTakeDamage -
Beckett - 11.02.2014
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.