SA-MP Forums Archive
My server crashes when I use anti-teamkill.. - 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: My server crashes when I use anti-teamkill.. (/showthread.php?tid=90619)



My server crashes when I use anti-teamkill.. - _Vortex - 09.08.2009

Hey when I use this code, when a user trys to connect to the server, they connect, stay connect for a few seconds, then they get disconnected. But i need anti-team kill because i have a TDM server..

Код:
// top of your gamemode
forward SettingPlayerTeam();
//OnPlayerConnect
SetTimerEx("SettingPlayerTeam",10,1,"d",playerid);
//Bottom of your script
public SettingPlayerTeam()
{
  for(new playerid; playerid < 200; playerid++)
    SetPlayerTeam(playerid, gTeam[playerid]);
  return 1;
}



Re: My server crashes when I use anti-teamkill.. - [FTW]Spitfire757 - 14.08.2009

Hmmm, try putting the interval higher, put the interval to something like 100 or 500.

here is it with 100 (you can do this yourself, but I'll save you the trouble XD)
Код:
// top of your gamemode
forward SettingPlayerTeam();
//OnPlayerConnect
SetTimerEx("SettingPlayerTeam",100,1,"d",playerid); //Try 100, if this doesn't work, try 500
//Bottom of your script
public SettingPlayerTeam()
{
  for(new playerid; playerid < 200; playerid++)
    SetPlayerTeam(playerid, gTeam[playerid]);
  return 1;
}
PS: I'm not that good at scripting, but its just a thought



Re: My server crashes when I use anti-teamkill.. - _Vortex - 14.08.2009

Thanks guys.


Re: My server crashes when I use anti-teamkill.. - iLinx - 14.08.2009

doesn't SetPlayerTeam make an auto antiteamkill?
Sorry if im wrong, when i had a zombies gamemode it seemed to eliminate the need for an anti teamkill