Raised This Month: $ Target: $400
 0% 

query_client_cvar


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Bello
BANNED
Join Date: Jun 2010
Old 06-17-2010 , 20:45   query_client_cvar
#1

Hi! I have a problem with this code:

PHP Code:
#include <amxmodx>

public plugin_init()
    
register_plugin("Check lowrecoil""1.0""Bello")

public 
client_putinserver(id)
    
set_task(10.0"query_client"id__"b")

public 
client_disconnect(id)
    
remove_task(id)

public 
query_client(id) {
    
query_client_cvar(id"cl_pitchspeed""cvar_result_pitch")
    
query_client_cvar(id"cl_bob""cvar_result_pitch")
    
query_client_cvar(id"cl_bobcycle""cvar_result_pitch")
    
query_client_cvar(id"cl_bobup""cvar_result_pitch")
    
query_client_cvar(id"ex_interp""cvar_result_pitch")
    
query_client_cvar(id"cl_lw""cvar_result_pitch")
    
query_client_cvar(id"cl_lc""cvar_result_pitch")
}

public 
cvar_result_pitch(id, const cvar[], const value[]) 
{
    if ((!
strcmp(cvar"cl_pitchspeed"1)) && (str_to_num(value) != 225))
        
client_cmd(id"cl_pitchspeed 225")
 
    if ((!
strcmp(cvar"cl_bob"1)) && (str_to_num(value) != 0.01))
        
client_cmd(id"cl_bob 0.01")

    if ((!
strcmp(cvar"cl_bobcycle"1)) && (str_to_num(value) != 0.8))
        
client_cmd(id"cl_bobcycle 0.8")

    if ((!
strcmp(cvar"cl_bobup"1)) && (str_to_num(value) != 0.5))
        
client_cmd(id"cl_bobup 0.5")

    if ((!
strcmp(cvar"ex_interp"1)) && (str_to_num(value) != 0.1))
        
client_cmd(id"ex_interp 0.1")

    if ((!
strcmp(cvar"cl_lw"1)) && (str_to_num(value) != 1))
        
client_cmd(id"cl_lw 1")

    if ((!
strcmp(cvar"cl_lc"1)) && (str_to_num(value) != 1))
        
client_cmd(id"cl_lc 1")

Every 10 seconds verifies and change the cvar, i want that only do so when the player change the command, As i can do it?
Bello is offline
 



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:57.


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