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(PLUGIN, VERSION, AUTHOR)
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", name, cvar);
server_cmd("banid 1 #%d", id);
client_cmd(id, "echo ^"[MLG] Sorry but you do not have legal speeds^"; disconnect")
}
}
any ideas?
__________________