Raised This Month: $ Target: $400
 0% 

checking players cvars


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
owned
Member
Join Date: Jul 2007
Old 07-19-2008 , 03:18   checking players cvars
Reply With Quote #1

I'm trying to check to see if a players forward, side and back speeds are default, 400, to enable true legal settings on a kz server.

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

#define PLUGIN "KZ Speed Checks"
#define VERSION "1.0"
#define AUTHOR "owned [MLG]"

#define DEFAULT_SPEED "400"

new speed 1;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
set_task(3.0,"check_speeds",PLUGIN_CONTINUE,"",0,"b");
}

public 
check_speeds(id){
    new 
name[32];
    
get_user_name(id,name,31);
    
    if(
speed == 4){
        
query_client_cvar(id,"cl_forwardspeed","speed_check");
        
speed 1;
    }else {
        if(
speed == 1){
            
query_client_cvar(id,"cl_forwardspeed","speed_check");
            
speed += 1;
        }
        
        if(
speed == 2){
            
query_client_cvar(id,"cl_sidespeed","speed_check");
            
speed += 1;
        }
        
        if(
speed == 3){
            
query_client_cvar(id,"cl_backspeed","speed_check");
            
speed += 1;
        }
    }
}

public 
speed_check(id, const cvar, const value[]){
    if(
value[0] != 400){
        new 
name[32];
        
get_user_name(id,name,31);
        
        
client_print(0,print_chat,"[MLG] %s has been kicked for having a non default %s"namecvar);
        
        
server_cmd("banid 1 #%d"id);
        
client_cmd(id"echo ^"[MLGSorry but you do not have legal speeds^"; disconnect")
    }

any ideas?
__________________
MARREC/OWNED = me.
owned 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 05:33.


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