Hello guys Can you help me with this.
#1

I have made an anti Team killing but its have a problem
When robber shot a cop the cop recover by his own and the same when cop shot robber.
the code
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
    if(gTeam[playerid] == SWAT)
    {
        gTeam[damagedid] = SWAT;
        GivePlayerMoney(playerid,-100);
        SendClientMessage(playerid,COLOR_BLUE,"Stop Shooting your team mates");
        SetPlayerHealth(damagedid,amount);
    }
    if(gTeam[playerid] == Robbers)
    {
        gTeam[damagedid] = Robbers;
        GivePlayerMoney(playerid,-100);
        SendClientMessage(playerid,COLOR_RED1,"Stop Shooting your mates");
        SetPlayerHealth(damagedid,amount);
    }
    return 1;
}
Reply
#2

Solved
Reply
#3

You can simply use "SetPlayerTeam" to prevent team-shooting.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)