Raised This Month: $51 Target: $400
 12% 

[TF2] FB Respawner - Disable/Enable Respawn Times [1.1.0]


Post New Thread Reply   
 
Thread Tools Display Modes
ChickenLover
Junior Member
Join Date: Aug 2010
Old 08-12-2010 , 15:13   Re: [TF2] FB Respawner - Disable/Enable Respawn Times [1.0.4]
Reply With Quote #11

We ran into an issue on our server where if a new map started and no one disconnected or connected the server would just run the default setting in the server.cfg. I added an additional check on round start and that seems to have fixed the issue for us.
ChickenLover is offline
manofphat
Member
Join Date: Mar 2007
Old 09-06-2010 , 16:32   Re: [TF2] FB Respawner - Disable/Enable Respawn Times [1.0.4]
Reply With Quote #12

Didn't work on my server.
Set fb_respawner_minplayers to 6 but with 4 players connected, spawn time were still default. I confirmed the plugin was loaded.
manofphat is offline
Unsichtbar
Member
Join Date: Oct 2007
Old 09-29-2010 , 02:29   Re: [TF2] FB Respawner - Disable/Enable Respawn Times [1.1.0]
Reply With Quote #13

Found a smarter way todo this code, bugs should be fixed. Please let me know if there are any more problems left, thx. For empty or servers with just 1 player "mp_disable_respawn_times" is default set to 1 now.
__________________

Unsichtbar is offline
digi
New Member
Join Date: Sep 2010
Old 09-29-2010 , 14:42   Re: [TF2] FB Respawner - Disable/Enable Respawn Times [1.1.0]
Reply With Quote #14

hey guys, I'm pretty new to this stuff so here it goes. I'm not sure if I installed this mod correctly. I did the following: I put tf2_firebursts_respawn.smx in addons/sourcmod/plugins/ then i edited server.cfg and added: fb_respawner_minplayers x x: here i can put it a random number? thanks that's it or do i need to config more?
digi is offline
ktr
Junior Member
Join Date: Feb 2010
Old 10-12-2010 , 23:44   Re: [TF2] FB Respawner - Disable/Enable Respawn Times [1.1.0]
Reply With Quote #15

The plugin works, but not as expected. Currently, when I set MinPlayers to 10, it takes at least 11 players to enable respawn timer and at most 8 players to disable respawn timer. Why is there a 3 player gab between enabling and disabling? What I am expecting is that it takes at least 10 players to enable respawn timer, and at most 9 players to disable respawn timer. The problem is the client callbacks being used. This is what I did to make this plugin work as expected:

Code:
new Handle:ConMinPlayers = INVALID_HANDLE;
new Handle:ResTime = INVALID_HANDLE;

public OnPluginStart()
{
  	ConMinPlayers = CreateConVar("sm_respawner_threshold", "10", "Respawner Threshold");
  	CreateConVar("sm_respawner_version", PLUGIN_VERSION, "Respawner", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
  	HookConVarChange(ConMinPlayers, onChange);
        ResTime = FindConVar("mp_disable_respawn_times");
}

public OnMapStart()
{
  	ServerCommand("mp_disable_respawn_times 1; mp_respawnwavetime 0; sm_cvar spec_freeze_time -1");
}

public OnClientPostAdminCheck(client)
{
  	doCheck();
}

public OnClientDisconnect_Post(client)
{
  	doCheck();
}

public onChange(Handle:convar, const String:oldValue[], const String:newValue[])
{
  	doCheck();
}

public doCheck()
{
  	new bool:bSetting = GetConVarBool(ResTime);
  	new MinPlayers = GetConVarInt(ConMinPlayers);
  	new NumPlayers = 0;
  	
  	for(new i = 1; i <= MaxClients; i++) 
  	{
  	  	if(IsClientConnected(i) && IsClientInGame(i))
  	  	{
  	  		NumPlayers++;
  	  	}
  	}
  	
  	if(NumPlayers < MinPlayers)
  	{
  		if(bSetting != true)
  	   	{
  	      		ServerCommand("mp_disable_respawn_times 1; mp_respawnwavetime 0; sm_cvar spec_freeze_time -1");
  	      		PrintToChatAll("\x01\x04[SM] Respawn Timer \x01[Disabled]");
  	    	}
  	}
  	else
  	{
  	  	if(bSetting != false)
  	  	{
  	  		ServerCommand("mp_disable_respawn_times 0; mp_respawnwavetime 10.0; sm_cvar spec_freeze_time 4.0");
  	  		PrintToChatAll("\x01\x04[SM] Respawn Timer \x01[Enabled]");
  	   	}
  	}
}

Last edited by ktr; 11-22-2010 at 17:30.
ktr is offline
MrSaturn
SourceMod Donor
Join Date: Jan 2009
Old 10-16-2010 , 15:56   Re: [TF2] FB Respawner - Disable/Enable Respawn Times [1.1.0]
Reply With Quote #16

I am also having trouble with this plugin. I was playing and when my server got full I hadnt noticed until way later that the respawn times were instant even at 24 players. I had set the quota to 8, but it didnt seem to matter. Had to unload it in order to get normal respawn times again.
__________________
MrSaturn is offline
Unsichtbar
Member
Join Date: Oct 2007
Old 11-02-2010 , 06:07   Re: [TF2] FB Respawner - Disable/Enable Respawn Times [1.1.0]
Reply With Quote #17

Gaps between players amounts and so on can be related to fake players, bots and such things. This plugin was not inteded to be used on servers with fake clients or bots. When i write players i mean real human ones. ;)

If you run fake clients, you can try to use ktr's code, he removed the fake client check on the player count part.
__________________

Unsichtbar is offline
ktr
Junior Member
Join Date: Feb 2010
Old 11-22-2010 , 17:13   Re: [TF2] FB Respawner - Disable/Enable Respawn Times [1.1.0]
Reply With Quote #18

Quote:
Originally Posted by Unsichtbar View Post
Gaps between players amounts and so on can be related to fake players, bots and such things. This plugin was not inteded to be used on servers with fake clients or bots. When i write players i mean real human ones. ;)

If you run fake clients, you can try to use ktr's code, he removed the fake client check on the player count part.
The gaps is caused by the callbacks being used. I am using the same callbacks used in the Simple Alltalk plugin and everything works as expected.

Last edited by ktr; 11-22-2010 at 23:48.
ktr is offline
ph
AlliedModders Donor
Join Date: Mar 2006
Old 12-05-2010 , 22:05   Re: [TF2] FB Respawner - Disable/Enable Respawn Times [1.1.0]
Reply With Quote #19

Quote:
Originally Posted by ktr View Post
The plugin works, but not as expected. Currently, when I set MinPlayers to 10, it takes at least 11 players to enable respawn timer and at most 8 players to disable respawn timer. Why is there a 3 player gab between enabling and disabling? What I am expecting is that it takes at least 10 players to enable respawn timer, and at most 9 players to disable respawn timer. The problem is the client callbacks being used. This is what I did to make this plugin work as expected:

Code:
new Handle:ConMinPlayers = INVALID_HANDLE;
new Handle:ResTime = INVALID_HANDLE;

public OnPluginStart()
{
      ConMinPlayers = CreateConVar("sm_respawner_threshold", "10", "Respawner Threshold");
      CreateConVar("sm_respawner_version", PLUGIN_VERSION, "Respawner", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
      HookConVarChange(ConMinPlayers, onChange);
        ResTime = FindConVar("mp_disable_respawn_times");
}

public OnMapStart()
{
      ServerCommand("mp_disable_respawn_times 1; mp_respawnwavetime 0; sm_cvar spec_freeze_time -1");
}

public OnClientPostAdminCheck(client)
{
      doCheck();
}

public OnClientDisconnect_Post(client)
{
      doCheck();
}

public onChange(Handle:convar, const String:oldValue[], const String:newValue[])
{
      doCheck();
}

public doCheck()
{
      new bool:bSetting = GetConVarBool(ResTime);
      new MinPlayers = GetConVarInt(ConMinPlayers);
      new NumPlayers = 0;
      
      for(new i = 1; i <= MaxClients; i++) 
      {
            if(IsClientConnected(i) && IsClientInGame(i))
            {
                NumPlayers++;
            }
      }
      
      if(NumPlayers < MinPlayers)
      {
          if(bSetting != true)
             {
                    ServerCommand("mp_disable_respawn_times 1; mp_respawnwavetime 0; sm_cvar spec_freeze_time -1");
                    PrintToChatAll("\x01\x04[SM] Respawn Timer \x01[Disabled]");
              }
      }
      else
      {
            if(bSetting != false)
            {
                ServerCommand("mp_disable_respawn_times 0; mp_respawnwavetime 10.0; sm_cvar spec_freeze_time 4.0");
                PrintToChatAll("\x01\x04[SM] Respawn Timer \x01[Enabled]");
             }
      }
}

That code does not compile, your help is needed or a compliable attachment is needed.
__________________
ph is offline
ktr
Junior Member
Join Date: Feb 2010
Old 12-07-2010 , 23:18   Re: [TF2] FB Respawner - Disable/Enable Respawn Times [1.1.0]
Reply With Quote #20

I know it doesn't compile. I just posted my changes only to the original source code to help the original author.

Last edited by ktr; 12-08-2010 at 13:07.
ktr is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode