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=129883)

Bello 06-17-2010 20:45

query_client_cvar
 
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?

fysiks 06-17-2010 21:32

Re: query_client_cvar
 
Hi flamin.

Bello 06-17-2010 21:46

Re: query_client_cvar
 
Quote:

Originally Posted by fysiks (Post 1212065)
Hi flamin.

offtopic?

drekes 06-18-2010 01:42

Re: query_client_cvar
 
Quote:

Originally Posted by fysiks (Post 1212065)
Hi flamin.

:shock: How do you know that?

fysiks 06-18-2010 19:31

Re: query_client_cvar
 
Quote:

Originally Posted by drekes (Post 1212206)
:shock: How do you know that?

:roll: behavior I guess. Mostly just a guess but his response seems to hint at the fact I was right.

drekes 06-18-2010 19:55

Re: query_client_cvar
 
Awesome, they should give you the banhammer to deal with this stuff.

Kreation 06-18-2010 20:17

Re: query_client_cvar
 
@fysiks: That was magical how you called that, I wouldn't of noticed. Saw your post, looked at the code and it looked like something that would be needed for a ESEA type thing that flamin was trying to accomplish. :D

fysiks 06-18-2010 20:52

Re: query_client_cvar
 
Actually, don't give me any credit. I had help. :)

Kreation 06-18-2010 21:13

Re: query_client_cvar
 
I heard. :P

YamiKaitou 06-18-2010 21:44

Re: query_client_cvar
 
Quote:

Originally Posted by fysiks (Post 1212958)
:roll: behavior I guess. Mostly just a guess but his response seems to hint at the fact I was right.

He is actually trying to fight his case with me (and my guess is multiple other Moderators (only 1 other has Ban powers)). I'm not buying it though, but I am enjoying him trying.


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

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