AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   query_client_cvar (https://forums.alliedmods.net/showthread.php?t=152929)

killergirl 03-16-2011 12:18

query_client_cvar
 
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



nnajko 03-16-2011 12:37

Re: query_client_cvar
 
You won't see it because you print it to the checked player

killergirl 03-16-2011 12:53

Re: query_client_cvar
 
Oh, and how can I fix it?

ConnorMcLeod 03-16-2011 15:36

Re: query_client_cvar
 
You don't need to query rate value, use get_user_info(player, "rate", szValue, charsmax(szVaue)) and you have it directly.

killergirl 03-16-2011 18:34

Re: query_client_cvar
 
Quote:

Originally Posted by ConnorMcLeod (Post 1434320)
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!


All times are GMT -4. The time now is 14:30.

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