Raised This Month: $ Target: $400
 0% 

query_client_cvar


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
killergirl
Senior Member
Join Date: Jul 2010
Old 03-16-2011 , 12:18   query_client_cvar
Reply With Quote #1

If I execute the command on my self it works, if I execute on other players the console is empty. Why?

PHP Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
    
register_plugin("TEST","1.0","KG")
    
    
register_concmd("amxx_check","checkPlayer",ADMIN_BAN,"<name> - info. players")
}

public 
checkPlayer(idlvlcid)
{
    if( ! ( 
cmd_accessid lvl cid ) ) )
        return 
PLUGIN_HANDLED
        
    
new arg[32];
    
    
read_argv(arg 31)
    
    new 
player cmd_targetidarg1)
    
    if( !
player)
        return 
PLUGIN_HANDLED
        
    query_client_cvar
(player"rate""cvar_result")
    
    return 
PLUGIN_CONTINUE
}

public 
cvar_result(id, const cvar[], const value[])
{
    
console_print(id"rate is: %s"value)
    
    return 
PLUGIN_HANDLED

killergirl is offline
nnajko
Senior Member
Join Date: May 2009
Location: Sweden
Old 03-16-2011 , 12:37   Re: query_client_cvar
Reply With Quote #2

You won't see it because you print it to the checked player
nnajko is offline
killergirl
Senior Member
Join Date: Jul 2010
Old 03-16-2011 , 12:53   Re: query_client_cvar
Reply With Quote #3

Oh, and how can I fix it?
killergirl is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-16-2011 , 15:36   Re: query_client_cvar
Reply With Quote #4

You don't need to query rate value, use get_user_info(player, "rate", szValue, charsmax(szVaue)) and you have it directly.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
killergirl
Senior Member
Join Date: Jul 2010
Old 03-16-2011 , 18:34   Re: query_client_cvar
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
You don't need to query rate value, use get_user_info(player, "rate", szValue, charsmax(szVaue)) and you have it directly.
Yep, I know. It was an example. Anyway, I found the right way to query client cvars.

Thanks for help!
killergirl 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 14:30.


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