25.01.2016, 14:22
Here you go. Team mates wont be able to headsshot eachother
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID) { //if there is a shooter, probably not needed since besides another player, no one can shoot you in the head, but just in case
if(GetPlayerTeam(issuerid) != GetPlayerTeam(playerid)) { //if their teams dont match aka if they are not same team
switch(bodypart) {
case 9: { //if they got shot in the head
SetPlayerHealth(playerid,0);
Msg(playerid,COLOR_GREEN,"You have been headshotted");
}
}
}
}
return true;
}