SA-MP Forums Archive
Team Killing (rep++) - 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: Team Killing (rep++) (/showthread.php?tid=339122)



Team Killing (rep++) - iOmar - 02.05.2012

hey Guys.
==> My server is hosted so i want anti-team kill. Like if some player kill his own member than he will get warning and 3 warn=kick... Pleazzzzzzzzzz


Re: Team Killing (rep++) - MP2 - 02.05.2012

If you use SetPlayerTeam there is a native anti-team kill.


Re: Team Killing (rep++) - iOmar - 02.05.2012

I didn't understand. Can u clear it?? Please...


Re: Team Killing (rep++) - kikito - 02.05.2012

Quote:
Originally Posted by MP2
Посмотреть сообщение
If you use SetPlayerTeam there is a native anti-team kill.
https://sampwiki.blast.hk/wiki/SetPlayerTeam


Re: Team Killing (rep++) - $$inSane - 02.05.2012

hey omar just punt this line where u add teams: SetPlayerTeam(playerid, 0);
this will help u and u can change the numeric for different teams. this is anti team kill system.


Re: Team Killing (rep++) - Nєχυѕ - 02.05.2012

There are two ways to do this...
1) Use SetPlayerTeam
2)//Paste this under OnPlayerGiveDamage
pawn Код:
if(gTeam[killerid] == gTeam[playerid])
{
    new Float:h;
    GetPlayerHealth(damagedid,h);
    SetPlayerHealth(damagedid,h+amount);
}



Re: Team Killing (rep++) - iOmar - 03.05.2012

i adde setplayerteam at onplayer spawn?? So thats it??


Re: Team Killing (rep++) - JaKe Elite - 03.05.2012

Not OnPlayerSpawn put it OnPlayerRequestClass
check the classid (the skinid) Ex. i have the CJ Skin which is Groove Street Leader
When player have CJ Skin use SetPlayerTeam

that is example only


Re: Team Killing (rep++) - iOmar - 03.05.2012

I have four classes. So i need to add 4 different setplayer team??


Re: Team Killing (rep++) - JaKe Elite - 03.05.2012

if you already defined the team id you can just do like this

OnPlayerRequestClass:

pawn Код:
switch(classid)
{
   case 28, 29: //if player has skinid 28/29 player team will be set to TEAM_DRUG_DEALER
   {
      SetPlayerTeam(playerid, TEAM_DRUG_DEALER);
   }
}
That is example only.