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