#define WEAPON_BODY_PART_CHEST 3 #define WEAPON_BODY_PART_CROTCH 4 #define WEAPON_BODY_PART_LEFT_ARM 5 #define WEAPON_BODY_PART_RIGHT_ARM 6 #define WEAPON_BODY_PART_LEFT_LEG 7 #define WEAPON_BODY_PART_RIGHT_LEG 8 #define WEAPON_BODY_PART_HEAD 9
public OnPlayerTakeDamage(playerid, issuerid, Float: amount) { if(issuerid != INVALID_PLAYER_ID ) { SetPlayerHealth(playerid, 0.0); } return 1; }
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; }
Код:
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; } |