21.01.2015, 23:26
Try one of those, or each.
You could put your codes at only one, but it's better that way and should be synced
You could put your codes at only one, but it's better that way and should be synced
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
if(weaponid == WEAPON_SNIPER && bodypart == 9) //If it's a sniper headshot
{
new Float:h; GetPlayerHealth(damagedid, h);
if(h - amount < 0.1)//If that shot killed him
{
GameTextForPlayer(playerid, "~r~Headshotted", 3000, 3);
}
}
}
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(weaponid == WEAPON_SNIPER && bodypart == 9) //If it's a sniper headshot
{
new Float:h; GetPlayerHealth(playerid, h);
if(h - amount < 0.1)//If that shot killed him
{
//Do something
GameTextForPlayer(playerid, "~r~Headshotted", 3000, 3);
}
}
return 1;
}