SA-MP Forums Archive
Anti Team-Kill - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Anti Team-Kill (/showthread.php?tid=440490)



Anti Team-Kill - nor15 - 30.05.2013

I saw in many CnR servers that Cops when they shoot another Cop , Their Health don't decrease how can i make it , shall i make it with OnPlayerTakeDamage ?


Re: Anti Team-Kill - Onfroi - 30.05.2013

pawn Код:
SetPlayerTeam(playerid, TEAM);
TeamVariable[playerid] = TEAM_SOMETHING;



Re: Anti Team-Kill - Hoborific - 30.05.2013

https://sampwiki.blast.hk/wiki/SetPlayerTeam

https://sampwiki.blast.hk/wiki/EnableVehicleFriendlyFire


Re: Anti Team-Kill - nor15 - 30.05.2013

can you make it in code , can't get it , or is there a tutorial or something like this


Re: Anti Team-Kill - Onfroi - 30.05.2013

Quote:
Originally Posted by nor15
Посмотреть сообщение
can you make it in code , can't get it , or is there a tutorial or something like this
Just use this to setup your teams..
pawn Код:
stock TeamOne
{
     SetPlayerTeam(playerid, TeamOne);
     TeamVariable[playerid] = TeamOne;
     return 1;
}

stock TeamTwo
{
     SetPlayerTeam(playerid, TeamTwo);
     TeamVariable[playerid] = TeamTwo;
     return 1;
}
That will prevent players from the same team kill each other. Recommended to use this stocks OnPlayerRequestClass.


Re: Anti Team-Kill - nor15 - 30.05.2013

You mean For example :
Код:
#define TEAM_COPS 0
Stock TeamOne
{
       SetPlayerTeam(playerid, TeamOne);
       TeamVariable[playerid] = TeamOne;
       return 1;
}
Public OnPlayerSpawn(playerid)
{
     If(gTeam[playerid] == TEAM_COPS)
     {
           TeamOne(playerid);
           return 1;
     }
}



Re: Anti Team-Kill - nor15 - 30.05.2013

Bump!


Re: Anti Team-Kill - Guest123 - 30.05.2013

show us OnPlayerSpawn


Re: Anti Team-Kill - nor15 - 30.05.2013

I didn;t create it yet , I'm only making an Example , is it right or wrong ?


Re: Anti Team-Kill - GiamPy. - 30.05.2013

The theory is simple.

If a player's team matches to another player's team, those two players with the same team cannot attack each other.