29.08.2017, 11:39
I wanna prevent headshoting my teammates
i got headshot script but i can headshot my teammates too
CODE:
i got headshot script but i can headshot my teammates too
CODE:
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
{
new string[128], dead[24], killer[24];
GameTextForPlayer(issuerid, "~r~Headshot!",3000,4);
GetPlayerName(playerid, dead, sizeof(dead));
GetPlayerName(issuerid, killer, sizeof(killer));
format(string, sizeof(string), "{FFFF00}%s (%i) {FF0000}Popped {FFFF00}%s (%i) {FF0000}head with a Sniper Rifle", killer, issuerid, dead, playerid);
SendClientMessageToAll(COLOR_WHITE, string);
SetPlayerHealth(playerid, 0.0);
}
return 1;
}