How to make simple Headshot system |
Hello Everybody i want to show you code for Headshot system
Lets startt!!!!
One shot to the head to kill with sniper rifle
One Shot to the head to kill with all weapon
Question?
What Is Bodyparts ??
What Is Weaponid ??
Answer!!!!
Bodyparts - http://wiki.sa-mp.com/wiki/Body_Parts
Weaponid - http://wiki.sa-mp.com/wiki/Weapons
Lets startt!!!!
One shot to the head to kill with sniper rifle
Code:
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;
}
Code:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount)
{
if(issuerid != INVALID_PLAYER_ID )
{
// One Shot to the head to kill with all weapon
SetPlayerHealth(playerid, 0.0);
}
return 1;
}
What Is Bodyparts ??
What Is Weaponid ??
Answer!!!!
Bodyparts - http://wiki.sa-mp.com/wiki/Body_Parts
Weaponid - http://wiki.sa-mp.com/wiki/Weapons
Post a Comment