Raised This Month: $ Target: $400
 0% 

Rates Plugin for CS


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
QuakerOates
Senior Member
Join Date: Mar 2004
Old 09-11-2004 , 17:01   Rates Plugin for CS
Reply With Quote #1

Need help on this one.
Could some1 customize the plugin for me so i can force the rates i want ppl conecting to the server to us.

thx

Code:
/* AMX Mod script. 
* 
* © Copyright 2002, OLO 
* This file is provided as is (no warranties). 
* 
*/ 

/* 
Controls sv_maxupdaterate (be wise with usage or you will get pings worse). 

cvars: 
amx_ctrlupdaterate <value> - when players is more than that value then 
                                             server starts to lowering sv_udpdaterate                   
amx_maxupdaterate <value> -    this is what you want maximum sv_updaterate to be 
amx_minupdaterate <value> -    this is what you want minimum sv_updaterate to be 
*/ 

#include <amxmodx> 

new low = 0 
new udl = 0 
new bool:calculate = true 

public client_putinserver(id) 
{ 
   if (calculate) 
   { 
      calculate = false 
       
      new maxupd = get_cvar_num("amx_maxupdaterate") 
      new minupd = get_cvar_num("amx_minupdaterate") 
          
      new divv = get_maxplayers() - get_cvar_num("amx_ctrlupdaterate") 
          
      if (divv < 1) 
         divv = 1 
       
      low = (maxupd - minupd) / divv 
      udl = maxupd 
       
      set_cvar_num("sv_maxupdaterate",udl) 
      /*server_print("sv_maxupdaterate set to %d",udl)*/ 
   } 
    
   if ( get_playersnum() > get_cvar_num("amx_ctrlupdaterate") ) 
   { 
      udl -= low 
      set_cvar_num("sv_maxupdaterate",udl) 
      /*server_print("sv_maxupdaterate set to %d",udl)*/ 
   } 
       
   return PLUGIN_CONTINUE 
} 

public client_disconnect(id) 
{ 
   /* get_playersnum still includes this id */ 
   if ( get_playersnum() >= get_cvar_num("amx_ctrlupdaterate") )  
   { 
      udl += low 
      set_cvar_num("sv_maxupdaterate",udl) 
      /*server_print("sv_maxupdaterate set to %d",udl)*/ 
   } 
    
   return PLUGIN_CONTINUE 
} 

public plugin_init()  
{ 
   register_plugin("Bandwidth Control","0.16","H3inBlo3d") 
   register_cvar("amx_ctrlupdaterate","8") 
   register_cvar("amx_maxupdaterate","95") 
   register_cvar("amx_minupdaterate","45") 
   return PLUGIN_CONTINUE 
}
Attached Files
File Type: sma Get Plugin or Get Source (client_rate.sma - 1068 views - 2.0 KB)
__________________
SteamBans.org
QuakerOates is offline
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 09-11-2004 , 19:05  
Reply With Quote #2

http://forums.alliedmods.net/showthr...?p=51227#53981
FeuerSturm is offline
QuakerOates
Senior Member
Join Date: Mar 2004
Old 09-12-2004 , 04:34  
Reply With Quote #3

wondefull
and even better its for .20 as well =]]
__________________
SteamBans.org
QuakerOates 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 17:26.


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