head shot
#1

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?
Reply
#2

Dude, we are no wizards, we dont have your code so we cant fix anything
Reply
#3

Under OnPlayerTakeDamage:

Код:
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);
}
Reply
#4

When the damage from headshot is giving to player, you put a condition for player who shoots and the other one to not be in the same team.
Reply
#5

You aren't clear enough... Do you wan't to create a Headshot system? Or, you already have one and you wan't to delete it?
Reply
#6

Here you go. Team mates wont be able to headsshot eachother

PHP код:
public OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart)
{
    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;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)