AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   log condition with client query cvar (https://forums.alliedmods.net/showthread.php?t=160145)

avril-lavigne 06-25-2011 13:08

log condition with client query cvar
 
hi
in this example

Code:

#include <amxmodx>

public plugin_init()
{
    register_plugin("test", "1", "PM");
}

public client_connect(id)
{
    if (!is_user_bot(id))
        query_client_cvar(id, "rate", "cvar_result_func");
}

public cvar_result_func(id, const cvar[], const value[])
{
    new name[32];
    get_user_name(id, name, 31);
   
    log_amx("Client %d(%s)'s rate is ^"%s^"", id, name, value);
}

i need to log only players with certain value in cvar
like only if rate is 20000 . it logs all players....


public cvar_result_func(id, const cvar[], const value[])
{
new name[32];
get_user_name(id, name, 31);

if ..... rate 2000 . than log

log_amx("Client %d(%s)'s rate is ^"%s^"", id, name, value);
}

drekes 06-25-2011 13:24

Re: log condition with client query cvar
 
PHP Code:


if(str_to_num(value) == 2000)
{
    new 
name[32];
    
get_user_name(idnamecharsmax(name));
 
    
log_amx("Client %d(%s)'s rate is ^"%s", id, name, value); 


avril-lavigne 06-25-2011 14:37

Re: log condition with client query cvar
 
thank you)

avril-lavigne 06-25-2011 16:27

Re: log condition with client query cvar
 
I dont know why its not working
just dont log.

drekes 06-25-2011 19:31

Re: log condition with client query cvar
 
post your code

avril-lavigne 06-26-2011 03:11

Re: log condition with client query cvar
 
ok i put

{
return 1


and it works.)


All times are GMT -4. The time now is 23:28.

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