24.01.2016, 15:36
when my teammate shoot in my head or i shoot him we are dead and we are in 1 team and i set team.how to fix it?
if(GetPlayerTeam(issuerid) != GetPlayerTeam(playerid)) { // If the player giving damage isn't on the players team he's giving damage to.. } else { GameTextForPlayer(issuerid, "~r~DO NOT ATTACK TEAMMATES", 3000, 3); }
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;
}