Raised This Month: $ Target: $400
 0% 

Printing query_client_cvar values


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 06-26-2007 , 10:46   Re: Printing query_client_cvar values
Reply With Quote #5

Got it figured out. After you 'schooled' me on the workings of query_client_cvar(), I figured all that I had to do was make the last cvar query produce the desired output. So I pointed the last query to a separate routine and it seems to work.
Code:
#include <amxmodx>
#include <amxmisc>
 
#define PLUGIN "Players' Rate CVars"
#define VERSION "1.0"
#define AUTHOR "Vet(3TT3V)"
 
new g_info[256]
new g_pos
 
public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_concmd("amx_rate_info", "cmd_get_rates", ADMIN_CFG, "Get players' rate CVars")
}
 
public cmd_get_rates(id)
{
    static iPlayers[32]
    new pid, iNum, i, info[32]
    get_players(iPlayers, iNum, "ch")
    for (i = 0; i < iNum; i++) {
        pid = iPlayers[i]
        get_user_name(pid, info, 31)
        g_pos = format(g_info, 255, "%s ",info)
        query_client_cvar(pid, "rate", "query_results")
        query_client_cvar(pid, "cl_updaterate", "query_results")
        query_client_cvar(pid, "cl_cmdrate", "out_results")
    }
    return PLUGIN_HANDLED
}
 
public query_results(id, cvar_name[], cvar_value[])
{
    g_pos += format(g_info[g_pos], 255, "%s=%s ", cvar_name, cvar_value)
}
 
public out_results(id, cvar_name[], cvar_value[])
{
    g_pos += format(g_info[g_pos], 255, "%s=%s ", cvar_name, cvar_value)
    console_print(id, "Exit info %s", g_info)
}
Thanks!
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
 



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 21:34.


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