Raised This Month: $ Target: $400
 0% 

Trouble on Getting a Client Cvar?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
musaulker
Junior Member
Join Date: Oct 2007
Old 10-15-2007 , 17:13   Re: Trouble on Getting a Client Cvar?
Reply With Quote #1

Quote:
Originally Posted by l33tnewb View Post
Try
Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>


#define PLUGIN "TestingCvarPlugin"
#define VERSION "1.0"
#define AUTHOR "test"
Code:
public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    // Add your code here...
}

Code:
public client_connect(id)
{
    client_cmd(id, "say %s", "testing cvar reading from client", id, name);
    query_client_cvar(id, "zoom_sensitivity_ratio", "get_zoom_result_func");
}

public get_zoom_result_func(id, const cvar[], const value[])
{
    new name[32];
    get_user_name(id, name, 31);
    
    log_amx("Client %d(%s)'s zoom_sensitivity_ratio is ^"%s^"", id, name, value);
}  
whats the difference from my post?
musaulker is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-15-2007 , 17:17   Re: Trouble on Getting a Client Cvar?
Reply With Quote #2

Basically your first code is good.
Try this one and tell me if it logs something :

Code:
#include <amxmodx> #define PLUGIN "TestingCvarPlugin" #define VERSION "1.0" #define AUTHOR "test" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     // Add your code here... } public client_putinserver(id) {     client_cmd(id, "say %s", "testing cvar reading from client")     query_client_cvar(id, "zoom_sensitivity_ratio", "cvar_result")     query_client_cvar(id, "cl_cmdrate", "cvar_result") } public cvar_result(id, const cvar[], const value[]) {     new name[32]     get_user_name(id, name, 31)     if(equal(value, "Bad CVAR request"))         log_amx("Client %d(%s) has blocked his cvar %s", id, name, cvar)     else         log_amx("Client %d(%s)'s %s is %s", id, name, cvar, value) }
ConnorMcLeod 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 01:22.


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