My server crashes when I use anti-teamkill..
#1

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;
}
Reply
#2

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
Reply
#3

Thanks guys.
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)