Raised This Month: $ Target: $400
 0% 

Printing query_client_cvar values


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 06-25-2007 , 23:09   Printing query_client_cvar values
Reply With Quote #1

This one has me bugged. In this test code...
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], info[32]
    new pid, iNum, i
    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", "query_results")
        console_print(id, "Exit info %s", g_info)
    }
    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)
    console_print(id, g_info)  // Test info printout
}
The console prints...
Code:
 
Exit info 3TT3V
3TT3V rate=10000 
3TT3V rate=10000 cl_updaterate=45 
3TT3V rate=10000 cl_updaterate=45 cl_cmdrate=45
I put the console_print in the query_results() routine to see what was going on. It shows the info is getting into the g_info array, but the console_print at the end of the cmd_get_rates() prints first and without the query_results() info.

I bet its something ridiculously simple. But I'll be damned if I can find it.
Any ideas???
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
 


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


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