15.12.2015, 18:12
Код:
new bool:HeadShots; CMD:headshot(playerid, params[]) { //isplayeradmin(here) { if(HeadShots == false) { SendClientMessage(playerid, COLOR, "You have enabled headshots"); HeadShots = true; } else { HeadShots = false; SendClientMessage(playerid, COLOR, "You have disabled headshots"); } } return 1; }
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart) { if(issuerid != INVALID_PLAYER_ID && bodypart == 9 && HeadShots == true) { // One shot to the head to kill SetPlayerHealth(playerid, 0.0); } return 1; }