Raised This Month: $ Target: $400
 0% 

How can I get a cvar value from a client?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Reel mafioso
Member
Join Date: Oct 2014
Location: wouldn't you like to kno
Old 05-06-2015 , 15:33   How can I get a cvar value from a client?
Reply With Quote #1

The idea is simple. I need to get a integer, in this case, value of a client's cvar.
I'm trying to make a plugin that would set client's rate and cl_updaterate to fit my private server's limited bandwidth without the hassle of telling them to do it manually.

Code:
#include <amxmodx>
new rate,updrate;
public plugin_init()
{
	register_plugin("Networking cvars", "1", "Reel Mafioso");
}
public client_connect(id)
{
	rate == get_cvar_num("rate"); //This wont work
	updrate == get_cvar_num("cl_updaterate"); //Same
	console_cmd(id,"cl_updaterate %d",get_cvar_num("sv_maxupdaterate"));
	console_cmd(id,"rate %d",get_cvar_num("sv_maxrate"));
	client_print(id,print_console, "******************************************************");
	client_print(id,print_console, "Your rates have been changed for the best performance!");
	client_print(id,print_console, "Reset them back to normal upon leaving if you would like.");
	client_print(id,print_console, "******************************************************");
}
The plugin works in some way, it manages to SET the value to some handy cvars I can change in my config file. But It will not reset it when a client leaves. The main problem is getting and storing his current rate and cl_updaterate
Reel mafioso is offline
 


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 18:43.


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