How to make anti-teamkill ?
#1

I have a cnr server and all , cops , cia ,army ,fbi , swat are shoting each other , how can i make so they cant do that?

And how can i make so cops cant shot white people ? I mean so they cant damage each otehr
Reply
#2

https://sampwiki.blast.hk/wiki/SetPlayerTeam
Reply
#3

Well you can set the teams when the players spawn, it will stop the team kills.
Or if you use gTeam use the CallBacks OnPlayerTakeDamage and OnPlayerGiveDamage.
Reply
#4

Even if you use gTeam, you have to use SetPlayerTeam too! that's important for setting up a team rather then using useless callbacks and wasting codes.
Reply
#5

if you are using gTeam. then put this to your gamemode
basically..
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{

    if (gTeam[playerid] == gTeam[damagedid] && amount > 5)
    {
     
         SetPlayerArmedWeapon(playerid, 0);
         GameTextForPlayer(playerid,"~W~TEAM KILL is NOT allowed",2000,3);
     
     
    }
   
    return 0;
}
improve this yourself
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)