04.01.2017, 15:02
Hello all, friends of our samp comunity. I am here, becoz i have a problem with my Headshot system. Players can kill Admin on duty. And that is some annoying for everyone (in special admins) i want to fix that problem. I've made a headshot system but i want that can't kill on duty admin.
Sorry for ma bad english. Here code
Sorry for ma bad english. Here code
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart) if(issuerid != INVALID_PLAYER_ID) // issuerid/ the one who uses the weapon isn't invalid. { if(GetPlayerTeam(playerid) != GetPlayerTeam(issuerid))// checking teams are not same { if(weaponid == 34 && bodypart == 9) // checking the weapon and body part { new str[90]; format(str, sizeof(str), "%s has headshotted %s", pName(issuerid), pName(playerid)); GameTextForPlayer(issuerid, "~r~Headshot!", 3000, 5); GameTextForPlayer(playerid, "~r~Headshotted!", 3000, 5); SendClientMessageToAll(0x5BC178FF, str); SetPlayerHealth(playerid, 0.0); // We will always use float integer because health is in float! } } } return 1; }