Anti team kill with gteam?
#1

Hi all,im coding new tdm gm,and i've 8 teams.

I need to add anti team kill.I mean,bullets have 0 damage when player shoot at his team mate.

Thanks.
Reply
#2

i dont know anything about your gamemode (how teams are stored)
pawn Код:
public OnPlayerDeath(playerid,killerid,reason)
{
    if(gteam[killerid] == gteam[playerid] && killerid != INVALID_PLAYER_ID)
    {
        SendClientMessage(killerid,COLOR_RED,"You killed your teammate!");
        // code here , example SetPlayerHealth(killerid,0);
    }
}
this topic should be in scripting discussion
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)