04.05.2014, 23:36
How do i make head shot for sniper only?
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(bodypart == BULLET_HIT_TYPE_HEAD) {
SetPlayerHealth(playerid, 0.0);
new string[128];
format(string, sizeof(string), "HEAD-SHOT: %s has shot you in the head(weaponID %d)", GetName(issuerid) weaponid);
SendClientMessage(playerid, -1, string);
}
return 1;
}
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
{
SetPlayerHealth(playerid, 0.0);
GameTextForPlayer(playerid, "~r~HEADSHOT!", 7000, 5); // Will display to the person who is killed.
SendClilentMessage(issuerid, -1, " Headshot Kill!"); // Will display to the person who killed.
}
return 1;
}