Raised This Month: $ Target: $400
 0% 

Cvar changing msgs were sent to clients frequently


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hzqst
Senior Member
Join Date: Jul 2008
Old 08-07-2010 , 02:56   Cvar changing msgs were sent to clients frequently
Reply With Quote #1

I use
PHP Code:
public Accelerate_Fix(){
 
set_cvar_num("sv_accelerate"10)
 
set_task(0.1"Accelerate_Fix")

to prevent sv_accelerate from changing by game and works fine,but
a lot of messages could be seen in client's console like :
Quote:
"sv_accelerate" changed to "5"
"sv_accelerate" changed to "10"
"sv_accelerate" changed to "5"
"sv_accelerate" changed to "10"
....
It caused overflow, sometimes most clients were kicked by reason " "
How to prevent it from overflowing or block suck these messages?
hzqst is offline
infek
Senior Member
Join Date: May 2009
Location: Behind you
Old 08-07-2010 , 03:53   Re: Cvar changing msgs were sent to clients frequently
Reply With Quote #2

not sure if it will work but try this
PHP Code:
#include <amxmodx>

new aa;
public 
plugin_init() {
    
register_plugin"Acceleration""0.1""iNfek" )
    
    
aa get_cvar_pointer"sv_accelerate" )
}

public 
plugin_cfg( ) {
    
set_cvar_string"sv_accelerate""10" )
}

public 
AA( ) {
    if( 
aa 10 )
    {
        
server_cmd"sv_accelerate 10" )
    }
    if( 
aa 10 )
    {
        
server_cmd"sv_accelerate 10" )
    }

__________________
"Domo Arigato, Mr. Roboto!"
PM me if you want to know a secret

Last edited by infek; 08-07-2010 at 04:04. Reason: I did AirAcceleration
infek is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-07-2010 , 09:44   Re: Cvar changing msgs were sent to clients frequently
Reply With Quote #3

get_cvar_pointer() returns just a POINTER, you need to use set/get_pcvar_*(pointer, ...), it doesn't hold and update the value... also, the AA() function won't trigger because it's not called anywhere.

You *could* use set_pcvar_num(), I think that doesn't trigger the console messages... however, this is much more efficient: http://forums.alliedmods.net/showthread.php?t=120866
__________________
Hunter-Digital is offline
hzqst
Senior Member
Join Date: Jul 2008
Old 08-08-2010 , 01:33   Re: Cvar changing msgs were sent to clients frequently
Reply With Quote #4

thanks works fime
hzqst is offline
Reply


Thread Tools
Display Modes

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 00:07.


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