headshot problem ( team kill )
#1

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{

   
    if(GetPVarInt(playerid, "Headshotted") == 1)
    {
        if (gTeam[playerid] == gTeam[killerid])
        {
            return 0;
        }
        else
        {
        SetPVarInt(playerid, "Headshotted", 0);
        GameTextForPlayer(playerid, "~r~Headshotted", 3000, 3);
        GameTextForPlayer(killerid, "~r~Headshott", 3000, 3);
        }
    }
    return 1;
}

forward CheckHeadShot();
public CheckHeadShot()
{
    new
        index;
    for(new playerid; playerid < maxPlayers; playerid++)
    {
        if(IsPlayerConnected(playerid))
        {
        index = GetPlayerAnimationIndex(playerid);
        if(index == 1173 || index == 1175 || index == 1177 || index == 1178)
        {
                SetPVarInt(playerid, "Headshotted", 1);
                SetPlayerHealth(playerid, 0);
            }
        }
    }
    return 1;
}
it headshot also kills team member. i tried the above code but no change. it is same. killing the team members
Reply


Messages In This Thread
headshot problem ( team kill ) - by Champ - 23.10.2013, 08:02

Forum Jump:


Users browsing this thread: 1 Guest(s)