Help me with 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help me with anti team kill (
/showthread.php?tid=184728)
Help me with anti team kill -
ZamaXor - 21.10.2010
Hello, I'm trying to use a anti team kill script on my server. It's not working. It crashed and slow the server and i can't do nothing. What script i must use for anti team kill.
P.S i have edited the timer to 100 but it didn't worked. Also don't say me to use a anti team kill that kills the team killer.
pawn Код:
// top of your gamemode
forward SettingPlayerTeam();
//OnPlayerConnect
SetTimerEx("SettingPlayerTeam",10,1,"d",playerid); // I used 100 but it still crash the server.
//Bottom of your script
public SettingPlayerTeam()
{
for(new playerid; playerid < 200; playerid++)
SetPlayerTeam(playerid, gTeam[playerid]);
return 1;
}
Re: Help me with anti team kill -
Badger(new) - 21.10.2010
Just do:
pawn Код:
public OnPlayerUpdate(playerid)//this is called when the player does anything, so about 10-20 times a second
{
SetPlayerTeam(playerid,gTeam[playerid]);
return 1;
}
Although, it would probably be better to set their team when it gets changed.