anti-teamkill
#1

I am looking for good anti teamkill not anti team kill kick.
SetPlayerTeam doesn't work.
OPSP works, but when you spam it, he still reduces health.
I want something like TDM servers when you spam the enemy, he/she doesn't reduce health.
What is that secret?
Reply
#2

Try using OnPlayerWeaponShot
https://sampwiki.blast.hk/wiki/OnPlayerWeaponShot
Note: They will still get hurt if its not a weapon that shoots.
Reply
#3

Okay, I'll try.
_________
Thanks man
Reply
#4

You can easily use SetPlayerTeam(playerid, id); to make an anti team kill.

Example:

pawn Код:
if(classid == 0)
{
   SetPlayerTeam(playerid, 1);
}
if(classid == 1)
{
   SetPlayerTeam(playerid, 1);
}
if(classid == 3)
{
   SetPlayerTeam(playerid, 255);
}
Class 1 and 2 can't kill each other, class 1 and 2 can kill class 3, class 3 can kill class 1 and 2.
255 = Null.
Reply
#5

Quote:
Originally Posted by Extraordinariness
Посмотреть сообщение
SetPlayerTeam doesn't work.
lol.
Reply
#6

Quote:
Originally Posted by Extraordinariness
Посмотреть сообщение
lol.
SetPlayerTeam works.

Yes it does, its not my fault you don't know how to use it in a proper way... Go get some scripting skills before placing false statements...
Reply
#7

Put this ontop of your script.

pawn Код:
forward TeamProtection();
This under OnGameModeInIt()

pawn Код:
SetTimer("TeamProtection", 5000 ,true);
dis anywhere in your script, I'm using SetPlayerTeam yes, you said it didnt work, but I'm sure 100% this waay anti-teamkll style will work.

pawn Код:
public TeamProtection()
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            SetPlayerTeam(i, gTeam[i]);
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)