· 10 years ago · Sep 26, 2016, 08:12 PM
1#include <sourcemod>
2#include <sdktools>
3#include <sdkhooks>
4#undef REQUIRE_EXTENSIONS
5#include <clientprefs>
6#undef REQUIRE_PLUGIN
7
8#define VERSION "1.0"
9#define ADMIN_LEVEL ADMFLAG_ROOT
10#define DEBUG 0
11#define WHITE 0x01
12#define DARKRED 0x02
13#define PURPLE 0x03
14#define GREEN 0x04
15#define MOSSGREEN 0x05
16#define LIMEGREEN 0x06
17#define RED 0x07
18#define GRAY 0x08
19#define YELLOW 0x09
20#define DARKGREY 0x0A
21#define BLUE 0x0B
22#define DARKBLUE 0x0C
23#define LIGHTBLUE 0x0D
24#define PINK 0x0E
25#define LIGHTRED 0x0F
26#define QUOTE 0x22
27#define PERCENT 0x25
28#define CPLIMIT 50
29#define MYSQL 0
30#define SQLITE 1
31#define MAX_STRAFES 100
32
33new Handle:g_hDb = INVALID_HANDLE;
34new Handle:g_hdist_good_weird = INVALID_HANDLE;
35new Float:g_dist_good_weird;
36new Handle:g_hdist_pro_weird = INVALID_HANDLE;
37new Float:g_dist_pro_weird;
38new Handle:g_hdist_leet_weird = INVALID_HANDLE;
39new Float:g_dist_leet_weird;
40new Handle:g_hdist_good_dropbhop = INVALID_HANDLE;
41new Float:g_dist_good_dropbhop;
42new Handle:g_hdist_pro_dropbhop = INVALID_HANDLE;
43new Float:g_dist_pro_dropbhop;
44new Handle:g_hdist_leet_dropbhop = INVALID_HANDLE;
45new Float:g_dist_leet_dropbhop;
46new Handle:g_hdist_good_bhop = INVALID_HANDLE;
47new Float:g_dist_good_bhop;
48new Handle:g_hdist_pro_bhop = INVALID_HANDLE;
49new Float:g_dist_pro_bhop;
50new Handle:g_hdist_leet_bhop = INVALID_HANDLE;
51new Float:g_dist_leet_bhop;
52new Handle:g_hdist_good_multibhop = INVALID_HANDLE;
53new Float:g_dist_good_multibhop;
54new Handle:g_hdist_pro_multibhop = INVALID_HANDLE;
55new Float:g_dist_pro_multibhop;
56new Handle:g_hdist_leet_multibhop = INVALID_HANDLE;
57new Float:g_dist_leet_multibhop;
58new Handle:g_hdist_good_lj = INVALID_HANDLE;
59new Float:g_dist_good_lj;
60new Handle:g_hdist_pro_lj = INVALID_HANDLE;
61new Float:g_dist_pro_lj;
62new Handle:g_hdist_leet_lj = INVALID_HANDLE;
63new Float:g_dist_leet_lj;
64new bool:g_js_bPlayerJumped[MAXPLAYERS+1];
65new bool:g_js_bDropJump[MAXPLAYERS+1];
66new bool:g_js_bInvalidGround[MAXPLAYERS+1];
67new bool:g_js_bBhop[MAXPLAYERS+1];
68new bool:g_js_Strafing_AW[MAXPLAYERS+1];
69new bool:g_js_Strafing_SD[MAXPLAYERS+1];
70new bool:g_bColorChat[MAXPLAYERS+1];
71new bool:g_bLJBlock[MAXPLAYERS + 1];
72new bool:g_bLjStarDest[MAXPLAYERS + 1];
73new bool:g_bInfoPanel[MAXPLAYERS+1];
74new bool:g_bStrafeSync[MAXPLAYERS+1];
75new bool:g_bLastInvalidGround[MAXPLAYERS+1];
76new bool:g_bPrestrafeTooHigh[MAXPLAYERS+1];
77new bool:g_bEnableQuakeSounds[MAXPLAYERS+1];
78new bool:g_bLJBlockValidJumpoff[MAXPLAYERS + 1];
79new bool:g_js_bFuncMoveLinear[MAXPLAYERS+1];
80new bool:g_bLastButtonJump[MAXPLAYERS+1];
81new bool:g_bdetailView[MAXPLAYERS+1];
82new bool:g_bFirstTeamJoin[MAXPLAYERS+1];
83new g_Beam[2];
84new g_js_Personal_LjBlock_Record[MAXPLAYERS+1]=-1;
85new g_js_BhopRank[MAXPLAYERS+1];
86new g_js_MultiBhopRank[MAXPLAYERS+1];
87new g_js_LjRank[MAXPLAYERS+1];
88new g_js_LjBlockRank[MAXPLAYERS+1];
89new g_js_DropBhopRank[MAXPLAYERS+1];
90new g_js_WjRank[MAXPLAYERS+1];
91new g_js_Sync_Final[MAXPLAYERS+1];
92new g_js_GroundFrames[MAXPLAYERS+1];
93new g_js_StrafeCount[MAXPLAYERS+1];
94new g_js_Strafes_Final[MAXPLAYERS+1];
95new g_js_LeetJump_Count[MAXPLAYERS+1];
96new g_js_MultiBhop_Count[MAXPLAYERS+1];
97new g_js_Last_Ground_Frames[MAXPLAYERS+1];
98new g_LastButton[MAXPLAYERS + 1];
99new g_BlockDist[MAXPLAYERS + 1];
100new String:g_js_szLastJumpDistance[MAXPLAYERS+1][256];
101new Float:g_fLastSpeed[MAXPLAYERS+1];
102new Float:g_flastHeight[MAXPLAYERS +1];
103new Float:g_fBlockHeight[MAXPLAYERS + 1];
104new Float:g_fEdgeVector[MAXPLAYERS + 1][3];
105new Float:g_fEdgeDist[MAXPLAYERS + 1];
106new Float:g_fEdgePoint[MAXPLAYERS + 1][3];
107new Float:g_fOriginBlock[MAXPLAYERS + 1][2][3];
108new Float:g_fDestBlock[MAXPLAYERS + 1][2][3];
109new Float:g_fLastPosition[MAXPLAYERS + 1][3];
110new Float:g_fLastAngles[MAXPLAYERS + 1][3];
111new Float:g_fSpeed[MAXPLAYERS+1];
112new Float:g_fLastPositionOnGround[MAXPLAYERS+1][3];
113new Float:g_fAirTime[MAXPLAYERS+1];
114new Float:g_js_fJump_JumpOff_Pos[MAXPLAYERS+1][3];
115new Float:g_js_fJump_Landing_Pos[MAXPLAYERS+1][3];
116new Float:g_js_fJump_JumpOff_PosLastHeight[MAXPLAYERS+1];
117new Float:g_js_fJump_DistanceX[MAXPLAYERS+1];
118new Float:g_js_fJump_DistanceZ[MAXPLAYERS+1];
119new Float:g_js_fJump_Distance[MAXPLAYERS+1];
120new Float:g_js_fPreStrafe[MAXPLAYERS+1];
121new Float:g_js_fJumpOff_Time[MAXPLAYERS+1];
122new Float:g_js_fDropped_Units[MAXPLAYERS+1];
123new Float:g_js_fMax_Speed[MAXPLAYERS+1];
124new Float:g_js_fMax_Speed_Final[MAXPLAYERS +1];
125new Float:g_js_fMax_Height[MAXPLAYERS+1];
126new Float:g_js_fLast_Jump_Time[MAXPLAYERS+1];
127new Float:g_js_Good_Sync_Frames[MAXPLAYERS+1];
128new Float:g_js_Sync_Frames[MAXPLAYERS+1];
129new Float:g_js_Strafe_Good_Sync[MAXPLAYERS+1][MAX_STRAFES];
130new Float:g_js_Strafe_Frames[MAXPLAYERS+1][MAX_STRAFES];
131new Float:g_js_Strafe_Gained[MAXPLAYERS+1][MAX_STRAFES];
132new Float:g_js_Strafe_Max_Speed[MAXPLAYERS+1][MAX_STRAFES];
133new Float:g_js_Strafe_Lost[MAXPLAYERS+1][MAX_STRAFES];
134new Float:g_js_fPersonal_Wj_Record[MAXPLAYERS+1]=-1.0;
135new Float:g_js_fPersonal_DropBhop_Record[MAXPLAYERS+1]=-1.0;
136new Float:g_js_fPersonal_Bhop_Record[MAXPLAYERS+1]=-1.0;
137new Float:g_js_fPersonal_MultiBhop_Record[MAXPLAYERS+1]=-1.0;
138new Float:g_js_fPersonal_Lj_Record[MAXPLAYERS+1]=-1.0;
139new Float:g_js_fPersonal_LjBlockRecord_Dist[MAXPLAYERS+1]=-1.0;
140new const String:LEETJUMP_FULL_SOUND_PATH[] = "sound/quake/godlike.mp3";
141new const String:LEETJUMP_RELATIVE_SOUND_PATH[] = "*quake/godlike.mp3";
142new const String:LEETJUMP_RAMPAGE_FULL_SOUND_PATH[] = "sound/quake/rampage.mp3";
143new const String:LEETJUMP_RAMPAGE_RELATIVE_SOUND_PATH[] = "*quake/rampage.mp3";
144new const String:LEETJUMP_DOMINATING_FULL_SOUND_PATH[] = "sound/quake/dominating.mp3";
145new const String:LEETJUMP_DOMINATING_RELATIVE_SOUND_PATH[] = "*quake/dominating.mp3";
146new const String:PROJUMP_FULL_SOUND_PATH[] = "sound/quake/perfect.mp3";
147new const String:PROJUMP_RELATIVE_SOUND_PATH[] = "*quake/perfect.mp3";
148
149//TABLE JUMMPSTATS
150new String:sql_createPlayerjumpstats[] = "CREATE TABLE IF NOT EXISTS playerjumpstats (steamid VARCHAR(32), name VARCHAR(32), multibhoprecord FLOAT NOT NULL DEFAULT '-1.0', multibhoppre FLOAT NOT NULL DEFAULT '-1.0', multibhopmax FLOAT NOT NULL DEFAULT '-1.0', multibhopstrafes INT(12),multibhopcount INT(12),multibhopsync INT(12), multibhopheight FLOAT NOT NULL DEFAULT '-1.0', bhoprecord FLOAT NOT NULL DEFAULT '-1.0', bhoppre FLOAT NOT NULL DEFAULT '-1.0', bhopmax FLOAT NOT NULL DEFAULT '-1.0', bhopstrafes INT(12),bhopsync INT(12), bhopheight FLOAT NOT NULL DEFAULT '-1.0', ljrecord FLOAT NOT NULL DEFAULT '-1.0', ljpre FLOAT NOT NULL DEFAULT '-1.0', ljmax FLOAT NOT NULL DEFAULT '-1.0', ljstrafes INT(12),ljsync INT(12), ljheight FLOAT NOT NULL DEFAULT '-1.0', ljblockdist INT(12) NOT NULL DEFAULT '-1',ljblockrecord FLOAT NOT NULL DEFAULT '-1.0', ljblockpre FLOAT NOT NULL DEFAULT '-1.0', ljblockmax FLOAT NOT NULL DEFAULT '-1.0', ljblockstrafes INT(12),ljblocksync INT(12), ljblockheight FLOAT NOT NULL DEFAULT '-1.0', dropbhoprecord FLOAT NOT NULL DEFAULT '-1.0', dropbhoppre FLOAT NOT NULL DEFAULT '-1.0', dropbhopmax FLOAT NOT NULL DEFAULT '-1.0', dropbhopstrafes INT(12),dropbhopsync INT(12), dropbhopheight FLOAT NOT NULL DEFAULT '-1.0', wjrecord FLOAT NOT NULL DEFAULT '-1.0', wjpre FLOAT NOT NULL DEFAULT '-1.0', wjmax FLOAT NOT NULL DEFAULT '-1.0', wjstrafes INT(12),wjsync INT(12), wjheight FLOAT NOT NULL DEFAULT '-1.0', standupbhoprecord FLOAT NOT NULL DEFAULT '-1.0', standupbhoppre FLOAT NOT NULL DEFAULT '-1.0', standupbhopmax FLOAT NOT NULL DEFAULT '-1.0', standupbhopstrafes INT(12),standupbhopcount INT(12),standupbhopsync INT(12), standupbhopheight FLOAT NOT NULL DEFAULT '-1.0', dropstandupbhoprecord FLOAT NOT NULL DEFAULT '-1.0', dropstandupbhoppre FLOAT NOT NULL DEFAULT '-1.0', dropstandupbhopmax FLOAT NOT NULL DEFAULT '-1.0', dropstandupbhopstrafes INT(12), dropstandupbhopcount INT(12), dropstandupbhopsync INT(12), dropstandupbhopheight FLOAT NOT NULL DEFAULT '-1.0', ladderjumprecord FLOAT NOT NULL DEFAULT '-1.0', ladderjumppre FLOAT NOT NULL DEFAULT '-1.0', ladderjumpmax FLOAT NOT NULL DEFAULT '-1.0', ladderjumpstrafes INT(12), ladderjumpcount INT(12), ladderjumpsync INT(12), ladderjumpheight FLOAT NOT NULL DEFAULT '-1.0', ladderbhoprecord FLOAT NOT NULL DEFAULT '-1.0', ladderbhoppre FLOAT NOT NULL DEFAULT '-1.0', ladderbhopmax FLOAT NOT NULL DEFAULT '-1.0', ladderbhopstrafes INT(12), ladderbhopcount INT(12), ladderbhopsync INT(12), ladderbhopheight FLOAT NOT NULL DEFAULT '-1.0', PRIMARY KEY(steamid));";
151new String:sql_insertPlayerJumpBhop[] = "INSERT INTO playerjumpstats (steamid, name, bhoprecord, bhoppre, bhopmax, bhopstrafes, bhopsync, bhopheight) VALUES('%s', '%s', '%f', '%f', '%f', '%i', '%i', '%f');";
152new String:sql_insertPlayerJumpLj[] = "INSERT INTO playerjumpstats (steamid, name, ljrecord, ljpre, ljmax, ljstrafes, ljsync, ljheight) VALUES('%s', '%s', '%f', '%f', '%f', '%i', '%i', '%f');";
153new String:sql_insertPlayerJumpLjBlock[] = "INSERT INTO playerjumpstats (steamid, name, ljblockdist, ljblockrecord, ljblockpre, ljblockmax, ljblockstrafes, ljblocksync, ljblockheight) VALUES('%s', '%s', '%i', '%f', '%f', '%f', '%i', '%i', '%f');";
154new String:sql_insertPlayerJumpMultiBhop[] = "INSERT INTO playerjumpstats (steamid, name, multibhoprecord, multibhoppre, multibhopmax, multibhopstrafes, multibhopcount, multibhopsync, multibhopheight) VALUES('%s', '%s', '%f', '%f', '%f', '%i', '%i', '%i', '%f');";
155new String:sql_insertPlayerJumpDropBhop[] = "INSERT INTO playerjumpstats (steamid, name, dropbhoprecord, dropbhoppre, dropbhopmax, dropbhopstrafes, dropbhopsync, dropbhopheight) VALUES('%s', '%s', '%f', '%f', '%f', '%i', '%i', '%f');";
156new String:sql_insertPlayerJumpWJ[] = "INSERT INTO playerjumpstats (steamid, name, wjrecord, wjpre, wjmax, wjstrafes, wjsync, wjheight) VALUES('%s', '%s', '%f', '%f', '%f', '%i', '%i', '%f');";
157
158new String:sql_updateLjBlock[] = "UPDATE playerjumpstats SET name='%s', ljblockdist ='%i', ljblockrecord ='%f', ljblockpre ='%f', ljblockmax ='%f', ljblockstrafes='%i', ljblocksync='%i', ljblockheight='%f' WHERE steamid = '%s';";
159new String:sql_updateLj[] = "UPDATE playerjumpstats SET name='%s', ljrecord ='%f', ljpre ='%f', ljmax ='%f', ljstrafes='%i', ljsync='%i', ljheight='%f' WHERE steamid = '%s';";
160new String:sql_updateBhop[] = "UPDATE playerjumpstats SET name='%s', bhoprecord ='%f', bhoppre ='%f', bhopmax ='%f', bhopstrafes='%i', bhopsync='%i', bhopheight='%f' WHERE steamid = '%s';";
161new String:sql_updateMultiBhop[] = "UPDATE playerjumpstats SET name='%s', multibhoprecord ='%f', multibhoppre ='%f', multibhopmax ='%f', multibhopstrafes='%i', multibhopcount='%i', multibhopsync='%i', multibhopheight='%f' WHERE steamid = '%s';";
162new String:sql_updateDropBhop[] = "UPDATE playerjumpstats SET name='%s', dropbhoprecord ='%f', dropbhoppre ='%f', dropbhopmax ='%f', dropbhopstrafes='%i', dropbhopsync='%i', dropbhopheight='%f' WHERE steamid = '%s';";
163new String:sql_updateWJ[] = "UPDATE playerjumpstats SET name='%s', wjrecord ='%f', wjpre ='%f', wjmax ='%f', wjstrafes='%i', wjsync='%i', wjheight='%f' WHERE steamid = '%s';";
164
165new String:sql_selectPlayerJumpTopLJBlock[] = "SELECT name, ljblockdist, ljblockrecord, ljblockstrafes, steamid FROM playerjumpstats WHERE ljblockdist > -1 ORDER BY ljblockdist DESC, ljblockrecord DESC LIMIT 20";
166new String:sql_selectPlayerJumpTopLJ[] = "SELECT name, ljrecord, ljstrafes, steamid FROM playerjumpstats WHERE ljrecord > -1.0 ORDER BY ljrecord DESC LIMIT 20";
167new String:sql_selectPlayerJumpTopBhop[] = "SELECT name, bhoprecord, bhopstrafes, steamid FROM playerjumpstats WHERE bhoprecord > -1.0 ORDER BY bhoprecord DESC LIMIT 20";
168new String:sql_selectPlayerJumpTopMultiBhop[] = "SELECT name, multibhoprecord, multibhopstrafes, steamid FROM playerjumpstats WHERE multibhoprecord > -1.0 ORDER BY multibhoprecord DESC LIMIT 20";
169new String:sql_selectPlayerJumpTopDropBhop[] = "SELECT name, dropbhoprecord, dropbhopstrafes, steamid FROM playerjumpstats WHERE dropbhoprecord > -1.0 ORDER BY dropbhoprecord DESC LIMIT 20";
170new String:sql_selectPlayerJumpTopWJ[] = "SELECT name, wjrecord, wjstrafes, steamid FROM playerjumpstats WHERE wjrecord > -1.0 ORDER BY wjrecord DESC LIMIT 20";
171new String:sql_selectPlayerJumpLJBlock[] = "SELECT steamid, name, ljblockdist, ljblockrecord FROM playerjumpstats WHERE steamid = '%s';";
172new String:sql_selectPlayerJumpLJ[] = "SELECT steamid, name, ljrecord FROM playerjumpstats WHERE steamid = '%s';";
173new String:sql_selectPlayerJumpBhop[] = "SELECT steamid, name, bhoprecord FROM playerjumpstats WHERE steamid = '%s';";
174new String:sql_selectPlayerJumpMultiBhop[] = "SELECT steamid, name, multibhoprecord FROM playerjumpstats WHERE steamid = '%s';";
175new String:sql_selectPlayerJumpWJ[] = "SELECT steamid, name, wjrecord FROM playerjumpstats WHERE steamid = '%s';";
176new String:sql_selectPlayerJumpDropBhop[] = "SELECT steamid, name, dropbhoprecord FROM playerjumpstats WHERE steamid = '%s';";
177new String:sql_selectJumpStats[] = "SELECT steamid, name, bhoprecord,bhoppre,bhopmax,bhopstrafes,bhopsync, ljrecord, ljpre, ljmax, ljstrafes,ljsync, multibhoprecord,multibhoppre, multibhopmax, multibhopstrafes,multibhopcount,multibhopsync, wjrecord, wjpre, wjmax, wjstrafes, wjsync, dropbhoprecord, dropbhoppre, dropbhopmax, dropbhopstrafes, dropbhopsync, ljheight, bhopheight, multibhopheight, dropbhopheight, wjheight,ljblockdist,ljblockrecord, ljblockpre, ljblockmax, ljblockstrafes,ljblocksync, ljblockheight FROM playerjumpstats WHERE (wjrecord > -1.0 OR dropbhoprecord > -1.0 OR ljrecord > -1.0 OR bhoprecord > -1.0 OR multibhoprecord > -1.0) AND steamid = '%s';";
178new String:sql_selectPlayerRankMultiBhop[] = "SELECT name FROM playerjumpstats WHERE multibhoprecord >= (SELECT multibhoprecord FROM playerjumpstats WHERE steamid = '%s' AND multibhoprecord > -1.0) AND multibhoprecord > -1.0 ORDER BY multibhoprecord;";
179new String:sql_selectPlayerRankLj[] = "SELECT name FROM playerjumpstats WHERE ljrecord >= (SELECT ljrecord FROM playerjumpstats WHERE steamid = '%s' AND ljrecord > -1.0) AND ljrecord > -1.0 ORDER BY ljrecord;";
180new String:sql_selectPlayerRankLjBlock[] = "SELECT name FROM playerjumpstats WHERE ljblockdist >= (SELECT ljblockdist FROM playerjumpstats WHERE steamid = '%s' AND ljblockdist > -1.0) AND ljblockdist > -1.0 ORDER BY ljblockdist DESC, ljblockrecord DESC;";
181new String:sql_selectPlayerRankBhop[] = "SELECT name FROM playerjumpstats WHERE bhoprecord >= (SELECT bhoprecord FROM playerjumpstats WHERE steamid = '%s' AND bhoprecord > -1.0) AND bhoprecord > -1.0 ORDER BY bhoprecord;";
182new String:sql_selectPlayerRankWJ[] = "SELECT name FROM playerjumpstats WHERE wjrecord >= (SELECT wjrecord FROM playerjumpstats WHERE steamid = '%s' AND wjrecord > -1.0) AND wjrecord > -1.0 ORDER BY wjrecord;";
183new String:sql_selectPlayerRankDropBhop[] = "SELECT name FROM playerjumpstats WHERE dropbhoprecord >= (SELECT dropbhoprecord FROM playerjumpstats WHERE steamid = '%s' AND dropbhoprecord > -1.0) AND dropbhoprecord > -1.0 ORDER BY dropbhoprecord;";
184new String:sql_resetBhopRecord[] = "UPDATE playerjumpstats SET bhoprecord = '-1.0' WHERE steamid = '%s';";
185new String:sql_resetDropBhopRecord[] = "UPDATE playerjumpstats SET dropbhoprecord = '-1.0' WHERE steamid = '%s';";
186new String:sql_resetWJRecord[] = "UPDATE playerjumpstats SET wjrecord = '-1.0' WHERE steamid = '%s';";
187new String:sql_resetLjRecord[] = "UPDATE playerjumpstats SET ljrecord = '-1.0' WHERE steamid = '%s';";
188new String:sql_resetLjBlockRecord[] = "UPDATE playerjumpstats SET ljblockdist = '-1' WHERE steamid = '%s';";
189new String:sql_resetMultiBhopRecord[] = "UPDATE playerjumpstats SET multibhoprecord = '-1.0' WHERE steamid = '%s';";
190new String:sql_resetJumpStats[] = "UPDATE playerjumpstats SET multibhoprecord = '-1.0', ljrecord = '-1.0', wjrecord = '-1.0', dropbhoprecord = '-1.0', bhoprecord = '-1.0', ljblockdist = '-1' WHERE steamid = '%s';";
191
192
193public Plugin:myinfo =
194{
195 name = "KZ JumpStats",
196 author = "1NutWunDeR",
197 description = "",
198 version = VERSION,
199 url = ""
200};
201
202public OnPluginStart()
203{
204 //lanuage file
205 LoadTranslations("kzjumpstats.phrases");
206
207 //db setup
208 db_setupDatabase();
209
210 //ConVars
211 CreateConVar("KZJumpstats_version", VERSION, "KZ Jumpstats Version.", FCVAR_DONTRECORD|FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
212 g_hdist_good_lj = CreateConVar("js_dist_min_lj", "230.0", "Minimum distance for longjumps to be considered good [Client Message]", FCVAR_PLUGIN|FCVAR_NOTIFY, true, 200.0, true, 999.0);
213 g_hdist_pro_lj = CreateConVar("js_dist_pro_lj", "245.0", "Minimum distance for longjumps to be considered pro [JumpStats Colorchat All]", FCVAR_PLUGIN|FCVAR_NOTIFY, true, 220.0, true, 999.0);
214 g_hdist_leet_lj = CreateConVar("js_dist_leet_lj", "250.0", "Minimum distance for longjumps to be considered leet [JumpStats Colorchat All]", FCVAR_PLUGIN|FCVAR_NOTIFY, true, 245.0, true, 999.0);
215 g_hdist_good_weird = CreateConVar("js_dist_min_wj", "200.0", "Minimum distance for weird jumps to be considered good [Client Message]", FCVAR_PLUGIN|FCVAR_NOTIFY, true, 200.0, true, 999.0);
216 g_hdist_pro_weird = CreateConVar("js_dist_pro_wj", "260.0", "Minimum distance for weird jumps to be considered pro [JumpStats Colorchat All]", FCVAR_PLUGIN|FCVAR_NOTIFY, true, 200.0, true, 999.0);
217 g_hdist_leet_weird = CreateConVar("js_dist_leet_wj", "270.0", "Minimum distance for weird jumps to be considered leet [JumpStats Colorchat All]", FCVAR_PLUGIN|FCVAR_NOTIFY, true, 200.0, true, 999.0);
218 g_hdist_good_dropbhop = CreateConVar("js_dist_min_dropbhop", "230.0", "Minimum distance for drop bhops to be considered good [Client Message]", FCVAR_PLUGIN|FCVAR_NOTIFY, true, 200.0, true, 999.0);
219 g_hdist_pro_dropbhop = CreateConVar("js_dist_pro_dropbhop", "260.0", "Minimum distance for drop bhops to be considered pro [JumpStats Colorchat All]", FCVAR_PLUGIN|FCVAR_NOTIFY, true, 200.0, true, 999.0);
220 g_hdist_leet_dropbhop = CreateConVar("js_dist_leet_dropbhop", "270.0", "Minimum distance for drop bhops to be considered leet [JumpStats Colorchat All]", FCVAR_PLUGIN|FCVAR_NOTIFY, true, 200.0, true, 999.0);
221 g_hdist_good_bhop = CreateConVar("js_dist_min_bhop", "240.0", "Minimum distance for bhops to be considered good [Client Message]", FCVAR_PLUGIN|FCVAR_NOTIFY, true, 200.0, true, 999.0);
222 g_hdist_pro_bhop = CreateConVar("js_dist_pro_bhop", "260.0", "Minimum distance for bhops to be considered pro [JumpStats Colorchat All]", FCVAR_PLUGIN|FCVAR_NOTIFY, true, 200.0, true, 999.0);
223 g_hdist_leet_bhop = CreateConVar("js_dist_leet_bhop", "270.0", "Minimum distance for bhops to be considered leet [JumpStats Colorchat All]", FCVAR_PLUGIN|FCVAR_NOTIFY, true, 200.0, true, 999.0);
224 g_hdist_good_multibhop = CreateConVar("js_dist_min_multibhop", "240.0", "Minimum distance for multi-bhops to be considered good [Client Message]", FCVAR_PLUGIN|FCVAR_NOTIFY, true, 200.0, true, 9999.0);
225 g_hdist_pro_multibhop = CreateConVar("js_dist_pro_multibhop", "260.0", "Minimum distance for multi-bhops to be considered pro [JumpStats Colorchat All]", FCVAR_PLUGIN|FCVAR_NOTIFY, true, 200.0, true, 9999.0);
226 g_hdist_leet_multibhop = CreateConVar("js_dist_leet_multibhop", "270.0", "Minimum distance for multi-bhops to be considered leet [JumpStats Colorchat All]", FCVAR_PLUGIN|FCVAR_NOTIFY, true, 200.0, true, 9999.0);
227
228 g_dist_good_weird = GetConVarFloat(g_hdist_good_weird);
229 HookConVarChange(g_hdist_good_weird, OnSettingChanged);
230
231 g_dist_pro_weird = GetConVarFloat(g_hdist_pro_weird);
232 HookConVarChange(g_hdist_pro_weird, OnSettingChanged);
233
234 g_dist_leet_weird = GetConVarFloat(g_hdist_leet_weird);
235 HookConVarChange(g_hdist_leet_weird, OnSettingChanged);
236
237 g_dist_good_dropbhop = GetConVarFloat(g_hdist_good_dropbhop);
238 HookConVarChange(g_hdist_good_dropbhop, OnSettingChanged);
239
240 g_dist_pro_dropbhop = GetConVarFloat(g_hdist_pro_dropbhop);
241 HookConVarChange(g_hdist_pro_dropbhop, OnSettingChanged);
242
243 g_dist_leet_dropbhop = GetConVarFloat(g_hdist_leet_dropbhop);
244 HookConVarChange(g_hdist_leet_dropbhop, OnSettingChanged);
245
246 g_dist_good_bhop = GetConVarFloat(g_hdist_good_bhop);
247 HookConVarChange(g_hdist_good_bhop, OnSettingChanged);
248
249 g_dist_pro_bhop = GetConVarFloat(g_hdist_pro_bhop);
250 HookConVarChange(g_hdist_pro_bhop, OnSettingChanged);
251
252 g_dist_leet_bhop = GetConVarFloat(g_hdist_leet_bhop);
253 HookConVarChange(g_hdist_leet_bhop, OnSettingChanged);
254
255 g_dist_good_multibhop = GetConVarFloat(g_hdist_good_multibhop);
256 HookConVarChange(g_hdist_good_multibhop, OnSettingChanged);
257
258 g_dist_pro_multibhop = GetConVarFloat(g_hdist_pro_multibhop);
259 HookConVarChange(g_hdist_pro_multibhop, OnSettingChanged);
260
261 g_dist_leet_multibhop = GetConVarFloat(g_hdist_leet_multibhop);
262 HookConVarChange(g_hdist_leet_multibhop, OnSettingChanged);
263
264 g_dist_good_lj = GetConVarFloat(g_hdist_good_lj);
265 HookConVarChange(g_hdist_good_lj, OnSettingChanged);
266
267 g_dist_pro_lj = GetConVarFloat(g_hdist_pro_lj);
268 HookConVarChange(g_hdist_pro_lj, OnSettingChanged);
269
270 g_dist_leet_lj = GetConVarFloat(g_hdist_leet_lj);
271 HookConVarChange(g_hdist_leet_lj, OnSettingChanged);
272
273 //config
274 AutoExecConfig(true, "KZJumpStats");
275
276 //commands
277 RegConsoleCmd("sm_showkeys", Client_InfoPanel, "on/off speed/showkeys center panel");
278 RegConsoleCmd("sm_speed", Client_InfoPanel, "on/off speed/showkeys center panel");
279 RegConsoleCmd("sm_sync", Client_StrafeSync,"on/off strafe sync in chat");
280 RegConsoleCmd("sm_stats", Client_Stats,"on/off strafe sync in chat");
281 RegConsoleCmd("sm_sound", Client_QuakeSounds,"on/off quake sounds");
282 RegConsoleCmd("sm_ljblock", Client_Ljblock,"registers a lj block");
283 RegConsoleCmd("sm_colorchat", Client_Colorchat, "on/off jumpstats messages of others in chat");
284 RegConsoleCmd("sm_jumptop", Client_Top, "jump top");
285 RegAdminCmd("sm_resetjumpstats", Admin_DropPlayerJump, ADMIN_LEVEL, "[JS] Resets jump stats - requires z flag");
286 RegAdminCmd("sm_resetallljrecords", Admin_ResetAllLjRecords, ADMIN_LEVEL, "[JS] Resets all lj records - requires z flag");
287 RegAdminCmd("sm_resetallljblockrecords", Admin_ResetAllLjBlockRecords, ADMIN_LEVEL, "[JS] Resets all lj block records - requires z flag");
288 RegAdminCmd("sm_resetallwjrecords", Admin_ResetAllWjRecords, ADMIN_LEVEL, "[JS] Resets all wj records - requires z flag");
289 RegAdminCmd("sm_resetallbhoprecords", Admin_ResetAllBhopRecords, ADMIN_LEVEL, "[JS] Resets all bhop records - requires z flag");
290 RegAdminCmd("sm_resetalldropbhopecords", Admin_ResetAllDropBhopRecords, ADMIN_LEVEL, "[JS] Resets all drop bjop records - requires z flag");
291 RegAdminCmd("sm_resetallmultibhoprecords", Admin_ResetAllMultiBhopRecords, ADMIN_LEVEL, "[JS] Resets all multi bhop records - requires z flag");
292 RegAdminCmd("sm_resetljrecord", Admin_ResetLjRecords, ADMIN_LEVEL, "[JS] Resets lj record for given steamid - requires z flag");
293 RegAdminCmd("sm_resetljblockrecord", Admin_ResetLjBlockRecords, ADMIN_LEVEL, "[JS] Resets lj block record for given steamid - requires z flag");
294 RegAdminCmd("sm_resetbhoprecord", Admin_ResetBhopRecords, ADMIN_LEVEL, "[JS] Resets bhop record for given steamid - requires z flag");
295 RegAdminCmd("sm_resetdropbhoprecord", Admin_ResetDropBhopRecords, ADMIN_LEVEL, "[JS] Resets drop bhop record for given steamid - requires z flag");
296 RegAdminCmd("sm_resetwjrecord", Admin_ResetWjRecords, ADMIN_LEVEL, "[JS] Resets wj record for given steamid - requires z flag");
297 RegAdminCmd("sm_resetmultibhoprecord", Admin_ResetMultiBhopRecords, ADMIN_LEVEL, "[JS] Resets multi bhop record for given steamid - requires z flag");
298 RegAdminCmd("sm_resetplayerjumpstats", Admin_ResetPlayerJumpstats, ADMIN_LEVEL, "[JS] Resets jump stats for given steamid - requires z flag");
299
300 //Hooks
301 HookEvent("player_jump", Event_OnJump, EventHookMode_Pre);
302 HookEvent("player_spawn", Event_OnPlayerSpawn, EventHookMode_Post);
303
304 //plugin loaded?
305 for(new z=1;z<=MaxClients;z++)
306 OnClientPutInServer(z);
307}
308
309public OnMapStart()
310{
311 //timers
312 CreateTimer(0.1, Timer1, INVALID_HANDLE, TIMER_FLAG_NO_MAPCHANGE|TIMER_REPEAT);
313
314 InitPrecache();
315
316 new ent = -1;
317 SDKHook(0,SDKHook_Touch,Touch_Wall);
318 while((ent = FindEntityByClassname(ent,"func_breakable")) != -1)
319 SDKHook(ent,SDKHook_Touch,Touch_Wall);
320 ent = -1;
321 while((ent = FindEntityByClassname(ent,"func_illusionary")) != -1)
322 SDKHook(ent,SDKHook_Touch,Touch_Wall);
323 ent = -1;
324 while((ent = FindEntityByClassname(ent,"func_wall")) != -1)
325 SDKHook(ent,SDKHook_Touch,Touch_Wall);
326 ent = -1;
327 while((ent = FindEntityByClassname(ent, "trigger_push")) != -1)
328 SDKHook(ent,SDKHook_Touch,Push_Touch);
329
330}
331
332public OnMapEnd()
333{
334 new ent = -1;
335 SDKUnhook(0,SDKHook_Touch,Touch_Wall);
336 while((ent = FindEntityByClassname(ent,"func_breakable")) != -1)
337 SDKUnhook(ent,SDKHook_Touch,Touch_Wall);
338 ent = -1;
339 while((ent = FindEntityByClassname(ent,"func_illusionary")) != -1)
340 SDKUnhook(ent,SDKHook_Touch,Touch_Wall);
341 ent = -1;
342 while((ent = FindEntityByClassname(ent,"func_wall")) != -1)
343 SDKUnhook(ent,SDKHook_Touch,Touch_Wall);
344 ent = -1;
345 while((ent = FindEntityByClassname(ent, "trigger_push")) != -1)
346 SDKUnhook(ent,SDKHook_Touch,Push_Touch);
347}
348
349
350public OnClientPutInServer(client)
351{
352 if (!IsValidEntity(client) || IsFakeClient(client) || !IsClientInGame(client))
353 return;
354
355 SDKHook(client, SDKHook_StartTouch, Hook_OnTouch);
356
357 g_bdetailView[client] = false;
358 g_bFirstTeamJoin[client] = true;
359 g_js_bPlayerJumped[client] = false;
360 g_bPrestrafeTooHigh[client] = false;
361 g_js_bFuncMoveLinear[client] = false;
362 g_js_Last_Ground_Frames[client] = 11;
363 g_js_MultiBhop_Count[client] = 1;
364 g_js_GroundFrames[client] = 0;
365 g_js_fJump_JumpOff_PosLastHeight[client] = -1.012345;
366 g_js_Good_Sync_Frames[client] = 0.0;
367 g_js_Sync_Frames[client] = 0.0;
368 g_js_LeetJump_Count[client] = 0;
369 g_bEnableQuakeSounds[client]=true;
370 g_bColorChat[client]=true;
371 Format(g_js_szLastJumpDistance[client], 256, "<font color='#948d8d'>0.0 units</font>");
372
373 // set default values
374 for( new i = 0; i < MAX_STRAFES; i++ )
375 {
376 g_js_Strafe_Good_Sync[client][i] = 0.0;
377 g_js_Strafe_Frames[client][i] = 0.0;
378 }
379
380 decl String:szSteamId[32];
381 GetClientAuthString(client, szSteamId, 32);
382 db_viewPersonalBhopRecord(client, szSteamId);
383 db_viewPersonalMultiBhopRecord(client, szSteamId);
384 db_viewPersonalWeirdRecord(client, szSteamId);
385 db_viewPersonalDropBhopRecord(client, szSteamId);
386 db_viewPersonalLJBlockRecord(client, szSteamId);
387 db_viewPersonalLJRecord(client, szSteamId);
388}
389
390public Action:Event_OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
391{
392 new client = GetClientOfUserId(GetEventInt(event, "userid"));
393 if(client != 0 && g_bFirstTeamJoin[client])
394 {
395 CreateTimer(15.0, AdvertTimer, client,TIMER_FLAG_NO_MAPCHANGE);
396 g_bFirstTeamJoin[client] = false;
397 }
398}
399
400public Action:AdvertTimer(Handle:timer, any:client)
401{
402 if (IsValidClient(client) && !IsFakeClient(client))
403 PrintToChat(client, "This server is using %cKZTimer Jumpstats", GRAY);
404}
405
406public Hook_OnTouch(client, other)
407{
408 if (IsValidClient(client) && IsPlayerAlive(client))
409 {
410 new String:classname[32];
411 if (IsValidEdict(other))
412 GetEntityClassname(other, classname, 32);
413 if (StrEqual(classname,"func_movelinear"))
414 {
415 g_js_bFuncMoveLinear[client] = true;
416 return;
417 }
418 if (!(GetEntityFlags(client) & FL_ONGROUND) || other != 0)
419 ResetJump(client);
420 }
421}
422
423public db_setupDatabase()
424{
425 decl String:szError[255];
426 g_hDb = SQL_Connect("kzjumpstats", false, szError, 255);
427
428 if(g_hDb == INVALID_HANDLE)
429 {
430 SetFailState("[kzjumspstats] Unable to connect to database (%s)",szError);
431 return;
432 }
433
434 decl String:szIdent[8];
435 SQL_ReadDriver(g_hDb, szIdent, 8);
436
437 SQL_FastQuery(g_hDb,"SET NAMES 'utf8'");
438 db_createTables();
439}
440
441
442public db_createTables()
443{
444 SQL_LockDatabase(g_hDb);
445 SQL_FastQuery(g_hDb, sql_createPlayerjumpstats);
446 SQL_UnlockDatabase(g_hDb);
447}
448
449public InitPrecache()
450{
451 AddFileToDownloadsTable( LEETJUMP_FULL_SOUND_PATH );
452 FakePrecacheSound( LEETJUMP_RELATIVE_SOUND_PATH );
453 AddFileToDownloadsTable( LEETJUMP_DOMINATING_FULL_SOUND_PATH );
454 FakePrecacheSound( LEETJUMP_DOMINATING_RELATIVE_SOUND_PATH );
455 AddFileToDownloadsTable( LEETJUMP_RAMPAGE_FULL_SOUND_PATH );
456 FakePrecacheSound( LEETJUMP_RAMPAGE_RELATIVE_SOUND_PATH );
457 AddFileToDownloadsTable( PROJUMP_FULL_SOUND_PATH );
458 FakePrecacheSound( PROJUMP_RELATIVE_SOUND_PATH );
459 g_Beam[0] = PrecacheModel("materials/sprites/laser.vmt");
460 g_Beam[1] = PrecacheModel("materials/sprites/halo01.vmt");
461}
462
463stock bool:IsValidClient(client)
464{
465 if(client >= 1 && client <= MaxClients && IsValidEntity(client) && IsClientConnected(client) && IsClientInGame(client))
466 return true;
467 return false;
468}
469
470public Action:Push_Touch(ent,client)
471{
472 if(IsValidClient(client) && g_js_bPlayerJumped[client])
473 {
474 ResetJump(client);
475 }
476 return Plugin_Continue;
477}
478
479public Action:Touch_Wall(ent,client)
480{
481 if(IsValidClient(client))
482 {
483 if(!(GetEntityFlags(client)&FL_ONGROUND) && g_js_bPlayerJumped[client])
484 {
485 new Float:origin[3], Float:temp[3];
486 GetGroundOrigin(client, origin);
487 GetClientAbsOrigin(client, temp);
488 if(temp[2] - origin[2] <= 0.2)
489 {
490 ResetJump(client);
491 }
492 }
493 }
494 return Plugin_Continue;
495}
496
497public OnSettingChanged(Handle:convar, const String:oldValue[], const String:newValue[])
498{
499 if(convar == g_hdist_good_multibhop)
500 g_dist_good_multibhop = StringToFloat(newValue[0]);
501
502 if(convar == g_hdist_pro_multibhop)
503 g_dist_pro_multibhop = StringToFloat(newValue[0]);
504
505 if(convar == g_hdist_leet_multibhop)
506 g_dist_leet_multibhop = StringToFloat(newValue[0]);
507
508 if(convar == g_hdist_good_bhop)
509 g_dist_good_bhop = StringToFloat(newValue[0]);
510
511 if(convar == g_hdist_pro_bhop)
512 g_dist_pro_bhop = StringToFloat(newValue[0]);
513
514 if(convar == g_hdist_leet_bhop)
515 g_dist_leet_bhop = StringToFloat(newValue[0]);
516
517 if(convar == g_hdist_good_dropbhop)
518 g_dist_good_dropbhop = StringToFloat(newValue[0]);
519
520 if(convar == g_hdist_pro_dropbhop)
521 g_dist_pro_dropbhop = StringToFloat(newValue[0]);
522
523 if(convar == g_hdist_leet_dropbhop)
524 g_dist_leet_dropbhop = StringToFloat(newValue[0]);
525
526 if(convar == g_hdist_good_weird)
527 g_dist_good_weird = StringToFloat(newValue[0]);
528
529 if(convar == g_hdist_pro_weird)
530 g_dist_pro_weird = StringToFloat(newValue[0]);
531
532 if(convar == g_hdist_leet_weird)
533 g_dist_leet_weird = StringToFloat(newValue[0]);
534
535 if(convar == g_hdist_good_lj)
536 g_dist_good_lj = StringToFloat(newValue[0]);
537
538 if(convar == g_hdist_pro_lj)
539 g_dist_pro_lj = StringToFloat(newValue[0]);
540
541 if(convar == g_hdist_leet_lj)
542 g_dist_leet_lj = StringToFloat(newValue[0]);
543
544}
545
546public Action:Event_OnJump(Handle:Event, const String:Name[], bool:Broadcast)
547{
548 new client = GetClientOfUserId(GetEventInt(Event, "userid"));
549 g_fAirTime[client] = GetEngineTime()
550 new bool:touchwall = WallCheck(client);
551 if (!touchwall)
552 Prethink(client, Float:{0.0,0.0,0.0},0.0);
553}
554
555public Action:BhopCheck(Handle:timer, any:client)
556{
557 if (!g_js_bBhop[client])
558 g_js_LeetJump_Count[client] = 0;
559}
560
561public Float:GetSpeed(client)
562{
563 decl Float:fVelocity[3];
564 GetEntPropVector(client, Prop_Data, "m_vecVelocity", fVelocity);
565 new Float:speed = SquareRoot(Pow(fVelocity[0],2.0)+Pow(fVelocity[1],2.0));
566 return speed;
567}
568
569
570public Float:GetVelocity(client)
571{
572 decl Float:fVelocity[3];
573 GetEntPropVector(client, Prop_Data, "m_vecVelocity", fVelocity);
574 new Float:speed = SquareRoot(Pow(fVelocity[0],2.0)+Pow(fVelocity[1],2.0)+Pow(fVelocity[2],2.0));
575 return speed;
576}
577
578
579// OnPlayerRunCmd
580public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon, &subtype, &cmdnum, &tickcount, &seed, mouse[2])
581{
582 new Float: origin[3],Float:ang[3];
583 if (!IsValidClient(client))
584 return Plugin_Continue;
585
586 //some methods..
587 if(IsPlayerAlive(client))
588 {
589 GetClientAbsOrigin(client, origin);
590 GetClientEyeAngles(client, ang);
591 new Float:flSpeed = GetSpeed(client);
592
593 if (g_js_bPlayerJumped[client] == false && GetEntityFlags(client) & FL_ONGROUND && ((buttons & IN_MOVERIGHT) || (buttons & IN_MOVELEFT) || (buttons & IN_BACK) || (buttons & IN_FORWARD)))
594 g_js_GroundFrames[client]++;
595
596 //get player speed
597 g_fSpeed[client] = GetSpeed(client);
598
599 //jumpstats/timer
600 NoClipCheck(client);
601 WaterCheck(client);
602 GravityCheck(client);
603 BoosterCheck(client);
604 WjJumpPreCheck(client,buttons);
605 CalcJumpMaxSpeed(client, flSpeed);
606 CalcJumpHeight(client);
607 CalcJumpSync(client, flSpeed, ang[1], buttons);
608 CalcLastJumpHeight(client, buttons, origin);
609
610 //ljblock
611 if (g_js_bPlayerJumped[client] == false && GetEntityFlags(client) & FL_ONGROUND && ((buttons & IN_JUMP)))
612 {
613 decl Float:temp[3], Float: pos[3];
614 GetClientAbsOrigin(client,pos);
615 g_bLJBlockValidJumpoff[client]=false;
616 if(g_bLJBlock[client])
617 {
618 g_bLJBlockValidJumpoff[client]=true;
619 g_bLjStarDest[client]=false;
620 GetEdgeOrigin(client, origin, temp);
621 g_fEdgeDist[client] = GetVectorDistance(temp, origin);
622 if(!IsCoordInBlockPoint(pos,g_fOriginBlock[client],false))
623 if(IsCoordInBlockPoint(pos,g_fDestBlock[client],false))
624 {
625 g_bLjStarDest[client]=true;
626 }
627 else
628 g_bLJBlockValidJumpoff[client]=false;
629 }
630 }
631 if(g_bLJBlock[client])
632 {
633 TE_SendBlockPoint(client, g_fDestBlock[client][0], g_fDestBlock[client][1], g_Beam[0]);
634 TE_SendBlockPoint(client, g_fOriginBlock[client][0], g_fOriginBlock[client][1], g_Beam[0]);
635 }
636 }
637
638 // postthink jumpstats (landing)
639 if(GetEntityFlags(client) & FL_ONGROUND && !g_js_bInvalidGround[client] && !g_bLastInvalidGround[client] && g_js_bPlayerJumped[client] == true && weapon != -1 && IsValidEntity(weapon) && GetEntProp(client, Prop_Data, "m_nWaterLevel") < 1)
640 {
641 GetGroundOrigin(client, g_js_fJump_Landing_Pos[client]);
642 g_fAirTime[client] = GetEngineTime() - g_fAirTime[client];
643 Postthink(client);
644 }
645
646 //reset/save current values
647 if (GetEntityFlags(client) & FL_ONGROUND)
648 {
649 g_fLastPositionOnGround[client] = origin;
650 g_bLastInvalidGround[client] = g_js_bInvalidGround[client];
651 }
652
653 if (!(GetEntityFlags(client) & FL_ONGROUND) && g_js_bPlayerJumped[client] == false)
654 g_js_GroundFrames[client] = 0;
655
656 g_fLastAngles[client] = ang;
657 g_fLastSpeed[client] = g_fSpeed[client];
658 g_fLastPosition[client] = origin;
659 g_LastButton[client] = buttons;
660 return Plugin_Continue;
661}
662
663public CalcJumpMaxSpeed(client, Float: fspeed)
664{
665 if (g_js_bPlayerJumped[client])
666 if (g_fLastSpeed[client] <= fspeed)
667 g_js_fMax_Speed[client] = fspeed;
668}
669
670public CalcJumpHeight(client)
671{
672 if (g_js_bPlayerJumped[client])
673 {
674 new Float:height[3];
675 GetClientAbsOrigin(client, height);
676 if (height[2] > g_js_fMax_Height[client])
677 g_js_fMax_Height[client] = height[2];
678 g_flastHeight[client] = height[2];
679 }
680}
681
682public CalcLastJumpHeight(client, &buttons, Float: origin[3])
683{
684 if(GetEntityFlags(client) & FL_ONGROUND && g_js_bPlayerJumped[client] == false && g_js_GroundFrames[client] > 11)
685 {
686 decl Float:flPos[3];
687 GetClientAbsOrigin(client, flPos);
688 g_js_fJump_JumpOff_PosLastHeight[client] = flPos[2];
689 }
690 new Float:distance = GetVectorDistance(g_fLastPosition[client], origin);
691 if(distance > 25.0)
692 {
693 if(g_js_bPlayerJumped[client])
694 g_js_bPlayerJumped[client] = false;
695 }
696}
697
698public CalcJumpSync(client, Float: speed, Float: ang, &buttons)
699{
700 if (g_js_bPlayerJumped[client])
701 {
702 new bool: turning_right = false;
703 new bool: turning_left = false;
704
705 if( ang < g_fLastAngles[client][1])
706 turning_right = true;
707 else
708 if( ang > g_fLastAngles[client][1])
709 turning_left = true;
710
711 //strafestats
712 if(turning_left || turning_right)
713 {
714 if( !g_js_Strafing_AW[client] && ((buttons & IN_FORWARD) || (buttons & IN_MOVELEFT)) && !(buttons & IN_MOVERIGHT) && !(buttons & IN_BACK) )
715 {
716 g_js_Strafing_AW[client] = true;
717 g_js_Strafing_SD[client] = false;
718 g_js_StrafeCount[client]++;
719 g_js_Strafe_Good_Sync[client][g_js_StrafeCount[client]-1] = 0.0;
720 g_js_Strafe_Frames[client][g_js_StrafeCount[client]-1] = 0.0;
721 g_js_Strafe_Max_Speed[client][g_js_StrafeCount[client] - 1] = speed;
722 }
723 else if( !g_js_Strafing_SD[client] && ((buttons & IN_BACK) || (buttons & IN_MOVERIGHT)) && !(buttons & IN_MOVELEFT) && !(buttons & IN_FORWARD) )
724 {
725 g_js_Strafing_AW[client] = false;
726 g_js_Strafing_SD[client] = true;
727 g_js_StrafeCount[client]++;
728 g_js_Strafe_Good_Sync[client][g_js_StrafeCount[client]-1] = 0.0;
729 g_js_Strafe_Frames[client][g_js_StrafeCount[client]-1] = 0.0;
730 g_js_Strafe_Max_Speed[client][g_js_StrafeCount[client] - 1] = speed;
731 }
732 }
733 //sync
734 if( g_fLastSpeed[client] < speed )
735 {
736 g_js_Good_Sync_Frames[client]++;
737 if( 0 < g_js_StrafeCount[client] <= MAX_STRAFES )
738 {
739 g_js_Strafe_Good_Sync[client][g_js_StrafeCount[client] - 1]++;
740 g_js_Strafe_Gained[client][g_js_StrafeCount[client] - 1] += (speed - g_fLastSpeed[client]);
741 }
742 }
743 else
744 if( g_fLastSpeed[client] > speed )
745 {
746 if( 0 < g_js_StrafeCount[client] <= MAX_STRAFES )
747 g_js_Strafe_Lost[client][g_js_StrafeCount[client] - 1] += (g_fLastSpeed[client] - speed);
748 }
749
750 //strafe frames
751 if( 0 < g_js_StrafeCount[client] <= MAX_STRAFES )
752 {
753 g_js_Strafe_Frames[client][g_js_StrafeCount[client] - 1]++;
754 if( g_js_Strafe_Max_Speed[client][g_js_StrafeCount[client] - 1] < speed )
755 g_js_Strafe_Max_Speed[client][g_js_StrafeCount[client] - 1] = speed;
756 }
757 //total frames
758 g_js_Sync_Frames[client]++;
759 }
760}
761
762public WjJumpPreCheck(client, &buttons)
763{
764 if(GetEntityFlags(client) & FL_ONGROUND && g_js_bPlayerJumped[client] == false && g_js_GroundFrames[client] > 11)
765 {
766 if (buttons & IN_JUMP)
767 g_bLastButtonJump[client] = true;
768 else
769 g_bLastButtonJump[client] = false;
770 }
771}
772
773public BoosterCheck(client)
774{
775 new Float:flbaseVelocity[3];
776 GetEntPropVector(client, Prop_Data, "m_vecBaseVelocity", flbaseVelocity);
777 if (flbaseVelocity[0] != 0.0 || flbaseVelocity[1] != 0.0 || flbaseVelocity[2] != 0.0 && g_js_bPlayerJumped[client])
778 ResetJump(client);
779}
780
781public WaterCheck(client)
782{
783 if (GetEntProp(client, Prop_Data, "m_nWaterLevel") > 0 && g_js_bPlayerJumped[client])
784 ResetJump(client);
785}
786
787public SurfCheck(client)
788{
789 if (g_js_bPlayerJumped[client] && WallCheck(client))
790 {
791 ResetJump(client);
792 }
793}
794
795public NoClipCheck(client)
796{
797 new MoveType:mt = GetEntityMoveType(client);
798 if(mt == MOVETYPE_NOCLIP && (g_js_bPlayerJumped[client]))
799 {
800 if (g_js_bPlayerJumped[client])
801 ResetJump(client);
802 }
803}
804
805public ResetJump(client)
806{
807 Format(g_js_szLastJumpDistance[client], 256, "<font color='#948d8d'>invalid</font>", g_js_fJump_Distance[client]);
808 g_js_GroundFrames[client] = 0;
809 g_js_bPlayerJumped[client] = false;
810}
811
812public bool:WallCheck(client)
813{
814 decl Float:pos[3];
815 decl Float:endpos[3];
816 decl Float:angs[3];
817 decl Float:vecs[3];
818 GetClientEyePosition(client, pos);
819 GetClientEyeAngles(client, angs);
820 GetAngleVectors(angs, vecs, NULL_VECTOR, NULL_VECTOR);
821 angs[1] = -180.0;
822 while (angs[1] != 180.0)
823 {
824 new Handle:trace = TR_TraceRayFilterEx(pos, angs, MASK_SHOT, RayType_Infinite, TraceEntityFilterPlayer);
825
826 if(TR_DidHit(trace))
827 {
828 TR_GetEndPosition(endpos, trace);
829 new Float: fdist = GetVectorDistance(endpos, pos, false);
830 if (fdist <= 25.0)
831 {
832 CloseHandle(trace);
833 return true;
834 }
835 }
836 CloseHandle(trace);
837 angs[1]+=15.0;
838 }
839 return false;
840}
841
842public bool:TraceFilterPlayers(entity,contentsMask)
843{
844 return (entity > MaxClients) ? true : false;
845}
846
847stock GetGroundOrigin(client, Float:pos[3])
848{
849 new Float:fOrigin[3], Float:result[3];
850 GetClientAbsOrigin(client, fOrigin);
851 TraceClientGroundOrigin(client, result, 100.0);
852 pos = fOrigin;
853 pos[2] = result[2];
854}
855
856stock TraceClientGroundOrigin(client, Float:result[3], Float:offset)
857{
858 new Float:temp[2][3];
859 GetClientEyePosition(client, temp[0]);
860 temp[1] = temp[0];
861 temp[1][2] -= offset;
862 new Float:mins[]={-16.0, -16.0, 0.0};
863 new Float:maxs[]={16.0, 16.0, 60.0};
864 new Handle:trace = TR_TraceHullFilterEx(temp[0], temp[1], mins, maxs, MASK_SHOT, TraceEntityFilterPlayer);
865 if(TR_DidHit(trace))
866 {
867 TR_GetEndPosition(result, trace);
868 CloseHandle(trace);
869 return 1;
870 }
871 CloseHandle(trace);
872 return 0;
873}
874
875public bool:TraceEntityFilterPlayer(entity, contentsMask)
876{
877 return entity > MaxClients;
878}
879
880public GravityCheck(client)
881{
882 new Float:flGravity = GetEntityGravity(client);
883 if ((flGravity != 0.0 && flGravity !=1.0) && g_js_bPlayerJumped[client])
884 ResetJump(client);
885}
886
887
888public CenterHudAlive(client)
889{
890 if (!IsValidClient(client))
891 return;
892
893 if (g_bInfoPanel[client])
894 {
895 decl String:sResult[256];
896 new Buttons;
897 Buttons = g_LastButton[client];
898 if (Buttons & IN_MOVELEFT)
899 Format(sResult, sizeof(sResult), "<b>Keys</b>: A");
900 else
901 Format(sResult, sizeof(sResult), "<b>Keys</b>: _");
902 if (Buttons & IN_FORWARD)
903 Format(sResult, sizeof(sResult), "%s W", sResult);
904 else
905 Format(sResult, sizeof(sResult), "%s _", sResult);
906 if (Buttons & IN_BACK)
907 Format(sResult, sizeof(sResult), "%s S", sResult);
908 else
909 Format(sResult, sizeof(sResult), "%s _", sResult);
910 if (Buttons & IN_MOVERIGHT)
911 Format(sResult, sizeof(sResult), "%s D", sResult);
912 else
913 Format(sResult, sizeof(sResult), "%s _", sResult);
914 if (Buttons & IN_DUCK)
915 Format(sResult, sizeof(sResult), "%s - DUCK", sResult);
916 else
917 Format(sResult, sizeof(sResult), "%s - _", sResult);
918 if (Buttons & IN_JUMP)
919 Format(sResult, sizeof(sResult), "%s JUMP", sResult);
920 else
921 Format(sResult, sizeof(sResult), "%s _", sResult);
922
923 if (IsValidEntity(client) && 1 <= client <= MaxClients)
924 PrintHintText(client,"<font color='#948d8d'><b>Last Jump</b>: %s\n<b>Speed</b>: %.1f u/s (%.0f)\n%s</font>",g_js_szLastJumpDistance[client],g_fSpeed[client],g_js_fPreStrafe[client],sResult);
925 }
926}
927
928public Action:Timer1(Handle:timer)
929{
930 for (new client = 1; client <= MaxClients; client++)
931 {
932 if (IsValidClient(client) && IsPlayerAlive(client))
933 {
934 CenterHudAlive(client)
935 SurfCheck(client);
936 }
937 }
938 return Plugin_Continue;
939}
940
941// thx to V952 https://forums.alliedmods.net/showthread.php?t=212886
942stock TraceClientViewEntity(client)
943{
944 new Float:m_vecOrigin[3];
945 new Float:m_angRotation[3];
946 GetClientEyePosition(client, m_vecOrigin);
947 GetClientEyeAngles(client, m_angRotation);
948 new Handle:tr = TR_TraceRayFilterEx(m_vecOrigin, m_angRotation, MASK_VISIBLE, RayType_Infinite, TRDontHitSelf, client);
949 new pEntity = -1;
950 if (TR_DidHit(tr))
951 {
952 pEntity = TR_GetEntityIndex(tr);
953 CloseHandle(tr);
954 return pEntity;
955 }
956 CloseHandle(tr);
957 return -1;
958}
959
960// thx to V952 https://forums.alliedmods.net/showthread.php?t=212886
961public bool:TRDontHitSelf(entity, mask, any:data)
962{
963 if (entity == data)
964 return false;
965 return true;
966}
967
968// Credits: LJStats by justshoot, Zipcore
969public Function_BlockJump(client)
970{
971 decl Float:pos[3], Float:origin[3];
972 GetAimOrigin(client, pos);
973 TraceClientGroundOrigin(client, origin, 100.0);
974 new bool:funclinear;
975 //get aim target
976 new String:classname[32];
977 new target = TraceClientViewEntity(client);
978 if (IsValidEdict(target))
979 GetEntityClassname(target, classname, 32);
980 if (StrEqual(classname,"func_movelinear"))
981 funclinear=true;
982
983 if((FloatAbs(pos[2] - origin[2]) <= 0.002) || (funclinear && FloatAbs(pos[2] - origin[2]) <= 0.6))
984 {
985 GetBoxFromPoint(origin, g_fOriginBlock[client]);
986 GetBoxFromPoint(pos, g_fDestBlock[client]);
987 CalculateBlockGap(client, origin, pos);
988 g_fBlockHeight[client] = pos[2];
989 }
990 else
991 {
992 g_bLJBlock[client] = false;
993 PrintToChat(client, "%t", "LJblock1",MOSSGREEN,WHITE,RED);
994 }
995}
996
997// Credits: LJStats by justshoot, Zipcore
998stock TE_SendBlockPoint(client, const Float:pos1[3], const Float:pos2[3], model)
999{
1000 new Float:buffer[4][3];
1001 buffer[2] = pos1;
1002 buffer[3] = pos2;
1003 buffer[0] = buffer[2];
1004 buffer[0][1] = buffer[3][1];
1005 buffer[1] = buffer[3];
1006 buffer[1][1] = buffer[2][1];
1007 decl randco[4];
1008 randco[0] = GetRandomInt(0, 255);
1009 randco[1] = GetRandomInt(0, 255);
1010 randco[2] = GetRandomInt(0, 255);
1011 randco[3] = GetRandomInt(125, 255);
1012 TE_SetupBeamPoints(buffer[3], buffer[0], model, 0, 0, 0, 0.13, 2.0, 2.0, 10, 0.0, randco, 0);
1013 TE_SendToClient(client);
1014 TE_SetupBeamPoints(buffer[0], buffer[2], model, 0, 0, 0, 0.13, 2.0, 2.0, 10, 0.0, randco, 0);
1015 TE_SendToClient(client);
1016 TE_SetupBeamPoints(buffer[2], buffer[1], model, 0, 0, 0, 0.13, 2.0, 2.0, 10, 0.0, randco, 0);
1017 TE_SendToClient(client);
1018 TE_SetupBeamPoints(buffer[1], buffer[3], model, 0, 0, 0, 0.13, 2.0, 2.0, 10, 0.0, randco, 0);
1019 TE_SendToClient(client);
1020}
1021
1022// Credits: LJStats by justshoot, Zipcore
1023GetEdgeOrigin(client, Float:ground[3], Float:result[3])
1024{
1025 result[0] = FloatDiv(g_fEdgeVector[client][0]*ground[0] + g_fEdgeVector[client][1]*g_fEdgePoint[client][0], g_fEdgeVector[client][0]+g_fEdgeVector[client][1]);
1026 result[1] = FloatDiv(g_fEdgeVector[client][1]*ground[1] - g_fEdgeVector[client][0]*g_fEdgePoint[client][1], g_fEdgeVector[client][1]-g_fEdgeVector[client][0]);
1027 result[2] = ground[2];
1028}
1029
1030// Credits: LJStats by justshoot, Zipcore
1031stock TraceWallOrigin(Float:fOrigin[3], Float:vAngles[3], Float:result[3])
1032{
1033 new Handle:trace = TR_TraceRayFilterEx(fOrigin, vAngles, MASK_SHOT, RayType_Infinite, TraceEntityFilterPlayer);
1034 if(TR_DidHit(trace))
1035 {
1036 TR_GetEndPosition(result, trace);
1037 CloseHandle(trace);
1038 return 1;
1039 }
1040 CloseHandle(trace);
1041 return 0;
1042}
1043
1044// Credits: LJStats by justshoot, Zipcore
1045stock TraceGroundOrigin(Float:fOrigin[3], Float:result[3])
1046{
1047 new Float:vAngles[3] = {90.0, 0.0, 0.0};
1048 new Handle:trace = TR_TraceRayFilterEx(fOrigin, vAngles, MASK_SHOT, RayType_Infinite, TraceEntityFilterPlayer);
1049 if(TR_DidHit(trace))
1050 {
1051 TR_GetEndPosition(result, trace);
1052 CloseHandle(trace);
1053 return 1;
1054 }
1055 CloseHandle(trace);
1056 return 0;
1057}
1058
1059// Credits: LJStats by justshoot, Zipcore
1060stock GetBeamEndOrigin(Float:fOrigin[3], Float:vAngles[3], Float:distance, Float:result[3])
1061{
1062 decl Float:AngleVector[3];
1063 GetAngleVectors(vAngles, AngleVector, NULL_VECTOR, NULL_VECTOR);
1064 NormalizeVector(AngleVector, AngleVector);
1065 ScaleVector(AngleVector, distance);
1066 AddVectors(fOrigin, AngleVector, result);
1067}
1068
1069// Credits: LJStats by justshoot, Zipcore
1070stock GetBeamHitOrigin(Float:fOrigin[3], Float:vAngles[3], Float:result[3])
1071{
1072 new Handle:trace = TR_TraceRayFilterEx(fOrigin, vAngles, MASK_SHOT, RayType_Infinite, TraceEntityFilterPlayer);
1073 if(TR_DidHit(trace))
1074 {
1075 TR_GetEndPosition(result, trace);
1076 CloseHandle(trace);
1077 }
1078}
1079
1080// Credits: LJStats by justshoot, Zipcore
1081stock GetAimOrigin(client, Float:hOrigin[3])
1082{
1083 new Float:vAngles[3], Float:fOrigin[3];
1084 GetClientEyePosition(client,fOrigin);
1085 GetClientEyeAngles(client, vAngles);
1086
1087 new Handle:trace = TR_TraceRayFilterEx(fOrigin, vAngles, MASK_SHOT, RayType_Infinite, TraceEntityFilterPlayer);
1088
1089 if(TR_DidHit(trace))
1090 {
1091 TR_GetEndPosition(hOrigin, trace);
1092 CloseHandle(trace);
1093 return 1;
1094 }
1095
1096 CloseHandle(trace);
1097 return 0;
1098}
1099
1100// Credits: LJStats by justshoot, Zipcore
1101stock GetBoxFromPoint(Float:origin[3], Float:result[2][3])
1102{
1103 decl Float:temp[3];
1104 temp = origin;
1105 temp[2] += 1.0;
1106 new Float:ang[4][3];
1107 ang[1][1] = 90.0;
1108 ang[2][1] = 180.0;
1109 ang[3][1] = -90.0;
1110 new bool:edgefound[4];
1111 new Float:dist[4];
1112 decl Float:tempdist[4], Float:position[3], Float:ground[3], Float:Last[4], Float:Edge[4][3];
1113 for(new i = 0; i < 4; i++)
1114 {
1115 TraceWallOrigin(temp, ang[i], Edge[i]);
1116 tempdist[i] = GetVectorDistance(temp, Edge[i]);
1117 Last[i] = origin[2];
1118 while(dist[i] < tempdist[i])
1119 {
1120 if(edgefound[i])
1121 break;
1122 GetBeamEndOrigin(temp, ang[i], dist[i], position);
1123 TraceGroundOrigin(position, ground);
1124 if((Last[i] != ground[2])&&(Last[i] > ground[2]))
1125 {
1126 Edge[i] = ground;
1127 edgefound[i] = true;
1128 }
1129 Last[i] = ground[2];
1130 dist[i] += 10.0;
1131 }
1132 if(!edgefound[i])
1133 {
1134 TraceGroundOrigin(Edge[i], Edge[i]);
1135 edgefound[i] = true;
1136 }
1137 else
1138 {
1139 ground = Edge[i];
1140 ground[2] = origin[2];
1141 MakeVectorFromPoints(ground, origin, position);
1142 GetVectorAngles(position, ang[i]);
1143 ground[2] -= 1.0;
1144 GetBeamHitOrigin(ground, ang[i], Edge[i]);
1145 }
1146 Edge[i][2] = origin[2];
1147 }
1148 if(edgefound[0]&&edgefound[1]&&edgefound[2]&&edgefound[3])
1149 {
1150 result[0][2] = origin[2];
1151 result[1][2] = origin[2];
1152 result[0][0] = Edge[0][0];
1153 result[0][1] = Edge[1][1];
1154 result[1][0] = Edge[2][0];
1155 result[1][1] = Edge[3][1];
1156 }
1157}
1158
1159// Credits: LJStats by justshoot, Zipcore
1160CalculateBlockGap(client, Float:origin[3], Float:target[3])
1161{
1162 new Float:distance = GetVectorDistance(origin, target);
1163 new Float:rad = DegToRad(15.0);
1164 new Float:newdistance = FloatDiv(distance, Cosine(rad));
1165 decl Float:eye[3], Float:eyeangle[2][3];
1166 new Float:temp = 0.0;
1167 GetClientEyePosition(client, eye);
1168 GetClientEyeAngles(client, eyeangle[0]);
1169 eyeangle[0][0] = 0.0;
1170 eyeangle[1] = eyeangle[0];
1171 eyeangle[0][1] += 10.0;
1172 eyeangle[1][1] -= 10.0;
1173 decl Float:position[3], Float:ground[3], Float:Last[2], Float:Edge[2][3];
1174 new bool:edgefound[2];
1175 while(temp < newdistance)
1176 {
1177 temp += 10.0;
1178 for(new i = 0; i < 2 ; i++)
1179 {
1180 if(edgefound[i])
1181 continue;
1182 GetBeamEndOrigin(eye, eyeangle[i], temp, position);
1183 TraceGroundOrigin(position, ground);
1184 if(temp == 10.0)
1185 {
1186 Last[i] = ground[2];
1187 }
1188 else
1189 {
1190 if((Last[i] != ground[2])&&(Last[i] > ground[2]))
1191 {
1192 Edge[i] = ground;
1193 edgefound[i] = true;
1194 }
1195 Last[i] = ground[2];
1196 }
1197 }
1198 }
1199 decl Float:temp2[2][3];
1200 if(edgefound[0] && edgefound[1])
1201 {
1202 for(new i = 0; i < 2 ; i++)
1203 {
1204 temp2[i] = Edge[i];
1205 temp2[i][2] = origin[2] - 1.0;
1206 if(eyeangle[i][1] > 0)
1207 {
1208 eyeangle[i][1] -= 180.0;
1209 }
1210 else
1211 {
1212 eyeangle[i][1] += 180.0;
1213 }
1214 GetBeamHitOrigin(temp2[i], eyeangle[i], Edge[i]);
1215 }
1216 }
1217 else
1218 {
1219 g_bLJBlock[client] = false;
1220 PrintToChat(client, "%t", "LJblock2",MOSSGREEN,WHITE,RED);
1221 return;
1222 }
1223
1224
1225
1226 g_fEdgePoint[client] = Edge[0];
1227 MakeVectorFromPoints(Edge[0], Edge[1], position);
1228 g_fEdgeVector[client] = position;
1229 NormalizeVector(g_fEdgeVector[client], g_fEdgeVector[client]);
1230 CorrectEdgePoint(client);
1231 GetVectorAngles(position, position);
1232 position[1] += 90.0;
1233 GetBeamHitOrigin(Edge[0], position, Edge[1]);
1234 distance = GetVectorDistance(Edge[0], Edge[1]);
1235 g_BlockDist[client] = RoundToNearest(distance);
1236
1237
1238 new Float:surface = GetVectorDistance(g_fDestBlock[client][0],g_fDestBlock[client][1]);
1239 surface *= surface;
1240 if (surface > 1000000)
1241 {
1242 PrintToChat(client, "%t", "LJblock3",MOSSGREEN,WHITE,RED);
1243 return;
1244 }
1245
1246
1247 if(!IsCoordInBlockPoint(Edge[1],g_fDestBlock[client],true))
1248 {
1249 g_bLJBlock[client] = false;
1250 PrintToChat(client, "%t", "LJblock4",MOSSGREEN,WHITE,RED);
1251 return;
1252 }
1253 TE_SetupBeamPoints(Edge[0], Edge[1], g_Beam[0], 0, 0, 0, 1.0, 1.0, 1.0, 10, 0.0, {0,255,255,155}, 0);
1254 TE_SendToClient(client);
1255
1256 if(g_BlockDist[client] > 225 && g_BlockDist[client] <= 300)
1257 {
1258 PrintToChat(client, "%t", "LJblock5", MOSSGREEN,WHITE, LIMEGREEN,GREEN, g_BlockDist[client],LIMEGREEN);
1259 g_bLJBlock[client] = true;
1260 }
1261 else
1262 {
1263 if (g_BlockDist[client] < 225)
1264 PrintToChat(client, "%t", "LJblock6", MOSSGREEN,WHITE, RED,DARKRED,g_BlockDist[client],RED);
1265 else
1266 if (g_BlockDist[client] > 300)
1267 PrintToChat(client, "%t", "LJblock7", MOSSGREEN,WHITE, RED,DARKRED,g_BlockDist[client],RED);
1268 }
1269}
1270
1271// Credits: LJStats by justshoot, Zipcore
1272stock bool:IsCoordInBlockPoint(const Float:origin[3], const Float:pos[2][3], bool:ignorez)
1273{
1274 new bool:bX, bool:bY, bool:bZ;
1275 decl Float:temp[2][3];
1276 temp[0] = pos[0];
1277 temp[1] = pos[1];
1278 temp[0][0] += 16.0;
1279 temp[0][1] += 16.0;
1280 temp[1][0] -= 16.0;
1281 temp[1][1] -= 16.0;
1282 if (ignorez)
1283 bZ=true;
1284
1285 if(temp[0][0] > temp[1][0])
1286 {
1287 if(temp[0][0] >= origin[0] >= temp[1][0])
1288 {
1289 bX = true;
1290 }
1291 }
1292 else
1293 {
1294 if(temp[1][0] >= origin[0] >= temp[0][0])
1295 {
1296 bX = true;
1297 }
1298 }
1299 if(temp[0][1] > temp[1][1])
1300 {
1301 if(temp[0][1] >= origin[1] >= temp[1][1])
1302 {
1303 bY = true;
1304 }
1305 }
1306 else
1307 {
1308 if(temp[1][1] >= origin[1] >= temp[0][1])
1309 {
1310 bY = true;
1311 }
1312 }
1313 if(temp[0][2] + 0.002 >= origin[2] >= temp[0][2])
1314 {
1315 bZ = true;
1316 }
1317
1318 if(bX&&bY&&bZ)
1319 {
1320 return true;
1321 }
1322 else
1323 {
1324 return false;
1325 }
1326}
1327
1328// Credits: LJStats by justshoot, Zipcore
1329CorrectEdgePoint(client)
1330{
1331 decl Float:vec[3];
1332 vec[0] = 0.0 - g_fEdgeVector[client][1];
1333 vec[1] = g_fEdgeVector[client][0];
1334 vec[2] = 0.0;
1335 ScaleVector(vec, 16.0);
1336 AddVectors(g_fEdgePoint[client], vec, g_fEdgePoint[client]);
1337}
1338
1339public Prethink (client, Float:pos[3], Float:vel)
1340{
1341 //booster or moving plattform?
1342 new Float:flVelocity[3];
1343 GetEntPropVector(client, Prop_Data, "m_vecBaseVelocity", flVelocity);
1344 if (flVelocity[0] != 0.0 || flVelocity[1] != 0.0 || flVelocity[2] != 0.0)
1345 g_js_bInvalidGround[client] = true;
1346 else
1347 g_js_bInvalidGround[client] = false;
1348
1349 //reset vars
1350 g_js_Good_Sync_Frames[client] = 0.0;
1351 g_js_Sync_Frames[client] = 0.0;
1352 for( new i = 0; i < MAX_STRAFES; i++ )
1353 {
1354 g_js_Strafe_Good_Sync[client][i] = 0.0;
1355 g_js_Strafe_Frames[client][i] = 0.0;
1356 g_js_Strafe_Gained[client][i] = 0.0;
1357 g_js_Strafe_Lost[client][i] = 0.0;
1358 g_js_Strafe_Max_Speed[client][i] = 0.0;
1359 }
1360
1361 g_js_fJumpOff_Time[client] = GetEngineTime();
1362 g_js_fMax_Speed[client] = 0.0;
1363 g_js_StrafeCount[client] = 0;
1364 g_js_bDropJump[client] = false;
1365 g_js_bPlayerJumped[client] = true;
1366 g_js_Strafing_AW[client] = false;
1367 g_js_Strafing_SD[client] = false;
1368 g_js_bFuncMoveLinear[client] = false;
1369 g_js_fMax_Height[client] = -99999.0;
1370 g_js_fLast_Jump_Time[client] = GetEngineTime();
1371
1372 decl Float:fVelocity[3];
1373 GetEntPropVector(client, Prop_Data, "m_vecVelocity", fVelocity);
1374 g_js_fPreStrafe[client] = SquareRoot(Pow(fVelocity[0], 2.0) + Pow(fVelocity[1], 2.0) + Pow(fVelocity[2], 2.0));
1375 GetGroundOrigin(client, g_js_fJump_JumpOff_Pos[client]);
1376 if (g_js_fJump_JumpOff_PosLastHeight[client] != -1.012345)
1377 {
1378 new Float: fGroundDiff = g_js_fJump_JumpOff_Pos[client][2] - g_js_fJump_JumpOff_PosLastHeight[client];
1379 if (fGroundDiff > -0.1 && fGroundDiff < 0.1)
1380 fGroundDiff = 0.0;
1381 if(fGroundDiff <= -1.5)
1382 {
1383 g_js_bDropJump[client] = true;
1384 g_js_fDropped_Units[client] = FloatAbs(fGroundDiff);
1385 }
1386 }
1387
1388 if (g_js_GroundFrames[client]<11)
1389 g_js_bBhop[client] = true;
1390 else
1391 g_js_bBhop[client] = false;
1392
1393
1394 //last InitialLastHeight
1395 g_js_fJump_JumpOff_PosLastHeight[client] = g_js_fJump_JumpOff_Pos[client][2];
1396}
1397
1398public Postthink(client)
1399{
1400 if (!IsValidClient(client))
1401 return;
1402
1403 new ground_frames = g_js_GroundFrames[client];
1404 new strafes = g_js_StrafeCount[client];
1405 g_js_GroundFrames[client] = 0;
1406 g_js_fMax_Speed_Final[client] = g_js_fMax_Speed[client];
1407 decl String:szName[128];
1408 GetClientName(client, szName, 128);
1409
1410 //get landing position & calc distance
1411 g_js_fJump_DistanceX[client] = g_js_fJump_Landing_Pos[client][0] - g_js_fJump_JumpOff_Pos[client][0];
1412 if(g_js_fJump_DistanceX[client] < 0)
1413 g_js_fJump_DistanceX[client] = -g_js_fJump_DistanceX[client];
1414 g_js_fJump_DistanceZ[client] = g_js_fJump_Landing_Pos[client][1] - g_js_fJump_JumpOff_Pos[client][1];
1415 if(g_js_fJump_DistanceZ[client] < 0)
1416 g_js_fJump_DistanceZ[client] = -g_js_fJump_DistanceZ[client];
1417 g_js_fJump_Distance[client] = SquareRoot(Pow(g_js_fJump_DistanceX[client], 2.0) + Pow(g_js_fJump_DistanceZ[client], 2.0));
1418
1419 g_js_fJump_Distance[client] = g_js_fJump_Distance[client] + 32;
1420
1421 //ground diff
1422 new Float: fGroundDiff = g_js_fJump_Landing_Pos[client][2] - g_js_fJump_JumpOff_Pos[client][2];
1423 new Float: fJump_Height;
1424 if (fGroundDiff > -0.1 && fGroundDiff < 0.1)
1425 fGroundDiff = 0.0;
1426 //workaround
1427 if (g_js_bFuncMoveLinear[client] && fGroundDiff < 0.6 && fGroundDiff > -0.6)
1428 fGroundDiff = 0.0;
1429
1430 //ground diff 2
1431 new Float: groundpos[3];
1432 GetClientAbsOrigin(client, groundpos);
1433 new Float: fGroundDiff2 = groundpos[2] - g_fLastPositionOnGround[client][2];
1434
1435 //GetHeight
1436 if (FloatAbs(g_js_fJump_JumpOff_Pos[client][2]) > FloatAbs(g_js_fMax_Height[client]))
1437 fJump_Height = FloatAbs(g_js_fJump_JumpOff_Pos[client][2]) - FloatAbs(g_js_fMax_Height[client]);
1438 else
1439 fJump_Height = FloatAbs(g_js_fMax_Height[client]) - FloatAbs(g_js_fJump_JumpOff_Pos[client][2]);
1440 g_flastHeight[client] = fJump_Height;
1441
1442 //sync/strafes
1443 new sync = RoundToNearest(g_js_Good_Sync_Frames[client] / g_js_Sync_Frames[client] * 100.0);
1444 g_js_Strafes_Final[client] = strafes;
1445 g_js_Sync_Final[client] = sync;
1446
1447 //Calc & format strafe sync for chat output
1448 new String:szStrafeSync[255];
1449 new String:szStrafeSync2[255];
1450 new strafe_sync;
1451 if (g_bStrafeSync[client] && strafes > 1)
1452 {
1453 for (new i = 0; i < strafes; i++)
1454 {
1455 if (i==0)
1456 Format(szStrafeSync, 255, "[%cKZ%c] %cSync:",MOSSGREEN,WHITE,GRAY);
1457 if (g_js_Strafe_Frames[client][i] == 0.0 || g_js_Strafe_Good_Sync[client][i] == 0.0)
1458 strafe_sync = 0;
1459 else
1460 strafe_sync = RoundToNearest(g_js_Strafe_Good_Sync[client][i] / g_js_Strafe_Frames[client][i] * 100.0);
1461 if (i==0)
1462 Format(szStrafeSync2, 255, " %c%i.%c %i%c",GRAY, (i+1),LIMEGREEN,strafe_sync,PERCENT);
1463 else
1464 Format(szStrafeSync2, 255, "%c - %i.%c %i%c",GRAY, (i+1),LIMEGREEN,strafe_sync,PERCENT);
1465 StrCat(szStrafeSync, sizeof(szStrafeSync), szStrafeSync2);
1466 if ((i+1) == strafes)
1467 {
1468 Format(szStrafeSync2, 255, " %c[%c%i%c%c]",GRAY,PURPLE, sync,PERCENT,GRAY);
1469 StrCat(szStrafeSync, sizeof(szStrafeSync), szStrafeSync2);
1470 }
1471 }
1472 }
1473 else
1474 Format(szStrafeSync,255, "");
1475
1476 new String:szStrafeStats[1024];
1477 new String:szGained[16];
1478 new String:szLost[16];
1479
1480 //Format StrafeStats Console
1481 if(strafes > 1)
1482 {
1483 Format(szStrafeStats,1024, " #. Sync Gained Lost MaxSpeed\n");
1484 for( new i = 0; i < strafes; i++ )
1485 {
1486 new sync2 = RoundToNearest(g_js_Strafe_Good_Sync[client][i] / g_js_Strafe_Frames[client][i] * 100.0);
1487 if (sync2 < 0)
1488 sync2 = 0;
1489 if (g_js_Strafe_Gained[client][i] < 10.0)
1490 Format(szGained,16, "%.3f ", g_js_Strafe_Gained[client][i]);
1491 else
1492 Format(szGained,16, "%.3f", g_js_Strafe_Gained[client][i]);
1493 if (g_js_Strafe_Lost[client][i] < 10.0)
1494 Format(szLost,16, "%.3f ", g_js_Strafe_Lost[client][i]);
1495 else
1496 Format(szLost,16, "%.3f", g_js_Strafe_Lost[client][i]);
1497 Format(szStrafeStats,1024, "%s%2i. %3i%s %s %s %3.3f\n",\
1498 szStrafeStats,\
1499 i + 1,\
1500 sync2,\
1501 PERCENT,\
1502 szGained,\
1503 szLost,\
1504 g_js_Strafe_Max_Speed[client][i]);
1505 }
1506 }
1507 else
1508 Format(szStrafeStats,1024, "");
1509
1510
1511 //vertical jump
1512 if (fGroundDiff2 > 1.82 || fGroundDiff2 < -1.82 || fGroundDiff != 0.0)
1513 {
1514 Format(g_js_szLastJumpDistance[client], 256, "<font color='#948d8d'>vertical</font>");
1515 PostThinkPost(client, ground_frames);
1516 return;
1517 }
1518 //invalid jump
1519 if (g_fAirTime[client] > 0.83)
1520 {
1521 Format(g_js_szLastJumpDistance[client], 256, "<font color='#948d8d'>invalid</font>");
1522 PostThinkPost(client, ground_frames);
1523 return;
1524 }
1525
1526
1527 new bool: ValidJump=false;
1528 //Chat Output
1529 //LongJump
1530 if (ground_frames > 11 && fGroundDiff == 0.0 && fJump_Height <= 67.0 && g_js_fJump_Distance[client] < 300.0 && g_js_fMax_Speed_Final[client] > 200.0)
1531 {
1532 //prestrafe on/off
1533 decl String:szVr[16];
1534 Format(szVr, 16, "Pre");
1535 new bool: prestrafe;
1536 prestrafe = true;
1537
1538 //strafe hack block (aimware is pretty smart :/) (2/2)
1539 if (g_js_fPreStrafe[client] > 278.0 || g_js_fPreStrafe[client] < 200.0)
1540 {
1541 if (g_js_fPreStrafe[client] < 200.0)
1542 Format(g_js_szLastJumpDistance[client], 256, "<font color='#948d8d'>%.1f units</font>", g_js_fJump_Distance[client]);
1543 PostThinkPost(client, ground_frames);
1544 return;
1545 }
1546 //
1547 new bool:ljblock=false;
1548 decl String:sBlockDist[32];
1549 Format(sBlockDist, 32, "");
1550 decl String:sBlockDistCon[32];
1551 Format(sBlockDistCon, 32, "");
1552 if(g_bLJBlock[client] && g_BlockDist[client] > 225 && g_js_fJump_Distance[client] >= float(g_BlockDist[client]))
1553 {
1554 if (g_bLJBlockValidJumpoff[client])
1555 {
1556 if (g_bLjStarDest[client])
1557 {
1558 if (IsCoordInBlockPoint(g_js_fJump_Landing_Pos[client],g_fOriginBlock[client],true))
1559 {
1560 Format(sBlockDist, 32, "%t", "LjBlock", GRAY,YELLOW,g_BlockDist[client],GRAY);
1561 Format(sBlockDistCon, 32, " [%i block]", g_BlockDist[client]);
1562 ljblock=true;
1563 }
1564 }
1565 else
1566 {
1567 if (IsCoordInBlockPoint(g_js_fJump_Landing_Pos[client],g_fDestBlock[client],true))
1568 {
1569 Format(sBlockDist, 32, "%t", "LjBlock", GRAY,YELLOW,g_BlockDist[client],GRAY);
1570 Format(sBlockDistCon, 32, " [%i block]", g_BlockDist[client]);
1571 ljblock=true;
1572 }
1573 }
1574 }
1575 }
1576
1577 Format(g_js_szLastJumpDistance[client], 256, "<font color='#948d8d'>%.1f units</font>", g_js_fJump_Distance[client]);
1578 ValidJump=true;
1579 //good?
1580 if (g_js_fJump_Distance[client] >= g_dist_good_lj && g_js_fJump_Distance[client] < g_dist_pro_lj)
1581 {
1582 Format(g_js_szLastJumpDistance[client], 256, "<font color='#676060'><b>%.1f units</b></font>", g_js_fJump_Distance[client]);
1583 CreateTimer(0.1, BhopCheck, client,TIMER_FLAG_NO_MAPCHANGE);
1584 if (prestrafe)
1585 PrintToChat(client, "%t", "ClientLongJump1", MOSSGREEN,WHITE,GRAY, g_js_fJump_Distance[client],LIMEGREEN,strafes,GRAY, LIMEGREEN, g_js_fPreStrafe[client], GRAY,LIMEGREEN,g_js_fMax_Speed_Final[client],GRAY,LIMEGREEN, fJump_Height,GRAY,LIMEGREEN, sync,PERCENT,GRAY,sBlockDist);
1586 else
1587 PrintToChat(client, "%t", "ClientLongJump2",MOSSGREEN,WHITE,GRAY, g_js_fJump_Distance[client],LIMEGREEN,strafes,GRAY, LIMEGREEN, g_js_fPreStrafe[client], GRAY,LIMEGREEN,g_js_fMax_Speed_Final[client],GRAY,LIMEGREEN, fJump_Height,GRAY,LIMEGREEN, sync,PERCENT,GRAY,sBlockDist);
1588
1589 PrintToConsole(client, " ");
1590 PrintToConsole(client, "[JS] %s jumped %0.4f units with a LongJump [%i Strafes | %.3f %s | %.0f Max | Height %.1f | %i%c Sync]%s",szName, g_js_fJump_Distance[client],strafes, g_js_fPreStrafe[client], szVr,g_js_fMax_Speed_Final[client],fJump_Height,sync,PERCENT,sBlockDistCon);
1591 PrintToConsole(client, "%s", szStrafeStats);
1592 }
1593 else
1594 //pro?
1595 if (g_js_fJump_Distance[client] >= g_dist_pro_lj && g_js_fJump_Distance[client] < g_dist_leet_lj)
1596 {
1597 Format(g_js_szLastJumpDistance[client], 256, "<font color='#21982a'><b>%.2f units</b></font>", g_js_fJump_Distance[client]);
1598 CreateTimer(0.1, BhopCheck, client,TIMER_FLAG_NO_MAPCHANGE);
1599 //chat & sound client
1600 PrintToConsole(client, " ");
1601 PrintToConsole(client, "[JS] %s jumped %0.4f units with a LongJump [%i Strafes | %.3f %s | %.0f Max | Height %.1f | %i%c Sync]%s",szName, g_js_fJump_Distance[client],strafes, g_js_fPreStrafe[client],szVr, g_js_fMax_Speed_Final[client],fJump_Height,sync,PERCENT,sBlockDistCon);
1602 PrintToConsole(client, "%s", szStrafeStats);
1603 if (prestrafe)
1604 PrintToChat(client, "%t", "ClientLongJump3",MOSSGREEN,WHITE,GREEN,GRAY,GREEN,g_js_fJump_Distance[client],GRAY,LIMEGREEN,strafes,GRAY,LIMEGREEN,g_js_fPreStrafe[client],GRAY,LIMEGREEN,g_js_fMax_Speed_Final[client],GRAY,LIMEGREEN, fJump_Height,GRAY,LIMEGREEN, sync,PERCENT,GRAY,sBlockDist);
1605 else
1606 PrintToChat(client, "%t", "ClientLongJump4",MOSSGREEN,WHITE,GREEN,GRAY,GREEN,g_js_fJump_Distance[client],GRAY,LIMEGREEN,strafes,GRAY,LIMEGREEN,g_js_fPreStrafe[client],GRAY,LIMEGREEN,g_js_fMax_Speed_Final[client],GRAY,LIMEGREEN, fJump_Height,GRAY,LIMEGREEN, sync,PERCENT,GRAY,sBlockDist);
1607
1608 decl String:buffer[255];
1609 Format(buffer, sizeof(buffer), "play %s", PROJUMP_RELATIVE_SOUND_PATH);
1610 if (g_bEnableQuakeSounds[client])
1611 ClientCommand(client, buffer);
1612 //chat all
1613 for (new i = 1; i <= MaxClients; i++)
1614 {
1615 if (IsValidClient(i))
1616 {
1617 if (g_bColorChat[i] && i != client)
1618 PrintToChat(i, "%t", "Jumpstats_LjAll",MOSSGREEN,WHITE,GREEN,szName, MOSSGREEN,GREEN, g_js_fJump_Distance[client],MOSSGREEN,GREEN,sBlockDist);
1619 }
1620 }
1621
1622 }
1623 //leet?
1624 else
1625 {
1626 if (g_js_fJump_Distance[client] >= g_dist_leet_lj && g_js_fMax_Speed_Final[client] > 275.0)
1627 {
1628 // strafe hack protection
1629 if (strafes == 0)
1630 {
1631 Format(g_js_szLastJumpDistance[client], 256, "<font color='#948d8d'>invalid</font>");
1632 PostThinkPost(client, ground_frames);
1633 return;
1634 }
1635 Format(g_js_szLastJumpDistance[client], 256, "<font color='#9a0909'><b>%.2f units</b></font>", g_js_fJump_Distance[client]);
1636 g_js_LeetJump_Count[client]++;
1637 //client
1638 PrintToConsole(client, " ");
1639 PrintToConsole(client, "[JS] %s jumped %0.4f units with a LongJump [%i Strafes | %.3f %s | %.3f Max | Height %.1f | %i%c Sync]%s",szName, g_js_fJump_Distance[client],strafes, g_js_fPreStrafe[client],szVr, g_js_fMax_Speed_Final[client],fJump_Height,sync,PERCENT,sBlockDistCon);
1640 PrintToConsole(client, "%s", szStrafeStats);
1641 if (prestrafe)
1642 PrintToChat(client, "%t", "ClientLongJump3",MOSSGREEN,WHITE,DARKRED,GRAY,DARKRED,g_js_fJump_Distance[client],GRAY,LIMEGREEN,strafes,GRAY,LIMEGREEN,g_js_fPreStrafe[client],GRAY,LIMEGREEN, g_js_fMax_Speed_Final[client],GRAY,LIMEGREEN, fJump_Height,GRAY,LIMEGREEN, sync,PERCENT,GRAY,sBlockDist);
1643 else
1644 PrintToChat(client, "%t", "ClientLongJump4",MOSSGREEN,WHITE,DARKRED,GRAY,DARKRED,g_js_fJump_Distance[client],GRAY,LIMEGREEN,strafes,GRAY,LIMEGREEN,g_js_fPreStrafe[client],GRAY,LIMEGREEN, g_js_fMax_Speed_Final[client],GRAY,LIMEGREEN, fJump_Height,GRAY,LIMEGREEN, sync,PERCENT,GRAY,sBlockDist);
1645 if (g_js_LeetJump_Count[client]==3)
1646 PrintToChat(client, "%t", "Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
1647 else
1648 if (g_js_LeetJump_Count[client]==5)
1649 PrintToChat(client, "%t", "Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
1650
1651 //all
1652 for (new i = 1; i <= MaxClients; i++)
1653 {
1654 if (IsValidClient(i))
1655 {
1656 if (g_bColorChat[i] && i != client)
1657 {
1658 PrintToChat(i, "%t", "Jumpstats_LjAll",MOSSGREEN,WHITE,DARKRED,szName, RED,DARKRED, g_js_fJump_Distance[client],RED,DARKRED,sBlockDist);
1659 if (g_js_LeetJump_Count[client]==3)
1660 PrintToChat(i, "%t", "Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
1661 else
1662 if (g_js_LeetJump_Count[client]==5)
1663 PrintToChat(i, "%t", "Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
1664 }
1665 }
1666 }
1667 PlayLeetJumpSound(client);
1668 if (g_js_LeetJump_Count[client] != 3 && g_js_LeetJump_Count[client] != 5)
1669 {
1670 decl String:buffer[255];
1671 Format(buffer, sizeof(buffer), "play %s", LEETJUMP_RELATIVE_SOUND_PATH);
1672 }
1673 }
1674 else
1675 CreateTimer(0.1, BhopCheck, client,TIMER_FLAG_NO_MAPCHANGE);
1676
1677 }
1678
1679 //strafe sync chat
1680 if (g_bStrafeSync[client] && g_js_fJump_Distance[client] >= g_dist_good_lj)
1681 PrintToChat(client,"%s", szStrafeSync);
1682
1683 //new best
1684 if (((g_js_fPersonal_Lj_Record[client] < g_js_fJump_Distance[client]) || (ljblock && g_js_Personal_LjBlock_Record[client] < g_BlockDist[client]) || (ljblock && g_js_Personal_LjBlock_Record[client] == g_BlockDist[client] && g_js_fPersonal_LjBlockRecord_Dist[client] < g_js_fJump_Distance[client])) && !IsFakeClient(client))
1685 {
1686 if (ValidJump)
1687 {
1688 if (g_js_fPersonal_Lj_Record[client] > 0.0 && g_js_fPersonal_Lj_Record[client] < g_js_fJump_Distance[client])
1689 PrintToChat(client, "%t", "Jumpstats_BeatLjBest",MOSSGREEN,WHITE,YELLOW, g_js_fJump_Distance[client]);
1690 if (ljblock && g_js_Personal_LjBlock_Record[client] > 0 && ((g_js_Personal_LjBlock_Record[client] < g_BlockDist[client]) || (g_js_Personal_LjBlock_Record[client] == g_BlockDist[client] && g_js_fPersonal_LjBlockRecord_Dist[client] < g_js_fJump_Distance[client])))
1691 PrintToChat(client, "%t", "Jumpstats_BeatLjBlockBest",MOSSGREEN,WHITE,YELLOW, g_BlockDist[client],g_js_fJump_Distance[client]);
1692 if (g_js_fPersonal_Lj_Record[client] < g_js_fJump_Distance[client])
1693 {
1694 g_js_fPersonal_Lj_Record[client] = g_js_fJump_Distance[client];
1695 db_updateLjRecord(client);
1696 }
1697 if (g_js_Personal_LjBlock_Record[client] < g_BlockDist[client] && ljblock || (ljblock && g_js_Personal_LjBlock_Record[client] == g_BlockDist[client] && g_js_fPersonal_LjBlockRecord_Dist[client] < g_js_fJump_Distance[client]))
1698 {
1699 g_js_Personal_LjBlock_Record[client] = g_BlockDist[client];
1700 g_js_fPersonal_LjBlockRecord_Dist[client] = g_js_fJump_Distance[client];
1701 db_updateLjBlockRecord(client);
1702 }
1703 }
1704 }
1705 }
1706 //Multi Bhop
1707 if (g_js_Last_Ground_Frames[client] < 11 && ground_frames < 11 && fGroundDiff == 0.0 && fJump_Height <= 67.0 && !g_js_bDropJump[client])
1708 {
1709
1710 g_js_MultiBhop_Count[client]++;
1711 //strafe hack block
1712 if (strafes > 20)
1713 {
1714 PostThinkPost(client, ground_frames);
1715 return;
1716 }
1717
1718 //format bhop count
1719 decl String:szBhopCount[255];
1720 Format(szBhopCount, sizeof(szBhopCount), "%i", g_js_MultiBhop_Count[client]);
1721 if (g_js_MultiBhop_Count[client] > 8)
1722 Format(szBhopCount, sizeof(szBhopCount), "> 8");
1723
1724 Format(g_js_szLastJumpDistance[client], 256, "<font color='#948d8d'>%.1f units</font>", g_js_fJump_Distance[client]);
1725 ValidJump=true;
1726 //good?
1727 if (g_js_fJump_Distance[client] >= g_dist_good_multibhop && g_js_fJump_Distance[client] < g_dist_pro_multibhop)
1728 {
1729 Format(g_js_szLastJumpDistance[client], 256, "<font color='#676060'><b>%.1f units</b></font>", g_js_fJump_Distance[client]);
1730 g_js_LeetJump_Count[client]=0;
1731 PrintToChat(client, "%t", "ClientMultiBhop1",MOSSGREEN,WHITE, GRAY, g_js_fJump_Distance[client],LIMEGREEN, strafes, GRAY, LIMEGREEN, g_js_fPreStrafe[client], GRAY, LIMEGREEN, sync,PERCENT,GRAY);
1732 PrintToConsole(client, " ");
1733 PrintToConsole(client, "[JS] %s jumped %0.4f units with a MultiBhop [%i Strafes | %3.f Pre | %3.f Max | Height %.1f | %s Bhops | %i%c Sync]",szName, g_js_fJump_Distance[client],strafes, g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client], fJump_Height,szBhopCount,sync,PERCENT);
1734 PrintToConsole(client, "%s", szStrafeStats);
1735 }
1736 else
1737 //pro?
1738 if (g_js_fJump_Distance[client] >= g_dist_pro_multibhop && g_js_fJump_Distance[client] < g_dist_leet_multibhop)
1739 {
1740 Format(g_js_szLastJumpDistance[client], 256, "<font color='#21982a'><b>%.2f units</b></font>", g_js_fJump_Distance[client]);
1741 g_js_LeetJump_Count[client]=0;
1742 //Client
1743 PrintToConsole(client, " ");
1744 PrintToConsole(client, "[JS] %s jumped %0.4f units with a MultiBhop [%i Strafes | %.3f Pre | %.3f Max | Height %.1f | %s Bhops | %i%c Sync]",szName, g_js_fJump_Distance[client],strafes, g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client], fJump_Height,szBhopCount,sync,PERCENT);
1745 PrintToConsole(client, "%s", szStrafeStats);
1746 PrintToChat(client, "%t", "ClientMultiBhop2",MOSSGREEN,WHITE,GREEN,GRAY,GREEN,g_js_fJump_Distance[client],GRAY,LIMEGREEN,strafes,GRAY,LIMEGREEN,g_js_fPreStrafe[client],GRAY,LIMEGREEN,g_js_fMax_Speed_Final[client],GRAY,LIMEGREEN, fJump_Height,GRAY, LIMEGREEN,szBhopCount,GRAY,LIMEGREEN, sync,PERCENT,GRAY);
1747
1748 decl String:buffer[255];
1749 Format(buffer, sizeof(buffer), "play %s", PROJUMP_RELATIVE_SOUND_PATH);
1750 if (g_bEnableQuakeSounds[client])
1751 ClientCommand(client, buffer);
1752 //all
1753 for (new i = 1; i <= MaxClients; i++)
1754 {
1755 if (IsValidClient(i))
1756 {
1757 if (g_bColorChat[i] && i != client)
1758 PrintToChat(i, "%t", "Jumpstats_MultiBhopAll",MOSSGREEN,WHITE,GREEN,szName, MOSSGREEN,GREEN, g_js_fJump_Distance[client],MOSSGREEN,GREEN);
1759 }
1760 }
1761 }
1762 //leet?
1763 else
1764 if (g_js_fJump_Distance[client] >= g_dist_leet_multibhop)
1765 {
1766 // strafe hack protection
1767 if (strafes == 0 || g_js_fPreStrafe[client] < 270.0)
1768 {
1769 ValidJump=false;
1770 PostThinkPost(client, ground_frames);
1771 return;
1772 }
1773 Format(g_js_szLastJumpDistance[client], 256, "<font color='#9a0909'><b>%.2f units</b></font>", g_js_fJump_Distance[client]);
1774 g_js_LeetJump_Count[client]++;
1775 //Client
1776 PrintToConsole(client, " ");
1777 PrintToConsole(client, "[JS] %s jumped %0.4f units with a MultiBhop [%i Strafes | %.3f Pre | %.3f Max | Height %.1f | %s Bhops | %i%c Sync]",szName, g_js_fJump_Distance[client],strafes, g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client], fJump_Height,szBhopCount,sync,PERCENT);
1778 PrintToConsole(client, "%s", szStrafeStats);
1779 PrintToChat(client, "%t", "ClientMultiBhop2",MOSSGREEN,WHITE,DARKRED,GRAY,DARKRED,g_js_fJump_Distance[client],GRAY,LIMEGREEN,strafes,GRAY,LIMEGREEN,g_js_fPreStrafe[client],GRAY,LIMEGREEN,g_js_fMax_Speed_Final[client],GRAY,LIMEGREEN, fJump_Height,GRAY, LIMEGREEN,szBhopCount,GRAY,LIMEGREEN, sync,PERCENT,GRAY);
1780 if (g_js_LeetJump_Count[client]==3)
1781 PrintToChat(client, "%t", "Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
1782 else
1783 if (g_js_LeetJump_Count[client]==5)
1784 PrintToChat(client, "%t", "Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
1785
1786 //all
1787 for (new i = 1; i <= MaxClients; i++)
1788 {
1789 if (IsValidClient(i))
1790 {
1791 if (g_bColorChat[i] && i != client)
1792 {
1793 PrintToChat(i, "%t", "Jumpstats_MultiBhopAll",MOSSGREEN,WHITE,DARKRED,szName, RED,DARKRED, g_js_fJump_Distance[client],RED,DARKRED);
1794 if (g_js_LeetJump_Count[client]==3)
1795 PrintToChat(i, "%t", "Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
1796 else
1797 if (g_js_LeetJump_Count[client]==5)
1798 PrintToChat(i, "%t", "Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
1799 }
1800 }
1801 }
1802 PlayLeetJumpSound(client);
1803 if (g_js_LeetJump_Count[client] != 3 && g_js_LeetJump_Count[client] != 5)
1804 {
1805 decl String:buffer[255];
1806 Format(buffer, sizeof(buffer), "play %s", LEETJUMP_RELATIVE_SOUND_PATH);
1807 }
1808 }
1809 else
1810 g_js_LeetJump_Count[client]=0;
1811
1812 //strafe sync chat
1813 if (g_bStrafeSync[client] && g_js_fJump_Distance[client] >= g_dist_good_multibhop)
1814 PrintToChat(client,"%s", szStrafeSync);
1815
1816 //new best
1817 if (g_js_fPersonal_MultiBhop_Record[client] < g_js_fJump_Distance[client] && !IsFakeClient(client) && ValidJump)
1818 {
1819 if (g_js_fPersonal_MultiBhop_Record[client] > 0.0)
1820 PrintToChat(client, "%t", "Jumpstats_BeatMultiBhopBest",MOSSGREEN,WHITE,YELLOW, g_js_fJump_Distance[client]);
1821 g_js_fPersonal_MultiBhop_Record[client] = g_js_fJump_Distance[client];
1822 db_updateMultiBhopRecord(client);
1823 }
1824 }
1825 else
1826 g_js_MultiBhop_Count[client] = 1;
1827
1828 //dropbhop
1829 if (ground_frames < 11 && g_js_Last_Ground_Frames[client] > 11 && g_bLastButtonJump[client] && fGroundDiff == 0.0 && fJump_Height <= 67.0 && g_js_bDropJump[client])
1830 {
1831 if (g_js_fDropped_Units[client] > 150.0)
1832 {
1833 if (g_js_fDropped_Units[client] < 300.0)
1834 PrintToChat(client, "%t", "DropBhop1",MOSSGREEN,WHITE,RED,g_js_fDropped_Units[client],WHITE,GREEN,WHITE,GRAY,WHITE);
1835 }
1836 else
1837 {
1838 Format(g_js_szLastJumpDistance[client], 256, "<font color='#948d8d'>%.1f units</font>", g_js_fJump_Distance[client]);
1839 ValidJump = true;
1840 //good
1841 if (g_js_fJump_Distance[client] >= g_dist_good_dropbhop && g_js_fJump_Distance[client] < g_dist_pro_dropbhop)
1842 {
1843 Format(g_js_szLastJumpDistance[client], 256, "<font color='#676060'><b>%.1f units</b></font>", g_js_fJump_Distance[client]);
1844 g_js_LeetJump_Count[client]=0;
1845 PrintToChat(client, "%t", "ClientDropBhop1",MOSSGREEN,WHITE, GRAY,g_js_fJump_Distance[client],LIMEGREEN, strafes, GRAY, LIMEGREEN, g_js_fPreStrafe[client], GRAY, LIMEGREEN,fJump_Height,GRAY, LIMEGREEN,sync,PERCENT,GRAY);
1846 PrintToConsole(client, " ");
1847 PrintToConsole(client, "[JS] %s jumped %0.4f units with a DropBhop [%i Strafes | %.3f Pre | %.3f Max | Height %.1f | %i%c Sync]",szName, g_js_fJump_Distance[client],strafes, g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client],fJump_Height,sync,PERCENT);
1848 PrintToConsole(client, "%s", szStrafeStats);
1849 }
1850 else
1851 //pro
1852 if (g_js_fJump_Distance[client] >= g_dist_pro_dropbhop && g_js_fJump_Distance[client] < g_dist_leet_dropbhop)
1853 {
1854 g_js_LeetJump_Count[client]=0;
1855 Format(g_js_szLastJumpDistance[client], 256, "<font color='#21982a'><b>%.2f units</b></font>", g_js_fJump_Distance[client]);
1856 PrintToConsole(client, " ");
1857 PrintToChat(client, "%t", "ClientDropBhop2",MOSSGREEN,WHITE,GREEN,GRAY,GREEN,g_js_fJump_Distance[client],GRAY,LIMEGREEN,strafes,GRAY,LIMEGREEN,g_js_fPreStrafe[client],GRAY,LIMEGREEN, g_js_fMax_Speed_Final[client],GRAY,LIMEGREEN, fJump_Height,GRAY, LIMEGREEN,sync,PERCENT,GRAY);
1858 PrintToConsole(client, "[JS] %s jumped %0.4f units with a DropBhop [%i Strafes | %.3f Pre | %.3f Max | Height %.1f | %i%c Sync]",szName, g_js_fJump_Distance[client],strafes, g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client],fJump_Height,sync,PERCENT);
1859 PrintToConsole(client, "%s", szStrafeStats);
1860 decl String:buffer[255];
1861 Format(buffer, sizeof(buffer), "play %s", PROJUMP_RELATIVE_SOUND_PATH);
1862 if (g_bEnableQuakeSounds[client])
1863 ClientCommand(client, buffer);
1864 //all
1865 for (new i = 1; i <= MaxClients; i++)
1866 {
1867 if (IsValidClient(i))
1868 {
1869 if (g_bColorChat[i]==true && i != client)
1870 PrintToChat(i, "%t", "Jumpstats_DropBhopAll",MOSSGREEN,WHITE,GREEN,szName, MOSSGREEN,GREEN, g_js_fJump_Distance[client],MOSSGREEN,GREEN);
1871 }
1872 }
1873 }
1874 //leet
1875 else
1876 if (g_js_fJump_Distance[client] >= g_dist_leet_dropbhop && g_js_fMax_Speed_Final[client] > 330.0)
1877 {
1878 // strafe hack protection
1879 if (strafes == 0 || g_js_fPreStrafe[client] < 270.0)
1880 {
1881 ValidJump = false;
1882 Format(g_js_szLastJumpDistance[client], 256, "<font color='#948d8d'>invalid</font>");
1883 PostThinkPost(client, ground_frames);
1884 return;
1885 }
1886 Format(g_js_szLastJumpDistance[client], 256, "<font color='#9a0909'><b>%.2f units</b></font>", g_js_fJump_Distance[client]);
1887 g_js_LeetJump_Count[client]++;
1888 //Client
1889 PrintToConsole(client, " ");
1890 PrintToChat(client, "%t", "ClientDropBhop2",MOSSGREEN,WHITE,DARKRED,GRAY,DARKRED,g_js_fJump_Distance[client],GRAY,LIMEGREEN,strafes,GRAY,LIMEGREEN,g_js_fPreStrafe[client],GRAY,LIMEGREEN, g_js_fMax_Speed_Final[client],GRAY,LIMEGREEN,fJump_Height,GRAY, LIMEGREEN, sync,PERCENT,GRAY);
1891 PrintToConsole(client, "[JS] %s jumped %0.4f units with a DropBhop [%i Strafes | %.3f Pre | %.3f Max | Height %.1f | %i%c Sync]",szName, g_js_fJump_Distance[client],strafes, g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client],fJump_Height,sync,PERCENT);
1892 PrintToConsole(client, "%s", szStrafeStats);
1893 if (g_js_LeetJump_Count[client]==3)
1894 PrintToChat(client, "%t", "Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
1895 else
1896 if (g_js_LeetJump_Count[client]==5)
1897 PrintToChat(client, "%t", "Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
1898
1899 //all
1900 for (new i = 1; i <= MaxClients; i++)
1901 {
1902 if (IsValidClient(i))
1903 {
1904 if (g_bColorChat[i]==true && i != client)
1905 {
1906 PrintToChat(i, "%t", "Jumpstats_DropBhopAll",MOSSGREEN,WHITE,DARKRED,szName, RED,DARKRED, g_js_fJump_Distance[client], RED,DARKRED);
1907 if (g_js_LeetJump_Count[client]==3)
1908 PrintToChat(i, "%t", "Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
1909 else
1910 if (g_js_LeetJump_Count[client]==5)
1911 PrintToChat(i, "%t", "Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
1912 }
1913 }
1914 }
1915 PlayLeetJumpSound(client);
1916 if (g_js_LeetJump_Count[client] != 3 && g_js_LeetJump_Count[client] != 5)
1917 {
1918 decl String:buffer[255];
1919 Format(buffer, sizeof(buffer), "play %s", LEETJUMP_RELATIVE_SOUND_PATH);
1920 }
1921 }
1922 else
1923 g_js_LeetJump_Count[client]=0;
1924
1925 //strafesync chat
1926 if (g_bStrafeSync[client] && g_js_fJump_Distance[client] >= g_dist_good_dropbhop)
1927 PrintToChat(client,"%s", szStrafeSync);
1928
1929 //new best
1930 if (g_js_fPersonal_DropBhop_Record[client] < g_js_fJump_Distance[client] && !IsFakeClient(client) && ValidJump)
1931 {
1932 if (g_js_fPersonal_DropBhop_Record[client] > 0.0)
1933 PrintToChat(client, "%t", "Jumpstats_BeatDropBhopBest",MOSSGREEN,WHITE,YELLOW, g_js_fJump_Distance[client]);
1934 g_js_fPersonal_DropBhop_Record[client] = g_js_fJump_Distance[client];
1935 db_updateDropBhopRecord(client);
1936 }
1937
1938 }
1939 }
1940 // WeirdJump
1941 if (ground_frames < 11 && !g_bLastButtonJump[client] && fGroundDiff == 0.0 && fJump_Height <= 67.0 && g_js_bDropJump[client])
1942 {
1943 if (g_js_fDropped_Units[client] > 150.0)
1944 {
1945 if (g_js_fDropped_Units[client] < 300.0)
1946 PrintToChat(client, "%t", "Wj1",MOSSGREEN,WHITE,RED,g_js_fDropped_Units[client],WHITE,GREEN,WHITE,GRAY,WHITE);
1947 }
1948 else
1949 {
1950 Format(g_js_szLastJumpDistance[client], 256, "<font color='#948d8d'>%.1f units</font>", g_js_fJump_Distance[client]);
1951 ValidJump = true;
1952 //good?
1953 if (g_js_fJump_Distance[client] >= g_dist_good_weird && g_js_fJump_Distance[client] < g_dist_pro_weird)
1954 {
1955 Format(g_js_szLastJumpDistance[client], 256, "<font color='#676060'><b>%.1f units</b></font>", g_js_fJump_Distance[client]);
1956 g_js_LeetJump_Count[client]=0;
1957 PrintToChat(client, "%t", "ClientWeirdJump1",MOSSGREEN,WHITE, GRAY,g_js_fJump_Distance[client],LIMEGREEN, strafes, GRAY, LIMEGREEN, g_js_fPreStrafe[client], GRAY, LIMEGREEN,fJump_Height,GRAY, LIMEGREEN, sync,PERCENT,GRAY);
1958 PrintToConsole(client, " ");
1959 PrintToConsole(client, "[JS] %s jumped %0.4f units with a WeirdJump [%i Strafes | %.3f Pre | %.3f Max | Height %.1f | %i%c Sync]",szName, g_js_fJump_Distance[client],strafes, g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client],fJump_Height,sync,PERCENT);
1960 PrintToConsole(client, "%s", szStrafeStats);
1961 }
1962 //pro?
1963 else
1964 if (g_js_fJump_Distance[client] >= g_dist_pro_weird && g_js_fJump_Distance[client] < g_dist_leet_weird)
1965 {
1966 Format(g_js_szLastJumpDistance[client], 256, "<font color='#21982a'><b>%.2f units</b></font>", g_js_fJump_Distance[client]);
1967 g_js_LeetJump_Count[client]=0;
1968 //Client
1969 PrintToConsole(client, " ");
1970 PrintToChat(client, "%t", "ClientWeirdJump2",MOSSGREEN,WHITE,GREEN,GRAY,GREEN,g_js_fJump_Distance[client],GRAY,LIMEGREEN,strafes,GRAY,LIMEGREEN,g_js_fPreStrafe[client],GRAY,LIMEGREEN, g_js_fMax_Speed_Final[client],GRAY,LIMEGREEN,fJump_Height,GRAY, LIMEGREEN, sync,PERCENT,GRAY);
1971 PrintToConsole(client, "[JS] %s jumped %0.4f units with a WeirdJump [%i Strafes | %.3f Pre | %.3f Max | Height %.1f | %i%c Sync]",szName, g_js_fJump_Distance[client],strafes, g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client],fJump_Height,sync,PERCENT);
1972 PrintToConsole(client, "%s", szStrafeStats);
1973 decl String:buffer[255];
1974 Format(buffer, sizeof(buffer), "play %s", PROJUMP_RELATIVE_SOUND_PATH);
1975 if (g_bEnableQuakeSounds[client])
1976 ClientCommand(client, buffer);
1977 //all
1978 for (new i = 1; i <= MaxClients; i++)
1979 {
1980 if (IsValidClient(i))
1981 {
1982 if (g_bColorChat[i]==true && i != client)
1983 PrintToChat(i, "%t", "Jumpstats_WeirdAll",MOSSGREEN,WHITE,GREEN,szName, MOSSGREEN,GREEN, g_js_fJump_Distance[client],MOSSGREEN,GREEN);
1984 }
1985 }
1986 }
1987 //leet?
1988 else
1989 if (g_js_fJump_Distance[client] >= g_dist_leet_weird)
1990 {
1991 // strafe hack protection
1992 if (strafes == 0 || g_js_fPreStrafe[client] < 255.0)
1993 {
1994 ValidJump = false;
1995 Format(g_js_szLastJumpDistance[client], 256, "<font color='#948d8d'>invalid</font>");
1996 PostThinkPost(client, ground_frames);
1997 return;
1998 }
1999 Format(g_js_szLastJumpDistance[client], 256, "<font color='#9a0909'><b>%.2f units</b></font>", g_js_fJump_Distance[client]);
2000 g_js_LeetJump_Count[client]++;
2001 //Client
2002 PrintToConsole(client, " ");
2003 PrintToChat(client, "%t", "ClientWeirdJump2",MOSSGREEN,WHITE,DARKRED,GRAY,DARKRED,g_js_fJump_Distance[client],GRAY,LIMEGREEN,strafes,GRAY,LIMEGREEN,g_js_fPreStrafe[client],GRAY,LIMEGREEN, g_js_fMax_Speed_Final[client],GRAY,LIMEGREEN,fJump_Height,GRAY, LIMEGREEN, sync,PERCENT,GRAY);
2004 PrintToConsole(client, "[JS] %s jumped %0.4f units with a WeirdJump [%i Strafes | %.3f Pre | %.3f Max | Height %.1f | %i%c Sync]",szName, g_js_fJump_Distance[client],strafes, g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client],fJump_Height,sync,PERCENT);
2005 PrintToConsole(client, "%s", szStrafeStats);
2006 if (g_js_LeetJump_Count[client]==3)
2007 PrintToChat(client, "%t", "Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
2008 else
2009 if (g_js_LeetJump_Count[client]==5)
2010 PrintToChat(client, "%t", "Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
2011
2012 //all
2013 for (new i = 1; i <= MaxClients; i++)
2014 {
2015 if (IsValidClient(i))
2016 {
2017 if (g_bColorChat[i]==true && i != client)
2018 {
2019 PrintToChat(i, "%t", "Jumpstats_WeirdAll",MOSSGREEN,WHITE,DARKRED,szName, RED,DARKRED, g_js_fJump_Distance[client],RED,DARKRED);
2020 if (g_js_LeetJump_Count[client]==3)
2021 PrintToChat(i, "%t", "Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
2022 else
2023 if (g_js_LeetJump_Count[client]==5)
2024 PrintToChat(i, "%t", "Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
2025 }
2026 }
2027 }
2028 PlayLeetJumpSound(client);
2029 if (g_js_LeetJump_Count[client] != 3 && g_js_LeetJump_Count[client] != 5)
2030 {
2031 decl String:buffer[255];
2032 Format(buffer, sizeof(buffer), "play %s", LEETJUMP_RELATIVE_SOUND_PATH);
2033 }
2034 }
2035 else
2036 g_js_LeetJump_Count[client]=0;
2037
2038 //strafesync chat
2039 if (g_bStrafeSync[client] && g_js_fJump_Distance[client] >= g_dist_good_weird)
2040 PrintToChat(client,"%s", szStrafeSync);
2041
2042 //new best
2043 if (g_js_fPersonal_Wj_Record[client] < g_js_fJump_Distance[client] && !IsFakeClient(client) && ValidJump)
2044 {
2045 if (g_js_fPersonal_Wj_Record[client] > 0.0)
2046 PrintToChat(client, "%t", "Jumpstats_BeatWjBest",MOSSGREEN,WHITE,YELLOW, g_js_fJump_Distance[client]);
2047 g_js_fPersonal_Wj_Record[client] = g_js_fJump_Distance[client];
2048 db_updateWjRecord(client);
2049 }
2050 }
2051 }
2052 //BunnyHop
2053 if (ground_frames < 11 && g_js_Last_Ground_Frames[client] > 10 && fGroundDiff == 0.0 && fJump_Height <= 67.0 && !g_js_bDropJump[client] && g_js_fPreStrafe[client] > 200.0)
2054 {
2055 Format(g_js_szLastJumpDistance[client], 256, "<font color='#948d8d'>%.1f units</font>", g_js_fJump_Distance[client]);
2056 ValidJump=true;
2057 //good?
2058 if (g_js_fJump_Distance[client] >= g_dist_good_bhop && g_js_fJump_Distance[client] < g_dist_pro_bhop)
2059 {
2060 Format(g_js_szLastJumpDistance[client], 256, "<font color='#676060'><b>%.1f units</b></font>", g_js_fJump_Distance[client]);
2061 g_js_LeetJump_Count[client]=0;
2062 PrintToChat(client, "%t", "ClientBunnyhop1",MOSSGREEN,WHITE,GRAY, g_js_fJump_Distance[client],LIMEGREEN, strafes, GRAY, LIMEGREEN, g_js_fPreStrafe[client], GRAY, LIMEGREEN, fJump_Height,GRAY, LIMEGREEN, sync,PERCENT,GRAY);
2063 PrintToConsole(client, " ");
2064 PrintToConsole(client, "[JS] %s jumped %0.4f units with a Bhop [%i Strafes | %.3f Pre | %.3f Max | Height %.1f | %i%c Sync]",szName, g_js_fJump_Distance[client],strafes, g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client],fJump_Height,sync,PERCENT);
2065 PrintToConsole(client, "%s", szStrafeStats);
2066 }
2067 else
2068 //pro?
2069 if (g_js_fJump_Distance[client] >= g_dist_pro_bhop && g_js_fJump_Distance[client] < g_dist_leet_bhop)
2070 {
2071 Format(g_js_szLastJumpDistance[client], 256, "<font color='#21982a'><b>%.2f units</b></font>", g_js_fJump_Distance[client]);
2072 g_js_LeetJump_Count[client]=0;
2073 PrintToConsole(client, " ");
2074 PrintToChat(client, "%t", "ClientBunnyhop2",MOSSGREEN,WHITE,GREEN,GRAY,GREEN,g_js_fJump_Distance[client],GRAY,LIMEGREEN,strafes,GRAY,LIMEGREEN,g_js_fPreStrafe[client],GRAY,LIMEGREEN, g_js_fMax_Speed_Final[client],GRAY,LIMEGREEN, fJump_Height,GRAY, LIMEGREEN, sync,PERCENT,GRAY);
2075 PrintToConsole(client, "[JS] %s jumped %0.4f units with a Bhop [%i Strafes | %.3f Pre | %.3f Max | Height %.1f | %i%c Sync]",szName, g_js_fJump_Distance[client],strafes, g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client],fJump_Height, sync,PERCENT);
2076 PrintToConsole(client, "%s", szStrafeStats);
2077 decl String:buffer[255];
2078 Format(buffer, sizeof(buffer), "play %s", PROJUMP_RELATIVE_SOUND_PATH);
2079 if (g_bEnableQuakeSounds[client])
2080 ClientCommand(client, buffer);
2081 //all
2082 for (new i = 1; i <= MaxClients; i++)
2083 {
2084 if (IsValidClient(i))
2085 {
2086 if (g_bColorChat[i]==true && i != client)
2087 PrintToChat(i, "%t", "Jumpstats_BhopAll",MOSSGREEN,WHITE,GREEN,szName, MOSSGREEN,GREEN, g_js_fJump_Distance[client],MOSSGREEN,GREEN);
2088 }
2089 }
2090 }
2091 else
2092 {
2093 //leet?
2094 if (g_js_fJump_Distance[client] >= g_dist_leet_bhop && g_js_fMax_Speed_Final[client] > 330.0)
2095 {
2096 // strafe hack protection
2097 if (strafes == 0 || g_js_fPreStrafe[client] < 270.0)
2098 {
2099 ValidJump=false;
2100 Format(g_js_szLastJumpDistance[client], 256, "<font color='#948d8d'>invalid</font>");
2101 PostThinkPost(client, ground_frames);
2102 return;
2103 }
2104 Format(g_js_szLastJumpDistance[client], 256, "<font color='#9a0909'><b>%.2f units</b></font>", g_js_fJump_Distance[client]);
2105 g_js_LeetJump_Count[client]++;
2106 //Client
2107 PrintToConsole(client, " ");
2108 PrintToChat(client, "%t", "ClientBunnyhop2",MOSSGREEN,WHITE,DARKRED,GRAY,DARKRED,g_js_fJump_Distance[client],GRAY,LIMEGREEN,strafes,GRAY,LIMEGREEN,g_js_fPreStrafe[client],GRAY,LIMEGREEN, g_js_fMax_Speed_Final[client],GRAY,LIMEGREEN, fJump_Height,GRAY, LIMEGREEN, sync,PERCENT,GRAY);
2109 PrintToConsole(client, "[JS] %s jumped %0.4f units with a Bhop [%i Strafes | %.3f Pre | %.3f Max | Height %.1f | %i%c Sync]",szName, g_js_fJump_Distance[client],strafes, g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client],fJump_Height, sync,PERCENT);
2110 PrintToConsole(client, "%s", szStrafeStats);
2111 if (g_js_LeetJump_Count[client]==3)
2112 PrintToChat(client, "%t", "Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
2113 else
2114 if (g_js_LeetJump_Count[client]==5)
2115 PrintToChat(client, "%t", "Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
2116
2117 //all
2118 for (new i = 1; i <= MaxClients; i++)
2119 {
2120 if (IsValidClient(i))
2121 {
2122 if (g_bColorChat[i]==true && i != client)
2123 {
2124 PrintToChat(i, "%t", "Jumpstats_BhopAll",MOSSGREEN,WHITE,DARKRED,szName, RED,DARKRED, g_js_fJump_Distance[client],RED,DARKRED);
2125 if (g_js_LeetJump_Count[client]==3)
2126 PrintToChat(i, "%t", "Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
2127 else
2128 if (g_js_LeetJump_Count[client]==5)
2129 PrintToChat(i, "%t", "Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
2130 }
2131 }
2132 }
2133 PlayLeetJumpSound(client);
2134 if (g_js_LeetJump_Count[client] != 3 && g_js_LeetJump_Count[client] != 5)
2135 {
2136 decl String:buffer[255];
2137 Format(buffer, sizeof(buffer), "play %s", LEETJUMP_RELATIVE_SOUND_PATH);
2138 }
2139 }
2140 else
2141 {
2142 g_js_LeetJump_Count[client]=0;
2143 }
2144 }
2145
2146 //strafe sync chat
2147 if (g_bStrafeSync[client] && g_js_fJump_Distance[client] >= g_dist_good_bhop)
2148 PrintToChat(client,"%s", szStrafeSync);
2149
2150 //new best
2151 if (g_js_fPersonal_Bhop_Record[client] < g_js_fJump_Distance[client] && !IsFakeClient(client) && ValidJump)
2152 {
2153 if (g_js_fPersonal_Bhop_Record[client] > 0.0)
2154 PrintToChat(client, "%t", "Jumpstats_BeatBhopBest",MOSSGREEN,WHITE,YELLOW, g_js_fJump_Distance[client]);
2155 g_js_fPersonal_Bhop_Record[client] = g_js_fJump_Distance[client];
2156 db_updateBhopRecord(client);
2157 }
2158
2159 }
2160 if (!ValidJump)
2161 g_js_LeetJump_Count[client]=0;
2162 PostThinkPost(client, ground_frames);
2163}
2164
2165public PostThinkPost(client, ground_frames)
2166{
2167 g_js_bPlayerJumped[client] = false;
2168 g_js_Last_Ground_Frames[client] = ground_frames;
2169}
2170
2171public Action:Client_Ljblock(client, args)
2172{
2173 if (IsValidClient(client) && IsPlayerAlive(client))
2174 LJBlockMenu(client);
2175 return Plugin_Handled;
2176}
2177
2178public LJBlockMenu(client)
2179{
2180 new Handle:menu = CreateMenu(LjBlockMenuHandler);
2181 SetMenuTitle(menu, "LJ Block Jump Menu");
2182 AddMenuItem(menu, "0", "Select Destination");
2183 AddMenuItem(menu, "0", "Reset Destination");
2184 SetMenuOptionFlags(menu, MENUFLAG_BUTTON_EXIT);
2185 DisplayMenu(menu, client, MENU_TIME_FOREVER);
2186}
2187
2188public LjBlockMenuHandler(Handle:menu, MenuAction:action, client, select)
2189{
2190 if(action == MenuAction_Select)
2191 {
2192 if(select == 0)
2193 {
2194 Function_BlockJump(client);
2195 LJBlockMenu(client);
2196 }
2197 else if(select == 1)
2198 {
2199 g_bLJBlock[client] = false;
2200 LJBlockMenu(client);
2201 }
2202 }
2203}
2204
2205public Action:Client_InfoPanel(client, args)
2206{
2207 InfoPanel(client);
2208 if (g_bInfoPanel[client] == true)
2209 PrintToChat(client, "%t", "Info1", MOSSGREEN,WHITE);
2210 else
2211 PrintToChat(client, "%t", "Info2", MOSSGREEN,WHITE);
2212 return Plugin_Handled;
2213}
2214
2215public InfoPanel(client)
2216{
2217 if (g_bInfoPanel[client])
2218 g_bInfoPanel[client] = false;
2219 else
2220 {
2221 g_bInfoPanel[client] = true;
2222 }
2223}
2224
2225public Action:Client_StrafeSync(client, args)
2226{
2227 StrafeSync(client);
2228 if (g_bStrafeSync[client])
2229 PrintToChat(client, "%t", "StrafeSync1", MOSSGREEN,WHITE);
2230 else
2231 PrintToChat(client, "%t", "StrafeSync2", MOSSGREEN,WHITE);
2232 return Plugin_Handled;
2233}
2234
2235public Action:Client_Stats(client, args)
2236{
2237 g_bdetailView[client]=false;
2238 decl String:szSteamId[32];
2239 if (IsValidClient(client))
2240 GetClientAuthString(client, szSteamId, 32);
2241 db_viewJumpStats(client, szSteamId)
2242 return Plugin_Handled;
2243}
2244
2245
2246public StrafeSync(client)
2247{
2248 if (g_bStrafeSync[client])
2249 g_bStrafeSync[client] = false;
2250 else
2251 g_bStrafeSync[client] = true;
2252}
2253
2254public Action:Client_QuakeSounds(client, args)
2255{
2256 QuakeSounds(client);
2257 if (g_bEnableQuakeSounds[client])
2258 PrintToChat(client, "%t", "QuakeSounds1", MOSSGREEN,WHITE);
2259 else
2260 PrintToChat(client, "%t", "QuakeSounds2", MOSSGREEN,WHITE);
2261 return Plugin_Handled;
2262}
2263
2264public QuakeSounds(client)
2265{
2266 if (g_bEnableQuakeSounds[client])
2267 g_bEnableQuakeSounds[client] = false;
2268 else
2269 g_bEnableQuakeSounds[client] = true;
2270}
2271
2272public Action:Client_Colorchat(client, args)
2273{
2274 ColorChat(client);
2275 if (g_bColorChat[client])
2276 PrintToChat(client, "%t", "Colorchat1", MOSSGREEN,WHITE);
2277 else
2278 PrintToChat(client, "%t", "Colorchat2", MOSSGREEN,WHITE);
2279 return Plugin_Handled;
2280}
2281
2282public PlayLeetJumpSound(client)
2283{
2284 decl String:buffer[255];
2285
2286 //all sound
2287 if (g_js_LeetJump_Count[client] == 3 || g_js_LeetJump_Count[client] == 5)
2288 {
2289 for (new i = 1; i <= MaxClients; i++)
2290 {
2291 if(IsValidClient(i) && !IsFakeClient(i) && i != client && g_bColorChat[i] && g_bEnableQuakeSounds[i])
2292 {
2293 if (g_js_LeetJump_Count[client]==3)
2294 {
2295 Format(buffer, sizeof(buffer), "play %s", LEETJUMP_RAMPAGE_RELATIVE_SOUND_PATH);
2296 ClientCommand(i, buffer);
2297 }
2298 else
2299 if (g_js_LeetJump_Count[client]==5)
2300 {
2301 Format(buffer, sizeof(buffer), "play %s", LEETJUMP_DOMINATING_RELATIVE_SOUND_PATH);
2302 ClientCommand(i, buffer);
2303 }
2304 }
2305 }
2306 }
2307
2308 //client sound
2309 if (IsValidClient(client) && !IsFakeClient(client) && g_bEnableQuakeSounds[client])
2310 {
2311 if (g_js_LeetJump_Count[client] != 3 && g_js_LeetJump_Count[client] != 5)
2312 {
2313 Format(buffer, sizeof(buffer), "play %s", LEETJUMP_RELATIVE_SOUND_PATH);
2314 ClientCommand(client, buffer);
2315 }
2316 else
2317 if (g_js_LeetJump_Count[client]==3)
2318 {
2319 Format(buffer, sizeof(buffer), "play %s", LEETJUMP_RAMPAGE_RELATIVE_SOUND_PATH);
2320 ClientCommand(client, buffer);
2321 }
2322 else
2323 if (g_js_LeetJump_Count[client]==5)
2324 {
2325 Format(buffer, sizeof(buffer), "play %s", LEETJUMP_DOMINATING_RELATIVE_SOUND_PATH);
2326 ClientCommand(client, buffer);
2327 }
2328 }
2329}
2330
2331public ColorChat(client)
2332{
2333 if (g_bColorChat[client])
2334 g_bColorChat[client] = false;
2335 else
2336 g_bColorChat[client] = true;
2337}
2338
2339public Action:Client_Top(client, args)
2340{
2341 JumpTopMenu(client);
2342 return Plugin_Handled;
2343}
2344
2345public JumpTopMenu(client)
2346{
2347 new Handle:topmenu2 = CreateMenu(JumpTopMenuHandler);
2348 SetMenuTitle(topmenu2, "Jump Top");
2349 AddMenuItem(topmenu2, "!lj", "Top 20 Longjump");
2350 AddMenuItem(topmenu2, "!ljblock", "Top 20 Block Longjump");
2351 AddMenuItem(topmenu2, "!bhop", "Top 20 Bunnyhop");
2352 AddMenuItem(topmenu2, "!multibhop", "Top 20 Multi-Bunnyhop");
2353 AddMenuItem(topmenu2, "!dropbhop", "Top 20 Drop-Bunnyhop");
2354 AddMenuItem(topmenu2, "!wj", "Top 20 Weirdjump");
2355 SetMenuOptionFlags(topmenu2, MENUFLAG_BUTTON_EXIT);
2356 DisplayMenu(topmenu2, client, MENU_TIME_FOREVER);
2357}
2358
2359public JumpTopMenuHandler(Handle:menu, MenuAction:action, param1,param2)
2360{
2361 if(action == MenuAction_Select)
2362 {
2363 switch(param2)
2364 {
2365 case 0: db_selectTopLj(param1);
2366 case 1: db_selectTopLjBlock(param1);
2367 case 2: db_selectTopBhop(param1);
2368 case 3: db_selectTopMultiBhop(param1);
2369 case 4: db_selectTopDropBhop(param1);
2370 case 5: db_selectTopWj(param1);
2371 }
2372 }
2373}
2374
2375
2376///SQL
2377
2378public db_updateLjRecord(client)
2379{
2380 decl String:szQuery[255];
2381 decl String:szSteamId[32];
2382 if (IsValidClient(client))
2383 GetClientAuthString(client, szSteamId, 32);
2384 else
2385 return;
2386 Format(szQuery, 255, sql_selectPlayerJumpLJ, szSteamId);
2387 if (!IsFakeClient(client))
2388 SQL_TQuery(g_hDb, SQL_UpdateLjRecordCallback, szQuery, client,DBPrio_Low);
2389}
2390
2391public db_updateLjBlockRecord(client)
2392{
2393 decl String:szQuery[255];
2394 decl String:szSteamId[32];
2395 if (IsValidClient(client))
2396 GetClientAuthString(client, szSteamId, 32);
2397 else
2398 return;
2399 Format(szQuery, 255, sql_selectPlayerJumpLJBlock, szSteamId);
2400 if (!IsFakeClient(client))
2401 SQL_TQuery(g_hDb, SQL_UpdateLjBlockRecordCallback, szQuery, client,DBPrio_Low);
2402}
2403
2404public db_updateWjRecord(client)
2405{
2406 decl String:szQuery[255];
2407 decl String:szSteamId[32];
2408 if (IsValidClient(client))
2409 GetClientAuthString(client, szSteamId, 32);
2410 else
2411 return;
2412 Format(szQuery, 255, sql_selectPlayerJumpWJ, szSteamId);
2413 if (!IsFakeClient(client))
2414 SQL_TQuery(g_hDb, SQL_UpdateWjRecordCallback, szQuery, client,DBPrio_Low);
2415}
2416
2417public db_updateBhopRecord(client)
2418{
2419 decl String:szQuery[255];
2420 decl String:szSteamId[32];
2421 if (IsValidClient(client))
2422 GetClientAuthString(client, szSteamId, 32);
2423 else
2424 return;
2425 Format(szQuery, 255, sql_selectPlayerJumpBhop, szSteamId);
2426 if (!IsFakeClient(client))
2427 SQL_TQuery(g_hDb, SQL_UpdateBhopRecordCallback, szQuery, client,DBPrio_Low);
2428}
2429
2430public db_updateDropBhopRecord(client)
2431{
2432 decl String:szQuery[255];
2433 decl String:szSteamId[32];
2434 if (IsValidClient(client))
2435 GetClientAuthString(client, szSteamId, 32);
2436 else
2437 return;
2438 Format(szQuery, 255, sql_selectPlayerJumpDropBhop, szSteamId);
2439 if (!IsFakeClient(client))
2440 SQL_TQuery(g_hDb, SQL_UpdateDropBhopRecordCallback, szQuery, client,DBPrio_Low);
2441}
2442
2443public db_updateMultiBhopRecord(client)
2444{
2445 decl String:szQuery[255];
2446 decl String:szSteamId[32];
2447 if (IsValidClient(client))
2448 GetClientAuthString(client, szSteamId, 32);
2449 else
2450 return;
2451 Format(szQuery, 255, sql_selectPlayerJumpMultiBhop, szSteamId);
2452 if (!IsFakeClient(client))
2453 SQL_TQuery(g_hDb, SQL_UpdateMultiBhopRecordCallback, szQuery, client,DBPrio_Low);
2454}
2455
2456
2457public SQL_UpdateLjRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2458{
2459 new client = data;
2460 if (IsValidClient(client))
2461 {
2462 decl String:szQuery[512];
2463 decl String:szUName[MAX_NAME_LENGTH];
2464 GetClientName(client, szUName, MAX_NAME_LENGTH);
2465 decl String:szSteamId[32];
2466 GetClientAuthString(client, szSteamId, 32);
2467 decl String:szName[MAX_NAME_LENGTH*2+1];
2468 SQL_QuoteString(g_hDb, szUName, szName, MAX_NAME_LENGTH*2+1);
2469 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2470 {
2471 Format(szQuery, 512, sql_updateLj, szName, g_js_fPersonal_Lj_Record[client], g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client], g_js_Strafes_Final[client],g_js_Sync_Final[client],g_flastHeight[client], szSteamId);
2472 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2473 }
2474 else
2475 {
2476 Format(szQuery, 512, sql_insertPlayerJumpLj, szSteamId, szName, g_js_fPersonal_Lj_Record[client], g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client], g_js_Strafes_Final[client],g_js_Sync_Final[client],g_flastHeight[client]);
2477 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2478 }
2479 db_viewLjRecord2(client);
2480 }
2481}
2482
2483public SQL_viewBhop2RecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
2484{
2485 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2486 {
2487 decl String:szName[MAX_NAME_LENGTH];
2488 new rank = SQL_GetRowCount(hndl);
2489 new Handle:pack = data;
2490 ResetPack(pack);
2491 new client = ReadPackCell(pack);
2492 ReadPackString(pack, szName, MAX_NAME_LENGTH);
2493 CloseHandle(pack);
2494 if (rank < 21 && rank < g_js_BhopRank[client])
2495 {
2496 g_js_BhopRank[client] = rank;
2497 for(new i = 1; i <= GetMaxClients(); i++)
2498 {
2499 if(IsValidClient(i) && !IsFakeClient(i))
2500 {
2501 PrintToChat(i, "%t", "Jumpstats_BhopTop", MOSSGREEN, WHITE, YELLOW, szName, rank, g_js_fPersonal_Bhop_Record[client]);
2502 PrintToConsole(i, "[JS] %s is now #%i in the Bunnyhop Top 20! [%.3f units]", szName, rank, g_js_fPersonal_Bhop_Record[client]);
2503 }
2504 }
2505 }
2506 }
2507}
2508
2509public SQL_viewDropBhop2RecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
2510{
2511 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2512 {
2513 decl String:szName[MAX_NAME_LENGTH];
2514 new rank = SQL_GetRowCount(hndl);
2515 new Handle:pack = data;
2516 ResetPack(pack);
2517 new client = ReadPackCell(pack);
2518 ReadPackString(pack, szName, MAX_NAME_LENGTH);
2519 CloseHandle(pack);
2520 if (rank < 21 && rank < g_js_DropBhopRank[client])
2521 {
2522 g_js_DropBhopRank[client] = rank;
2523 for(new i = 1; i <= GetMaxClients(); i++)
2524 {
2525 if(IsValidClient(i) && !IsFakeClient(i))
2526 {
2527 PrintToChat(i, "%t", "Jumpstats_DropBhopTop", MOSSGREEN, WHITE, YELLOW, szName, rank, g_js_fPersonal_DropBhop_Record[client]);
2528 PrintToConsole(i, "[JS] %s is now #%i in the Drop-Bunnyhop Top 20! [%.3f units]", szName, rank, g_js_fPersonal_DropBhop_Record[client]);
2529 }
2530 }
2531 }
2532 }
2533}
2534
2535public db_viewMultiBhopRecord2(client)
2536{
2537 decl String:szQuery[512];
2538 decl String:szSteamId[32];
2539 if (IsValidClient(client))
2540 GetClientAuthString(client, szSteamId, 32);
2541 else
2542 return;
2543 Format(szQuery, 512, sql_selectPlayerJumpMultiBhop, szSteamId);
2544 SQL_TQuery(g_hDb, SQL_viewMultiBhop2RecordCallback, szQuery, client,DBPrio_Low);
2545}
2546
2547public SQL_viewMultiBhop2RecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2548{
2549 new client = data;
2550 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2551 {
2552 decl String:szQuery[512];
2553 decl String:szName[MAX_NAME_LENGTH];
2554 decl String:szSteamId[32];
2555 SQL_FetchString(hndl, 0, szSteamId, MAX_NAME_LENGTH);
2556 SQL_FetchString(hndl, 1, szName, MAX_NAME_LENGTH);
2557 new Handle:pack = CreateDataPack();
2558 WritePackCell(pack, client);
2559 WritePackString(pack, szName);
2560 Format(szQuery, 512, sql_selectPlayerRankMultiBhop, szSteamId);
2561 SQL_TQuery(g_hDb, SQL_viewMultiBhop2RecordCallback2, szQuery, pack,DBPrio_Low);
2562 }
2563}
2564
2565public SQL_viewMultiBhop2RecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
2566{
2567 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2568 {
2569 decl String:szName[MAX_NAME_LENGTH];
2570 new rank = SQL_GetRowCount(hndl);
2571 new Handle:pack = data;
2572 ResetPack(pack);
2573 new client = ReadPackCell(pack);
2574 ReadPackString(pack, szName, MAX_NAME_LENGTH);
2575 CloseHandle(pack);
2576 if (rank < 21 && rank < g_js_MultiBhopRank[client])
2577 {
2578 g_js_MultiBhopRank[client] = rank;
2579 for(new i = 1; i <= GetMaxClients(); i++)
2580 {
2581 if(IsValidClient(i) && !IsFakeClient(i))
2582 {
2583 PrintToChat(i, "%t", "Jumpstats_MultiBhopTop", MOSSGREEN, WHITE, YELLOW, szName, rank, g_js_fPersonal_MultiBhop_Record[client]);
2584 PrintToConsole(i, "[JS] %s is now #%i in the Multi-Bunnyhop Top 20! [%.3f units]", szName, rank, g_js_fPersonal_MultiBhop_Record[client]);
2585 }
2586 }
2587 }
2588 }
2589}
2590
2591public db_viewLjRecord2(client)
2592{
2593 decl String:szQuery[512];
2594 decl String:szSteamId[32];
2595 if (IsValidClient(client))
2596 GetClientAuthString(client, szSteamId, 32);
2597 else
2598 return;
2599 Format(szQuery, 512, sql_selectPlayerJumpLJ, szSteamId);
2600 SQL_TQuery(g_hDb, SQL_viewLj2RecordCallback, szQuery, client,DBPrio_Low);
2601}
2602
2603public db_viewLjBlockRecord2(client)
2604{
2605 decl String:szQuery[512];
2606 decl String:szSteamId[32];
2607 if (IsValidClient(client))
2608 GetClientAuthString(client, szSteamId, 32);
2609 else
2610 return;
2611 Format(szQuery, 512, sql_selectPlayerJumpLJBlock, szSteamId);
2612 SQL_TQuery(g_hDb, SQL_viewLjBlock2RecordCallback, szQuery, client,DBPrio_Low);
2613}
2614
2615public SQL_viewLjBlock2RecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2616{
2617 new client = data;
2618 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2619 {
2620 decl String:szQuery[512];
2621 decl String:szName[MAX_NAME_LENGTH];
2622 decl String:szSteamId[32];
2623 SQL_FetchString(hndl, 0, szSteamId, MAX_NAME_LENGTH);
2624 SQL_FetchString(hndl, 1, szName, MAX_NAME_LENGTH);
2625 new Handle:pack = CreateDataPack();
2626 WritePackCell(pack, client);
2627 WritePackString(pack, szName);
2628 Format(szQuery, 512, sql_selectPlayerRankLjBlock, szSteamId);
2629 SQL_TQuery(g_hDb, SQL_viewLjBlock2RecordCallback2, szQuery, pack,DBPrio_Low);
2630 }
2631}
2632
2633
2634public SQL_viewLj2RecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2635{
2636 new client = data;
2637 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2638 {
2639 decl String:szQuery[512];
2640 decl String:szName[MAX_NAME_LENGTH];
2641 decl String:szSteamId[32];
2642 SQL_FetchString(hndl, 0, szSteamId, MAX_NAME_LENGTH);
2643 SQL_FetchString(hndl, 1, szName, MAX_NAME_LENGTH);
2644 new Handle:pack = CreateDataPack();
2645 WritePackCell(pack, client);
2646 WritePackString(pack, szName);
2647 Format(szQuery, 512, sql_selectPlayerRankLj, szSteamId);
2648 SQL_TQuery(g_hDb, SQL_viewLj2RecordCallback2, szQuery, pack,DBPrio_Low);
2649 }
2650}
2651
2652public SQL_viewLjBlock2RecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
2653{
2654 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2655 {
2656 decl String:szName[MAX_NAME_LENGTH];
2657 new rank = SQL_GetRowCount(hndl);
2658 new Handle:pack = data;
2659 ResetPack(pack);
2660 new client = ReadPackCell(pack);
2661 ReadPackString(pack, szName, MAX_NAME_LENGTH);
2662 CloseHandle(pack);
2663
2664 if (rank < 21 && rank < g_js_LjBlockRank[client])
2665 {
2666 g_js_LjBlockRank[client] = rank;
2667 for(new i = 1; i <= GetMaxClients(); i++)
2668 {
2669 if(IsValidClient(i) && !IsFakeClient(i))
2670 {
2671 PrintToChat(i, "%t", "Jumpstats_LjBlockTop", MOSSGREEN, WHITE, YELLOW, szName, rank, g_js_Personal_LjBlock_Record[client],g_js_fPersonal_LjBlockRecord_Dist[client]);
2672 PrintToConsole(i, "[JS] %s is now #%i in the Longjump 20! [%i units block/%.3f units jump]", szName, rank, g_js_Personal_LjBlock_Record[client],g_js_fPersonal_LjBlockRecord_Dist[client]);
2673 }
2674 }
2675 }
2676 }
2677}
2678
2679public SQL_viewLj2RecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
2680{
2681 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2682 {
2683 decl String:szName[MAX_NAME_LENGTH];
2684 new rank = SQL_GetRowCount(hndl);
2685 new Handle:pack = data;
2686 ResetPack(pack);
2687 new client = ReadPackCell(pack);
2688 ReadPackString(pack, szName, MAX_NAME_LENGTH);
2689 CloseHandle(pack);
2690
2691 if (rank < 21 && rank < g_js_LjRank[client])
2692 {
2693 g_js_LjRank[client] = rank;
2694 for(new i = 1; i <= GetMaxClients(); i++)
2695 {
2696 if(IsValidClient(i) && !IsFakeClient(i))
2697 {
2698 PrintToChat(i, "%t", "Jumpstats_LjTop", MOSSGREEN, WHITE, YELLOW, szName, rank, g_js_fPersonal_Lj_Record[client]);
2699 PrintToConsole(i, "[JS] %s is now #%i in the Longjump 20! [%.3f units]", szName, rank, g_js_fPersonal_Lj_Record[client]);
2700 }
2701 }
2702 }
2703 }
2704}
2705
2706public db_viewWjRecord2(client)
2707{
2708 decl String:szQuery[512];
2709 decl String:szSteamId[32];
2710 if (IsValidClient(client))
2711 GetClientAuthString(client, szSteamId, 32);
2712 else
2713 return;
2714 Format(szQuery, 512, sql_selectPlayerJumpWJ, szSteamId);
2715 SQL_TQuery(g_hDb, SQL_viewWj2RecordCallback, szQuery, client,DBPrio_Low);
2716}
2717
2718public SQL_viewWj2RecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2719{
2720 new client = data;
2721 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2722 {
2723 decl String:szQuery[512];
2724 decl String:szName[MAX_NAME_LENGTH];
2725 decl String:szSteamId[32];
2726 SQL_FetchString(hndl, 0, szSteamId, MAX_NAME_LENGTH);
2727 SQL_FetchString(hndl, 1, szName, MAX_NAME_LENGTH);
2728 new Handle:pack = CreateDataPack();
2729 WritePackCell(pack, client);
2730 WritePackString(pack, szName);
2731 Format(szQuery, 512, sql_selectPlayerRankWJ, szSteamId);
2732 SQL_TQuery(g_hDb, SQL_viewWj2RecordCallback2, szQuery, pack,DBPrio_Low);
2733 }
2734}
2735
2736public SQL_viewWj2RecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
2737{
2738 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2739 {
2740 decl String:szName[MAX_NAME_LENGTH];
2741 new rank = SQL_GetRowCount(hndl);
2742 new Handle:pack = data;
2743 ResetPack(pack);
2744 new client = ReadPackCell(pack);
2745 ReadPackString(pack, szName, MAX_NAME_LENGTH);
2746 CloseHandle(pack);
2747
2748 if (rank < 21 && rank < g_js_WjRank[client])
2749 {
2750 g_js_WjRank[client] = rank;
2751 for(new i = 1; i <= GetMaxClients(); i++)
2752 {
2753 if(IsValidClient(i) && !IsFakeClient(i))
2754 {
2755 PrintToChat(i, "%t", "Jumpstats_WjTop", MOSSGREEN, WHITE, YELLOW, szName, rank, g_js_fPersonal_Wj_Record[client]);
2756 PrintToConsole(i, "[JS] %s is now #%i in the Weirdjump 20! [%.3f units]", szName, rank, g_js_fPersonal_Wj_Record[client]);
2757 }
2758 }
2759 }
2760 }
2761}
2762
2763public SQL_UpdateLjBlockRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2764{
2765 new client = data;
2766 if (IsValidClient(client))
2767 {
2768 decl String:szQuery[512];
2769 decl String:szUName[MAX_NAME_LENGTH];
2770 GetClientName(client, szUName, MAX_NAME_LENGTH);
2771 decl String:szSteamId[32];
2772 GetClientAuthString(client, szSteamId, 32);
2773 decl String:szName[MAX_NAME_LENGTH*2+1];
2774 SQL_QuoteString(g_hDb, szUName, szName, MAX_NAME_LENGTH*2+1);
2775 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2776 {
2777 Format(szQuery, 512, sql_updateLjBlock, szName, g_js_Personal_LjBlock_Record[client], g_js_fPersonal_LjBlockRecord_Dist[client], g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client], g_js_Strafes_Final[client],g_js_Sync_Final[client],g_flastHeight[client], szSteamId);
2778 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2779 }
2780 else
2781 {
2782 Format(szQuery, 512, sql_insertPlayerJumpLjBlock , szSteamId, szName, g_js_Personal_LjBlock_Record[client], g_js_fPersonal_LjBlockRecord_Dist[client], g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client], g_js_Strafes_Final[client],g_js_Sync_Final[client],g_flastHeight[client]);
2783 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2784 }
2785 db_viewLjBlockRecord2(client);
2786 }
2787}
2788
2789public SQL_UpdateWjRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2790{
2791 new client = data;
2792 if (IsValidClient(client))
2793 {
2794 decl String:szQuery[512];
2795 decl String:szUName[MAX_NAME_LENGTH];
2796 GetClientName(client, szUName, MAX_NAME_LENGTH);
2797 decl String:szSteamId[32];
2798 GetClientAuthString(client, szSteamId, 32);
2799 decl String:szName[MAX_NAME_LENGTH*2+1];
2800 SQL_QuoteString(g_hDb, szUName, szName, MAX_NAME_LENGTH*2+1);
2801 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2802 {
2803 Format(szQuery, 512, sql_updateWJ, szName, g_js_fPersonal_Wj_Record[client], g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client], g_js_Strafes_Final[client],g_js_Sync_Final[client],g_flastHeight[client], szSteamId);
2804 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2805 }
2806 else
2807 {
2808 Format(szQuery, 512, sql_insertPlayerJumpWJ, szSteamId, szName, g_js_fPersonal_Wj_Record[client], g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client], g_js_Strafes_Final[client],g_js_Sync_Final[client],g_flastHeight[client]);
2809 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2810 }
2811 }
2812 db_viewWjRecord2(client);
2813}
2814
2815public SQL_UpdateDropBhopRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2816{
2817 new client = data;
2818 if (IsValidClient(client))
2819 {
2820 decl String:szQuery[512];
2821 decl String:szUName[MAX_NAME_LENGTH];
2822 GetClientName(client, szUName, MAX_NAME_LENGTH);
2823 decl String:szName[MAX_NAME_LENGTH*2+1];
2824 decl String:szSteamId[32];
2825 GetClientAuthString(client, szSteamId, 32);
2826 SQL_QuoteString(g_hDb, szUName, szName, MAX_NAME_LENGTH*2+1);
2827 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2828 {
2829 Format(szQuery, 512, sql_updateDropBhop, szName, g_js_fPersonal_DropBhop_Record[client], g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client], g_js_Strafes_Final[client],g_js_Sync_Final[client],g_flastHeight[client], szSteamId);
2830 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2831 }
2832 else
2833 {
2834 Format(szQuery, 512, sql_insertPlayerJumpDropBhop, szSteamId, szName, g_js_fPersonal_DropBhop_Record[client], g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client], g_js_Strafes_Final[client],g_js_Sync_Final[client],g_flastHeight[client]);
2835 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2836 }
2837 }
2838 db_viewDropBhopRecord2(client);
2839}
2840
2841public db_viewDropBhopRecord2(client)
2842{
2843 decl String:szQuery[512];
2844 decl String:szSteamId[32];
2845 if (IsValidClient(client))
2846 GetClientAuthString(client, szSteamId, 32);
2847 else
2848 return;
2849 Format(szQuery, 512, sql_selectPlayerJumpDropBhop, szSteamId);
2850 SQL_TQuery(g_hDb, SQL_viewDropBhop2RecordCallback, szQuery, client,DBPrio_Low);
2851}
2852
2853public SQL_viewDropBhop2RecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2854{
2855 new client = data;
2856 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2857 {
2858 decl String:szQuery[512];
2859 decl String:szName[MAX_NAME_LENGTH];
2860 decl String:szSteamId[32];
2861 SQL_FetchString(hndl, 0, szSteamId, 32);
2862 SQL_FetchString(hndl, 1, szName, MAX_NAME_LENGTH);
2863 new Handle:pack = CreateDataPack();
2864 WritePackCell(pack, client);
2865 WritePackString(pack, szName);
2866 Format(szQuery, 512, sql_selectPlayerRankDropBhop, szSteamId);
2867 SQL_TQuery(g_hDb, SQL_viewDropBhop2RecordCallback2, szQuery, pack,DBPrio_Low);
2868 }
2869}
2870
2871public SQL_viewBhop2RecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2872{
2873 new client = data;
2874 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2875 {
2876 decl String:szQuery[512];
2877 decl String:szName[MAX_NAME_LENGTH];
2878 decl String:szSteamId[32];
2879 SQL_FetchString(hndl, 0, szSteamId, 32);
2880 SQL_FetchString(hndl, 1, szName, MAX_NAME_LENGTH);
2881 new Handle:pack = CreateDataPack();
2882 WritePackCell(pack, client);
2883 WritePackString(pack, szName);
2884 Format(szQuery, 512, sql_selectPlayerRankBhop, szSteamId);
2885 SQL_TQuery(g_hDb, SQL_viewBhop2RecordCallback2, szQuery, pack,DBPrio_Low);
2886 }
2887}
2888
2889public SQL_UpdateBhopRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2890{
2891 new client = data;
2892 if (IsValidClient(client))
2893 {
2894 decl String:szQuery[512];
2895 decl String:szUName[MAX_NAME_LENGTH];
2896 GetClientName(client, szUName, MAX_NAME_LENGTH);
2897 decl String:szName[MAX_NAME_LENGTH*2+1];
2898 decl String:szSteamId[32];
2899 GetClientAuthString(client, szSteamId, 32);
2900 SQL_QuoteString(g_hDb, szUName, szName, MAX_NAME_LENGTH*2+1);
2901 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2902 {
2903 Format(szQuery, 512, sql_updateBhop, szName, g_js_fPersonal_Bhop_Record[client], g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client], g_js_Strafes_Final[client],g_js_Sync_Final[client],g_flastHeight[client], szSteamId);
2904 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2905 }
2906 else
2907 {
2908 Format(szQuery, 512, sql_insertPlayerJumpBhop, szSteamId, szName, g_js_fPersonal_Bhop_Record[client], g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client], g_js_Strafes_Final[client],g_js_Sync_Final[client],g_flastHeight[client]);
2909 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2910 }
2911 db_viewBhopRecord2(client);
2912 }
2913}
2914
2915public db_viewBhopRecord2(client)
2916{
2917 decl String:szQuery[512];
2918 decl String:szSteamId[32];
2919 if (IsValidClient(client))
2920 GetClientAuthString(client, szSteamId, 32);
2921 else
2922 return;
2923 Format(szQuery, 512, sql_selectPlayerJumpBhop, szSteamId);
2924 SQL_TQuery(g_hDb, SQL_viewBhop2RecordCallback, szQuery, client,DBPrio_Low);
2925}
2926
2927
2928public SQL_UpdateMultiBhopRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2929{
2930 new client = data;
2931 if (IsValidClient(client))
2932 {
2933 decl String:szQuery[512];
2934 decl String:szUName[MAX_NAME_LENGTH];
2935 GetClientName(client, szUName, MAX_NAME_LENGTH);
2936 decl String:szName[MAX_NAME_LENGTH*2+1];
2937 decl String:szSteamId[32];
2938 if (IsValidClient(client))
2939 GetClientAuthString(client, szSteamId, 32);
2940 else
2941 return;
2942 SQL_QuoteString(g_hDb, szUName, szName, MAX_NAME_LENGTH*2+1);
2943 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2944 {
2945 Format(szQuery, 512, sql_updateMultiBhop, szName, g_js_fPersonal_MultiBhop_Record[client], g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client], g_js_Strafes_Final[client],g_js_MultiBhop_Count[client],g_js_Sync_Final[client],g_flastHeight[client], szSteamId);
2946 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2947 }
2948 else
2949 {
2950 Format(szQuery, 512, sql_insertPlayerJumpMultiBhop, szSteamId, szName, g_js_fPersonal_MultiBhop_Record[client], g_js_fPreStrafe[client], g_js_fMax_Speed_Final[client], g_js_Strafes_Final[client],g_js_MultiBhop_Count[client],g_js_Sync_Final[client],g_flastHeight[client]);
2951 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2952 }
2953 db_viewMultiBhopRecord2(client);
2954 }
2955}
2956
2957public db_selectTopLj(client)
2958{
2959 decl String:szQuery[1024];
2960 Format(szQuery, 1024, sql_selectPlayerJumpTopLJ);
2961 SQL_TQuery(g_hDb, sql_selectPlayerJumpTopLJCallback, szQuery, client,DBPrio_Low);
2962}
2963
2964public db_selectTopLjBlock(client)
2965{
2966 decl String:szQuery[1024];
2967 Format(szQuery, 1024, sql_selectPlayerJumpTopLJBlock);
2968 SQL_TQuery(g_hDb, sql_selectPlayerJumpTopLJBlockCallback, szQuery, client,DBPrio_Low);
2969}
2970
2971public db_selectTopWj(client)
2972{
2973 decl String:szQuery[1024];
2974 Format(szQuery, 1024, sql_selectPlayerJumpTopWJ);
2975 SQL_TQuery(g_hDb, sql_selectPlayerJumpTopWJCallback, szQuery, client,DBPrio_Low);
2976}
2977
2978public db_selectTopBhop(client)
2979{
2980 decl String:szQuery[1024];
2981 Format(szQuery, 1024, sql_selectPlayerJumpTopBhop);
2982 SQL_TQuery(g_hDb, sql_selectPlayerJumpTopBhopCallback, szQuery, client,DBPrio_Low);
2983}
2984
2985public db_selectTopDropBhop(client)
2986{
2987 decl String:szQuery[1024];
2988 Format(szQuery, 1024, sql_selectPlayerJumpTopDropBhop);
2989 SQL_TQuery(g_hDb, sql_selectPlayerJumpTopDropBhopCallback, szQuery, client,DBPrio_Low);
2990}
2991
2992
2993public db_selectTopMultiBhop(client)
2994{
2995 decl String:szQuery[1024];
2996 Format(szQuery, 1024, sql_selectPlayerJumpTopMultiBhop);
2997 SQL_TQuery(g_hDb, sql_selectPlayerJumpTopMultiBhopCallback, szQuery, client,DBPrio_Low);
2998}
2999
3000public sql_selectPlayerJumpTopLJBlockCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3001{
3002 new client = data;
3003 decl String:szValue[128];
3004 decl String:szName[64];
3005 decl String:szSteamID[32];
3006 new ljblock;
3007 new Float:ljrecord;
3008 new String:szStrafes[32];
3009 new strafes;
3010 new Handle:menu = CreateMenu(LjBlockJumpMenuHandler1);
3011 SetMenuTitle(menu, "Top 20 Block Longjump\n Rank Block Distance Strafes Player");
3012 SetMenuPagination(menu, 5);
3013 if(SQL_HasResultSet(hndl))
3014 {
3015 new i = 1;
3016 while (SQL_FetchRow(hndl))
3017 {
3018 SQL_FetchString(hndl, 0, szName, 64);
3019 ljblock = SQL_FetchInt(hndl, 1);
3020 ljrecord = SQL_FetchFloat(hndl, 2);
3021 strafes = SQL_FetchInt(hndl, 3);
3022 SQL_FetchString(hndl, 4, szSteamID, 32);
3023 if (strafes < 10)
3024 Format(szStrafes, 32, " %i ", strafes);
3025 else
3026 Format(szStrafes, 32, "%i", strafes);
3027 if (i < 10)
3028 Format(szValue, 128, "[0%i.] %i %.3f units %s » %s", i, ljblock,ljrecord,szStrafes, szName);
3029 else
3030 Format(szValue, 128, "[%i.] %i %.3f units %s » %s", i, ljblock,ljrecord,szStrafes, szName);
3031 AddMenuItem(menu, szSteamID, szValue, ITEMDRAW_DEFAULT);
3032 i++;
3033 }
3034 }
3035 SetMenuOptionFlags(menu, MENUFLAG_BUTTON_EXIT);
3036 DisplayMenu(menu, client, MENU_TIME_FOREVER);
3037}
3038
3039
3040public sql_selectPlayerJumpTopLJCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3041{
3042 new client = data;
3043 decl String:szValue[128];
3044 decl String:szName[64];
3045 decl String:szSteamID[32];
3046 new Float:ljrecord;
3047 new String:szStrafes[32];
3048 new strafes;
3049 new Handle:menu = CreateMenu(LjJumpMenuHandler1);
3050 SetMenuTitle(menu, "Top 20 Longjump\n Rank Distance Strafes Player");
3051 SetMenuPagination(menu, 5);
3052 if(SQL_HasResultSet(hndl))
3053 {
3054 new i = 1;
3055 while (SQL_FetchRow(hndl))
3056 {
3057 SQL_FetchString(hndl, 0, szName, 64);
3058 ljrecord = SQL_FetchFloat(hndl, 1);
3059 strafes = SQL_FetchInt(hndl, 2);
3060 SQL_FetchString(hndl, 3, szSteamID, 32);
3061 if (strafes < 10)
3062 Format(szStrafes, 32, " %i ", strafes);
3063 else
3064 Format(szStrafes, 32, "%i", strafes);
3065 if (i < 10)
3066 Format(szValue, 128, "[0%i.] %.3f units %s » %s", i, ljrecord,szStrafes, szName);
3067 else
3068 Format(szValue, 128, "[%i.] %.3f units %s » %s", i, ljrecord,szStrafes, szName);
3069 AddMenuItem(menu, szSteamID, szValue, ITEMDRAW_DEFAULT);
3070 i++;
3071 }
3072 }
3073 SetMenuOptionFlags(menu, MENUFLAG_BUTTON_EXIT);
3074 DisplayMenu(menu, client, MENU_TIME_FOREVER);
3075}
3076
3077public sql_selectPlayerJumpTopWJCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3078{
3079 new client = data;
3080 decl String:szValue[128];
3081 decl String:szName[64];
3082 new Float:ljrecord;
3083 new String:szStrafes[32];
3084 decl String:szSteamID[32];
3085 new strafes;
3086 new Handle:menu = CreateMenu(WjJumpMenuHandler1);
3087 SetMenuTitle(menu, "Top 20 Weirdjump\n Rank Distance Strafes Player");
3088 SetMenuPagination(menu, 5);
3089 if(SQL_HasResultSet(hndl))
3090 {
3091 new i = 1;
3092 while (SQL_FetchRow(hndl))
3093 {
3094 SQL_FetchString(hndl, 0, szName, 64);
3095 ljrecord = SQL_FetchFloat(hndl, 1);
3096 strafes = SQL_FetchInt(hndl, 2);
3097 SQL_FetchString(hndl, 3, szSteamID, 32);
3098 if (strafes < 10)
3099 Format(szStrafes, 32, " %i ", strafes);
3100 else
3101 Format(szStrafes, 32, "%i", strafes);
3102 if (i < 10)
3103 Format(szValue, 128, "[0%i.] %.3f units %s » %s", i, ljrecord,szStrafes, szName);
3104 else
3105 Format(szValue, 128, "[%i.] %.3f units %s » %s", i, ljrecord,szStrafes, szName);
3106 AddMenuItem(menu, szSteamID, szValue, ITEMDRAW_DEFAULT);
3107 i++;
3108 }
3109 }
3110 SetMenuOptionFlags(menu, MENUFLAG_BUTTON_EXIT);
3111 DisplayMenu(menu, client, MENU_TIME_FOREVER);
3112}
3113
3114public sql_selectPlayerJumpTopBhopCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3115{
3116 new client = data;
3117 decl String:szValue[128];
3118 decl String:szName[64];
3119 new Float:bhoprecord;
3120 decl String:szSteamID[32];
3121 new String:szStrafes[32];
3122 new strafes;
3123 new Handle:menu = CreateMenu(BhopJumpMenuHandler1);
3124 SetMenuTitle(menu, "Top 20 Bunnyhop\n Rank Distance Strafes Player");
3125 SetMenuPagination(menu, 5);
3126 if(SQL_HasResultSet(hndl))
3127 {
3128 new i = 1;
3129 while (SQL_FetchRow(hndl))
3130 {
3131 SQL_FetchString(hndl, 0, szName, 64);
3132 bhoprecord = SQL_FetchFloat(hndl, 1);
3133 strafes = SQL_FetchInt(hndl, 2);
3134 SQL_FetchString(hndl, 3, szSteamID, 32);
3135 if (strafes < 10)
3136 Format(szStrafes, 32, " %i ", strafes);
3137 else
3138 Format(szStrafes, 32, "%i", strafes);
3139 if (i < 10)
3140 Format(szValue, 128, "[0%i.] %.3f units %s » %s", i, bhoprecord,szStrafes, szName);
3141 else
3142 Format(szValue, 128, "[%i.] %.3f units %s » %s", i, bhoprecord,szStrafes, szName);
3143 AddMenuItem(menu, szSteamID, szValue, ITEMDRAW_DEFAULT);
3144 i++;
3145 }
3146 }
3147 SetMenuOptionFlags(menu, MENUFLAG_BUTTON_EXIT);
3148 DisplayMenu(menu, client, MENU_TIME_FOREVER);
3149}
3150
3151public sql_selectPlayerJumpTopDropBhopCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3152{
3153 new client = data;
3154 decl String:szValue[128];
3155 decl String:szName[64];
3156 new Float:bhoprecord;
3157 decl String:szSteamID[32];
3158 new String:szStrafes[32];
3159 new strafes;
3160 new Handle:menu = CreateMenu(DropBhopJumpMenuHandler1);
3161 SetMenuTitle(menu, "Top 20 Drop-Bunnyhop\n Rank Distance Strafes Player");
3162 SetMenuPagination(menu, 5);
3163 if(SQL_HasResultSet(hndl))
3164 {
3165 new i = 1;
3166 while (SQL_FetchRow(hndl))
3167 {
3168 SQL_FetchString(hndl, 0, szName, 64);
3169 bhoprecord = SQL_FetchFloat(hndl, 1);
3170 strafes = SQL_FetchInt(hndl, 2);
3171 SQL_FetchString(hndl, 3, szSteamID, 32);
3172 if (strafes < 10)
3173 Format(szStrafes, 32, " %i ", strafes);
3174 else
3175 Format(szStrafes, 32, "%i", strafes);
3176 if (i < 10)
3177 Format(szValue, 128, "[0%i.] %.3f units %s » %s", i, bhoprecord,szStrafes, szName);
3178 else
3179 Format(szValue, 128, "[%i.] %.3f units %s » %s", i, bhoprecord,szStrafes, szName);
3180 AddMenuItem(menu, szSteamID, szValue, ITEMDRAW_DEFAULT);
3181 i++;
3182 }
3183 }
3184 SetMenuOptionFlags(menu, MENUFLAG_BUTTON_EXIT);
3185 DisplayMenu(menu, client, MENU_TIME_FOREVER);
3186}
3187
3188public sql_selectPlayerJumpTopMultiBhopCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3189{
3190 new client = data;
3191 decl String:szValue[128];
3192 decl String:szName[64];
3193 new Float:multibhoprecord;
3194 decl String:szSteamID[32];
3195 new String:szStrafes[32];
3196 new strafes;
3197 new Handle:menu = CreateMenu(MultiBhopJumpMenuHandler1);
3198 SetMenuTitle(menu, "Top 20 Multi-Bunnyhop\n Rank Distance Strafes Player");
3199 SetMenuPagination(menu, 5);
3200 if(SQL_HasResultSet(hndl))
3201 {
3202 new i = 1;
3203 while (SQL_FetchRow(hndl))
3204 {
3205 SQL_FetchString(hndl, 0, szName, 64);
3206 multibhoprecord = SQL_FetchFloat(hndl, 1);
3207 strafes = SQL_FetchInt(hndl, 2);
3208 SQL_FetchString(hndl, 3, szSteamID, 32);
3209 if (strafes < 10)
3210 Format(szStrafes, 32, " %i ", strafes);
3211 else
3212 Format(szStrafes, 32, "%i", strafes);
3213 if (i < 10)
3214 Format(szValue, 128, "[0%i.] %.3f units %s » %s", i, multibhoprecord,szStrafes, szName);
3215 else
3216 Format(szValue, 128, "[%i.] %.3f units %s » %s", i, multibhoprecord,szStrafes, szName);
3217 AddMenuItem(menu, szSteamID, szValue, ITEMDRAW_DEFAULT);
3218 i++;
3219 }
3220 }
3221 SetMenuOptionFlags(menu, MENUFLAG_BUTTON_EXIT);
3222 DisplayMenu(menu, client, MENU_TIME_FOREVER);
3223}
3224
3225public LjBlockJumpMenuHandler1(Handle:menu, MenuAction:action, param1, param2)
3226{
3227 if (action == MenuAction_Select)
3228 {
3229 JumpTopMenu(param1);
3230 }
3231 else if (action == MenuAction_End)
3232 {
3233 CloseHandle(menu);
3234 }
3235}
3236
3237public LjJumpMenuHandler1(Handle:menu, MenuAction:action, param1, param2)
3238{
3239 if (action == MenuAction_Select)
3240 {
3241 g_bdetailView[param1]=true;
3242 decl String:id[32];
3243 GetMenuItem(menu, param2, id, sizeof(id));
3244 db_viewJumpStats(param1, id);
3245 }
3246 else if (action == MenuAction_End)
3247 {
3248 CloseHandle(menu);
3249 }
3250}
3251public WjJumpMenuHandler1(Handle:menu, MenuAction:action, param1, param2)
3252{
3253 if (action == MenuAction_Select)
3254 {
3255 g_bdetailView[param1]=true;
3256 decl String:id[32];
3257 GetMenuItem(menu, param2, id, sizeof(id));
3258 db_viewJumpStats(param1, id);
3259 }
3260 else if (action == MenuAction_End)
3261 {
3262 CloseHandle(menu);
3263 }
3264}
3265public BhopJumpMenuHandler1(Handle:menu, MenuAction:action, param1, param2)
3266{
3267 if (action == MenuAction_Select)
3268 {
3269 g_bdetailView[param1]=true;
3270 decl String:id[32];
3271 GetMenuItem(menu, param2, id, sizeof(id));
3272 db_viewJumpStats(param1, id);
3273 }
3274 else if (action == MenuAction_End)
3275 {
3276 CloseHandle(menu);
3277 }
3278}
3279public DropBhopJumpMenuHandler1(Handle:menu, MenuAction:action, param1, param2)
3280{
3281 if (action == MenuAction_Select)
3282 {
3283 g_bdetailView[param1]=true;
3284 decl String:id[32];
3285 GetMenuItem(menu, param2, id, sizeof(id));
3286 db_viewJumpStats(param1, id);
3287 }
3288 else if (action == MenuAction_End)
3289 {
3290 CloseHandle(menu);
3291 }
3292}
3293
3294public MultiBhopJumpMenuHandler1(Handle:menu, MenuAction:action, param1, param2)
3295{
3296 if (action == MenuAction_Select)
3297 {
3298 g_bdetailView[param1]=true;
3299 decl String:id[32];
3300 GetMenuItem(menu, param2, id, sizeof(id));
3301 db_viewJumpStats(param1, id);
3302 }
3303 else if (action == MenuAction_End)
3304 {
3305 CloseHandle(menu);
3306 }
3307}
3308
3309public SQL_CheckCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3310{
3311}
3312
3313public db_viewJumpStats(client, String:szSteamId[32])
3314{
3315 decl String:szQuery[1024];
3316 Format(szQuery, 1024, sql_selectJumpStats, szSteamId);
3317 SQL_TQuery(g_hDb, SQL_ViewJumpStatsCallback, szQuery, client,DBPrio_Low);
3318}
3319
3320public SQL_ViewJumpStatsCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3321{
3322 new client = data;
3323 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3324 {
3325 decl String:szSteamId[32];
3326 decl String:szName[17];
3327 decl String:szVr[255];
3328
3329 //get the result
3330 SQL_FetchString(hndl, 0, szSteamId, MAX_NAME_LENGTH);
3331 SQL_FetchString(hndl, 1, szName, 17);
3332 new Float:bhoprecord = SQL_FetchFloat(hndl, 2);
3333 new Float:bhoppre = SQL_FetchFloat(hndl, 3);
3334 new Float:bhopmax = SQL_FetchFloat(hndl, 4);
3335 new bhopstrafes = SQL_FetchInt(hndl, 5);
3336 new bhopsync = SQL_FetchInt(hndl, 6);
3337 new Float:ljrecord = SQL_FetchFloat(hndl, 7);
3338 new Float:ljpre = SQL_FetchFloat(hndl, 8);
3339 new Float:ljmax = SQL_FetchFloat(hndl, 9);
3340 new ljstrafes = SQL_FetchInt(hndl, 10);
3341 new ljsync = SQL_FetchInt(hndl, 11);
3342 new Float:multibhoprecord = SQL_FetchFloat(hndl, 12);
3343 new Float:multibhoppre = SQL_FetchFloat(hndl, 13);
3344 new Float:multibhopmax = SQL_FetchFloat(hndl, 14);
3345 new multibhopstrafes = SQL_FetchInt(hndl, 15);
3346 new multibhopsync = SQL_FetchInt(hndl, 17);
3347 new Float:wjrecord = SQL_FetchFloat(hndl, 18);
3348 new Float:wjpre = SQL_FetchFloat(hndl, 19);
3349 new Float:wjmax = SQL_FetchFloat(hndl, 20);
3350 new wjstrafes = SQL_FetchInt(hndl, 21);
3351 new wjsync = SQL_FetchInt(hndl, 22);
3352 new Float:dropbhoprecord = SQL_FetchFloat(hndl, 23);
3353 new Float:dropbhoppre = SQL_FetchFloat(hndl, 24);
3354 new Float:dropbhopmax = SQL_FetchFloat(hndl, 25);
3355 new dropbhopstrafes = SQL_FetchInt(hndl, 26);
3356 new dropbhopsync = SQL_FetchInt(hndl, 27);
3357 new Float:ljheight = SQL_FetchFloat(hndl, 28);
3358 new Float:bhopheight = SQL_FetchFloat(hndl, 29);
3359 new Float:multibhopheight = SQL_FetchFloat(hndl, 30);
3360 new Float:dropbhopheight = SQL_FetchFloat(hndl, 31);
3361 new Float:wjheight = SQL_FetchFloat(hndl, 32);
3362 new ljblockdist = SQL_FetchInt(hndl, 33);
3363 new Float:ljblockrecord = SQL_FetchFloat(hndl, 34);
3364 new Float:ljblockpre = SQL_FetchFloat(hndl, 35);
3365 new Float:ljblockmax = SQL_FetchFloat(hndl, 36);
3366 new ljblockstrafes = SQL_FetchInt(hndl, 37);
3367 new ljblocksync = SQL_FetchInt(hndl, 38);
3368 new Float:ljblockheight = SQL_FetchFloat(hndl, 39);
3369
3370
3371 if (bhoprecord >0.0 || ljrecord > 0.0 || multibhoprecord > 0.0 || wjrecord > 0.0 || dropbhoprecord > 0.0 || ljblockdist > 0)
3372 {
3373 Format(szVr, 255, "JS: %s\nType Distance Strafes Pre Max Height Sync", szName);
3374 new Handle:menu = CreateMenu(JumpStatsMenuHandler);
3375 SetMenuTitle(menu, szVr);
3376 if (ljrecord > 0.0)
3377 {
3378 if (ljstrafes>9)
3379 Format(szVr, 255, "LJ: %.3f %i %.2f %.2f %.1f %i%c", ljrecord,ljstrafes,ljpre,ljmax,ljheight,ljsync,PERCENT);
3380 else
3381 Format(szVr, 255, "LJ: %.3f %i %.2f %.2f %.1f %i%c", ljrecord,ljstrafes,ljpre,ljmax,ljheight,ljsync,PERCENT);
3382 AddMenuItem(menu, szVr, szVr);
3383 }
3384 if (ljblockdist > 0)
3385 {
3386 if (ljstrafes>9)
3387 Format(szVr, 255, "BlockLJ: %i|%.1f %i %.2f %.2f %.1f %i%c", ljblockdist,ljblockrecord,ljblockstrafes,ljblockpre,ljblockmax,ljblockheight,ljblocksync,PERCENT);
3388 else
3389 Format(szVr, 255, "BlockLJ: %i|%.1f %i %.2f %.2f %.1f %i%c", ljblockdist,ljblockrecord,ljblockstrafes,ljblockpre,ljblockmax,ljblockheight,ljblocksync,PERCENT);
3390 AddMenuItem(menu, szVr, szVr);
3391 }
3392 if (bhoprecord > 0.0)
3393 {
3394 if (bhopstrafes>9)
3395 Format(szVr, 255, "Bhop: %.3f %i %.2f %.2f %.1f %i%c", bhoprecord,bhopstrafes,bhoppre,bhopmax,bhopheight,bhopsync,PERCENT);
3396 else
3397 Format(szVr, 255, "Bhop: %.3f %i %.2f %.2f %.1f %i%c", bhoprecord,bhopstrafes,bhoppre,bhopmax,bhopheight,bhopsync,PERCENT);
3398 AddMenuItem(menu, szVr, szVr);
3399 }
3400 if (dropbhoprecord > 0.0)
3401 {
3402 if (dropbhopstrafes>9)
3403 Format(szVr, 255, "DropBhop: %.3f %i %.2f %.2f %.1f %i%c", dropbhoprecord,dropbhopstrafes,dropbhoppre,dropbhopmax,dropbhopheight,dropbhopsync,PERCENT);
3404 else
3405 Format(szVr, 255, "DropBhop: %.3f %i %.2f %.2f %.1f %i%c", dropbhoprecord,dropbhopstrafes,dropbhoppre,dropbhopmax,dropbhopheight,dropbhopsync,PERCENT);
3406 AddMenuItem(menu, szVr, szVr);
3407 }
3408 if (multibhoprecord > 0.0)
3409 {
3410 if (multibhopstrafes>9)
3411 Format(szVr, 255, "MultiBhop: %.3f %i %.2f %.2f %.1f %i%c", multibhoprecord,multibhopstrafes,multibhoppre,multibhopmax,multibhopheight,multibhopsync,PERCENT);
3412 else
3413 Format(szVr, 255, "MultiBhop: %.3f %i %.2f %.2f %.1f %i%c", multibhoprecord,multibhopstrafes,multibhoppre,multibhopmax,multibhopheight,multibhopsync,PERCENT);
3414 AddMenuItem(menu, szVr, szVr);
3415 }
3416 if (wjrecord > 0.0)
3417 {
3418 if (wjstrafes>9)
3419 Format(szVr, 255, "WJ: %.3f %i %.2f %.2f %.1f %i%c", wjrecord,wjstrafes,wjpre,wjmax,wjheight,wjsync,PERCENT);
3420 else
3421 Format(szVr, 255, "WJ: %.3f %i %.2f %.2f %.1f %i%c", wjrecord,wjstrafes,wjpre,wjmax,wjheight,wjsync,PERCENT);
3422 AddMenuItem(menu, szVr, szVr);
3423 }
3424 //SetMenuPagination(menu, 5);
3425 SetMenuPagination(menu, MENU_NO_PAGINATION);
3426 SetMenuOptionFlags(menu, MENUFLAG_BUTTON_EXIT);
3427 DisplayMenu(menu, client, MENU_TIME_FOREVER);
3428 }
3429 else
3430 PrintToChat(client, "%t", "noJumpRecords",MOSSGREEN,WHITE);
3431
3432
3433 }
3434 else
3435 {
3436 PrintToChat(client, "%t", "noJumpRecords",MOSSGREEN,WHITE);
3437 }
3438}
3439
3440public JumpStatsMenuHandler(Handle:menu, MenuAction:action, param1,param2)
3441{
3442 if (action == MenuAction_Cancel || action == MenuAction_Select)
3443 {
3444 if (g_bdetailView[param1])
3445 {
3446 g_bdetailView[param1] = false;
3447 JumpTopMenu(param1);
3448 }
3449 }
3450}
3451
3452public db_viewPersonalLJRecord(client, String:szSteamId[32])
3453{
3454 decl String:szQuery[512];
3455 Format(szQuery, 512, sql_selectPlayerJumpLJ, szSteamId);
3456 SQL_TQuery(g_hDb, SQL_LJRecordCallback, szQuery, client,DBPrio_Low);
3457}
3458
3459public SQL_LJRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3460{
3461 new client = data;
3462 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3463 {
3464 g_js_fPersonal_Lj_Record[client] = SQL_FetchFloat(hndl, 2);
3465 if (g_js_fPersonal_Lj_Record[client] > -1.0)
3466 {
3467 decl String:szSteamId[32];
3468 decl String:szQuery[512];
3469 if (IsValidClient(client))
3470 {
3471 GetClientAuthString(client, szSteamId, 32);
3472 Format(szQuery, 255, sql_selectPlayerRankLj, szSteamId);
3473 SQL_TQuery(g_hDb, SQL_viewLjRecordCallback2, szQuery, client,DBPrio_Low);
3474 }
3475 }
3476 else
3477 {
3478 g_js_LjRank[client] = 99999999;
3479 g_js_fPersonal_Lj_Record[client] = -1.0;
3480 }
3481 }
3482 else
3483 {
3484 g_js_LjRank[client] = 99999999;
3485 g_js_fPersonal_Lj_Record[client] = -1.0;
3486 }
3487}
3488
3489public db_viewPersonalLJBlockRecord(client, String:szSteamId[32])
3490{
3491 decl String:szQuery[512];
3492 Format(szQuery, 512, sql_selectPlayerJumpLJBlock, szSteamId);
3493 SQL_TQuery(g_hDb, SQL_LJBlockRecordCallback, szQuery, client,DBPrio_Low);
3494}
3495
3496public db_viewPersonalBhopRecord(client, String:szSteamId[32])
3497{
3498 decl String:szQuery[512];
3499 Format(szQuery, 512, sql_selectPlayerJumpBhop, szSteamId);
3500 SQL_TQuery(g_hDb, SQL_ViewBhopRecordCallback, szQuery, client,DBPrio_Low);
3501}
3502
3503public db_viewPersonalDropBhopRecord(client, String:szSteamId[32])
3504{
3505 decl String:szQuery[512];
3506 Format(szQuery, 512, sql_selectPlayerJumpDropBhop, szSteamId);
3507 SQL_TQuery(g_hDb, SQL_ViewDropBhopRecordCallback, szQuery, client,DBPrio_Low);
3508}
3509
3510
3511public db_viewPersonalWeirdRecord(client, String:szSteamId[32])
3512{
3513 decl String:szQuery[512];
3514 Format(szQuery, 512, sql_selectPlayerJumpWJ, szSteamId);
3515 SQL_TQuery(g_hDb, SQL_ViewWeirdRecordCallback, szQuery, client,DBPrio_Low);
3516}
3517
3518stock FakePrecacheSound( const String:szPath[] )
3519{
3520 AddToStringTable( FindStringTable( "soundprecache" ), szPath );
3521}
3522
3523public db_viewPersonalMultiBhopRecord(client, String:szSteamId[32])
3524{
3525 decl String:szQuery[512];
3526 Format(szQuery, 512, sql_selectPlayerJumpMultiBhop, szSteamId);
3527 SQL_TQuery(g_hDb, SQL_ViewMultiBhopRecordCallback, szQuery, client,DBPrio_Low);
3528}
3529
3530public SQL_LJBlockRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3531{
3532 new client = data;
3533 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3534 {
3535 g_js_Personal_LjBlock_Record[client] = SQL_FetchInt(hndl, 2);
3536 g_js_fPersonal_LjBlockRecord_Dist[client] = SQL_FetchFloat(hndl, 3);
3537 if (g_js_Personal_LjBlock_Record[client] > -1)
3538 {
3539 decl String:szSteamId[32];
3540 decl String:szQuery[512];
3541 if (IsValidClient(client))
3542 {
3543 GetClientAuthString(client, szSteamId, 32);
3544 Format(szQuery, 255, sql_selectPlayerRankLjBlock, szSteamId);
3545 SQL_TQuery(g_hDb, SQL_viewLjBlockRecordCallback2, szQuery, client,DBPrio_Low);
3546 }
3547 }
3548 else
3549 {
3550 g_js_LjBlockRank[client] = 99999999;
3551 g_js_Personal_LjBlock_Record[client] = -1;
3552 g_js_fPersonal_LjBlockRecord_Dist[client] = -1.0;
3553 }
3554 }
3555 else
3556 {
3557 g_js_LjBlockRank[client] = 99999999;
3558 g_js_Personal_LjBlock_Record[client] = -1;
3559 g_js_fPersonal_LjBlockRecord_Dist[client] = -1.0;
3560 }
3561}
3562
3563public SQL_viewLjRecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
3564{
3565 new client = data;
3566 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3567 {
3568 g_js_LjRank[client]= SQL_GetRowCount(hndl);
3569 }
3570}
3571
3572public SQL_viewLjBlockRecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
3573{
3574 new client = data;
3575 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3576 {
3577 g_js_LjBlockRank[client]= SQL_GetRowCount(hndl);
3578 }
3579}
3580
3581public SQL_ViewBhopRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3582{
3583 new client = data;
3584 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3585 {
3586 g_js_fPersonal_Bhop_Record[client] = SQL_FetchFloat(hndl, 2);
3587 if (g_js_fPersonal_Bhop_Record[client] > -1.0)
3588 {
3589 decl String:szSteamId[32];
3590 decl String:szQuery[512];
3591 if (IsValidClient(client))
3592 {
3593 GetClientAuthString(client, szSteamId, 32);
3594 Format(szQuery, 255, sql_selectPlayerRankBhop, szSteamId);
3595 SQL_TQuery(g_hDb, SQL_viewBhopRecordCallback2, szQuery, client,DBPrio_Low);
3596 }
3597 }
3598 else
3599 {
3600 g_js_BhopRank[client] = 99999999;
3601 g_js_fPersonal_Bhop_Record[client] = -1.0;
3602 }
3603 }
3604 else
3605 {
3606 g_js_BhopRank[client] = 99999999;
3607 g_js_fPersonal_Bhop_Record[client] = -1.0;
3608 }
3609}
3610
3611public SQL_ViewDropBhopRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3612{
3613 new client = data;
3614 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3615 {
3616 g_js_fPersonal_DropBhop_Record[client] = SQL_FetchFloat(hndl, 2);
3617 if (g_js_fPersonal_DropBhop_Record[client] > -1.0)
3618 {
3619 decl String:szSteamId[32];
3620 decl String:szQuery[512];
3621
3622 if (IsValidClient(client))
3623 {
3624 GetClientAuthString(client, szSteamId, 32);
3625 Format(szQuery, 255, sql_selectPlayerRankDropBhop, szSteamId);
3626 SQL_TQuery(g_hDb, SQL_viewDropBhopRecordCallback2, szQuery, client,DBPrio_Low);
3627 }
3628
3629 }
3630 else
3631 {
3632 g_js_DropBhopRank[client] = 99999999;
3633 g_js_fPersonal_DropBhop_Record[client] = -1.0;
3634 }
3635 }
3636 else
3637 {
3638 g_js_DropBhopRank[client] = 99999999;
3639 g_js_fPersonal_DropBhop_Record[client] = -1.0;
3640 }
3641}
3642
3643public SQL_viewDropBhopRecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
3644{
3645 new client = data;
3646 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3647 g_js_DropBhopRank[client]= SQL_GetRowCount(hndl);
3648}
3649
3650public SQL_ViewWeirdRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3651{
3652 new client = data;
3653 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3654 {
3655 g_js_fPersonal_Wj_Record[client] = SQL_FetchFloat(hndl, 2);
3656 if (g_js_fPersonal_Wj_Record[client] > -1.0)
3657 {
3658 decl String:szSteamId[32];
3659 decl String:szQuery[512];
3660
3661 if (IsValidClient(client))
3662 {
3663 GetClientAuthString(client, szSteamId, 32);
3664 Format(szQuery, 255, sql_selectPlayerRankWJ, szSteamId);
3665 SQL_TQuery(g_hDb, SQL_viewWeirdRecordCallback2, szQuery, client,DBPrio_Low);
3666 }
3667
3668 }
3669 else
3670 {
3671 g_js_WjRank[client] = 99999999;
3672 g_js_fPersonal_Wj_Record[client] = -1.0;
3673 }
3674 }
3675 else
3676 {
3677 g_js_WjRank[client] = 99999999;
3678 g_js_fPersonal_Wj_Record[client] = -1.0;
3679 }
3680}
3681
3682public SQL_viewWeirdRecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
3683{
3684 new client = data;
3685 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3686 g_js_WjRank[client]= SQL_GetRowCount(hndl);
3687}
3688
3689public SQL_ViewMultiBhopRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3690{
3691 new client = data;
3692 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3693 {
3694 g_js_fPersonal_MultiBhop_Record[client] = SQL_FetchFloat(hndl, 2);
3695 if (g_js_fPersonal_MultiBhop_Record[client] > -1.0)
3696 {
3697 decl String:szSteamId[32];
3698 decl String:szQuery[512];
3699
3700 if (IsValidClient(client))
3701 {
3702 GetClientAuthString(client, szSteamId, 32);
3703 Format(szQuery, 255, sql_selectPlayerRankMultiBhop, szSteamId);
3704 SQL_TQuery(g_hDb, SQL_viewMultiBhopRecordCallback2, szQuery, client,DBPrio_Low);
3705 }
3706 }
3707 else
3708 {
3709 g_js_MultiBhopRank[client] = 99999999;
3710 g_js_fPersonal_MultiBhop_Record[client] = -1.0;
3711 }
3712 }
3713 else
3714 {
3715 g_js_MultiBhopRank[client] = 99999999;
3716 g_js_fPersonal_MultiBhop_Record[client] = -1.0;
3717 }
3718}
3719
3720public SQL_viewBhopRecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
3721{
3722 new client = data;
3723 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3724 g_js_BhopRank[client]= SQL_GetRowCount(hndl);
3725}
3726
3727public SQL_viewMultiBhopRecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
3728{
3729 new client = data;
3730 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3731 g_js_MultiBhopRank[client]= SQL_GetRowCount(hndl);
3732}
3733
3734//admin stuff
3735public Action:Admin_DropPlayerJump(client, args)
3736{
3737 db_dropPlayerJump(client);
3738 return Plugin_Handled;
3739}
3740
3741public Action:Admin_ResetAllLjRecords(client, args)
3742{
3743 decl String:szQuery[255];
3744 Format(szQuery, 255, "UPDATE playerjumpstats SET ljrecord=-1.0");
3745 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery);
3746 PrintToConsole(client, "lj records reseted.");
3747 for (new i = 1; i <= MaxClients; i++)
3748 {
3749 if (IsValidClient(i))
3750 {
3751 g_js_LjRank[i] = 99999999;
3752 g_js_fPersonal_Lj_Record[i] = -1.0;
3753 }
3754 }
3755 return Plugin_Handled;
3756}
3757
3758public Action:Admin_ResetAllWjRecords(client, args)
3759{
3760 decl String:szQuery[255];
3761 Format(szQuery, 255, "UPDATE playerjumpstats SET wjrecord=-1.0");
3762 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery);
3763 PrintToConsole(client, "wj records reseted.");
3764 for (new i = 1; i <= MaxClients; i++)
3765 {
3766 if (IsValidClient(i))
3767 {
3768 g_js_WjRank[i] = 99999999;
3769 g_js_fPersonal_Wj_Record[i] = -1.0;
3770 }
3771 }
3772 return Plugin_Handled;
3773}
3774
3775public Action:Admin_ResetAllBhopRecords(client, args)
3776{
3777 decl String:szQuery[255];
3778 Format(szQuery, 255, "UPDATE playerjumpstats SET bhoprecord=-1.0");
3779 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery);
3780 PrintToConsole(client, "bhop records reseted.");
3781 for (new i = 1; i <= MaxClients; i++)
3782 {
3783 if (IsValidClient(i))
3784 {
3785 g_js_BhopRank[i] = 99999999;
3786 g_js_fPersonal_Bhop_Record[i] = -1.0;
3787 }
3788 }
3789 return Plugin_Handled;
3790}
3791
3792public Action:Admin_ResetAllDropBhopRecords(client, args)
3793{
3794 decl String:szQuery[255];
3795 Format(szQuery, 255, "UPDATE playerjumpstats SET dropbhoprecord=-1.0");
3796 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery);
3797 PrintToConsole(client, "dropbhop records reseted.");
3798 for (new i = 1; i <= MaxClients; i++)
3799 {
3800 if (IsValidClient(i))
3801 {
3802 g_js_DropBhopRank[i] = 99999999;
3803 g_js_fPersonal_DropBhop_Record[i] = -1.0;
3804 }
3805 }
3806 return Plugin_Handled;
3807}
3808
3809public Action:Admin_ResetAllMultiBhopRecords(client, args)
3810{
3811 decl String:szQuery[255];
3812 Format(szQuery, 255, "UPDATE playerjumpstats SET multibhoprecord=-1.0");
3813 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery);
3814 PrintToConsole(client, "multibhop records reseted.");
3815 for (new i = 1; i <= MaxClients; i++)
3816 {
3817 if (IsValidClient(i))
3818 {
3819 g_js_MultiBhopRank[i] = 99999999;
3820 g_js_fPersonal_MultiBhop_Record[i] = -1.0;
3821 }
3822 }
3823 return Plugin_Handled;
3824}
3825
3826public Action:Admin_ResetAllLjBlockRecords(client, args)
3827{
3828 decl String:szQuery[255];
3829 Format(szQuery, 255, "UPDATE playerjumpstats SET ljblockdist=-1");
3830 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery);
3831 PrintToConsole(client, "ljblock records reseted.");
3832 for (new i = 1; i <= MaxClients; i++)
3833 {
3834 if (IsValidClient(i))
3835 {
3836 g_js_MultiBhopRank[i] = 99999999;
3837 g_js_fPersonal_MultiBhop_Record[i] = -1.0;
3838 }
3839 }
3840 return Plugin_Handled;
3841}
3842
3843public Action:Admin_ResetLjRecords(client, args)
3844{
3845 if(args == 0)
3846 {
3847 ReplyToCommand(client, "[KZ] Usage: sm_resetljrecord <steamid>");
3848 return Plugin_Handled;
3849 }
3850 if(args > 0)
3851 {
3852 decl String:szSteamID[128];
3853 decl String:szArg[128];
3854 Format(szSteamID, 128, "");
3855 for (new i = 1; i < 6; i++)
3856 {
3857 GetCmdArg(i, szArg, 128);
3858 if (!StrEqual(szArg, "", false))
3859 Format(szSteamID, 128, "%s%s", szSteamID, szArg);
3860 }
3861 db_resetPlayerLjRecord(client, szSteamID);
3862 }
3863 return Plugin_Handled;
3864}
3865
3866public Action:Admin_ResetLjBlockRecords(client, args)
3867{
3868 if(args == 0)
3869 {
3870 ReplyToCommand(client, "[KZ] Usage: sm_resetljblockrecord <steamid>");
3871 return Plugin_Handled;
3872 }
3873 if(args > 0)
3874 {
3875 decl String:szSteamID[128];
3876 decl String:szArg[128];
3877 Format(szSteamID, 128, "");
3878 for (new i = 1; i < 6; i++)
3879 {
3880 GetCmdArg(i, szArg, 128);
3881 if (!StrEqual(szArg, "", false))
3882 Format(szSteamID, 128, "%s%s", szSteamID, szArg);
3883 }
3884 db_resetPlayerLjBlockRecord(client, szSteamID);
3885 }
3886 return Plugin_Handled;
3887}
3888
3889public Action:Admin_ResetWjRecords(client, args)
3890{
3891 if(args == 0)
3892 {
3893 ReplyToCommand(client, "[KZ] Usage: sm_resetwjrecord <steamid>");
3894 return Plugin_Handled;
3895 }
3896 if(args > 0)
3897 {
3898 decl String:szSteamID[128];
3899 decl String:szArg[128];
3900 Format(szSteamID, 128, "");
3901 for (new i = 1; i < 6; i++)
3902 {
3903 GetCmdArg(i, szArg, 128);
3904 if (!StrEqual(szArg, "", false))
3905 Format(szSteamID, 128, "%s%s", szSteamID, szArg);
3906 }
3907 db_resetPlayerWJRecord(client, szSteamID);
3908 }
3909 return Plugin_Handled;
3910}
3911
3912public Action:Admin_ResetPlayerJumpstats(client, args)
3913{
3914 if(args == 0)
3915 {
3916 ReplyToCommand(client, "[KZ] Usage: sm_resetplayerjumpstats <steamid>");
3917 return Plugin_Handled;
3918 }
3919 if(args > 0)
3920 {
3921 decl String:szSteamID[128];
3922 decl String:szArg[128];
3923 Format(szSteamID, 128, "");
3924 for (new i = 1; i < 6; i++)
3925 {
3926 GetCmdArg(i, szArg, 128);
3927 if (!StrEqual(szArg, "", false))
3928 Format(szSteamID, 128, "%s%s", szSteamID, szArg);
3929 }
3930 db_resetPlayerJumpstats(client, szSteamID);
3931 }
3932 return Plugin_Handled;
3933}
3934
3935public Action:Admin_ResetDropBhopRecords(client, args)
3936{
3937 if(args == 0)
3938 {
3939 ReplyToCommand(client, "[KZ] Usage: sm_resetdropbhoprecord <steamid>");
3940 return Plugin_Handled;
3941 }
3942 if(args > 0)
3943 {
3944 decl String:szSteamID[128];
3945 decl String:szArg[128];
3946 Format(szSteamID, 128, "");
3947 for (new i = 1; i < 6; i++)
3948 {
3949 GetCmdArg(i, szArg, 128);
3950 if (!StrEqual(szArg, "", false))
3951 Format(szSteamID, 128, "%s%s", szSteamID, szArg);
3952 }
3953 db_resetPlayerDropBhopRecord(client, szSteamID);
3954 }
3955 return Plugin_Handled;
3956}
3957
3958
3959public Action:Admin_ResetBhopRecords(client, args)
3960{
3961 if(args == 0)
3962 {
3963 ReplyToCommand(client, "[KZ] Usage: sm_resetbhoprecord <steamid>");
3964 return Plugin_Handled;
3965 }
3966 if(args > 0)
3967 {
3968 decl String:szSteamID[128];
3969 decl String:szArg[128];
3970 Format(szSteamID, 128, "");
3971 for (new i = 1; i < 6; i++)
3972 {
3973 GetCmdArg(i, szArg, 128);
3974 if (!StrEqual(szArg, "", false))
3975 Format(szSteamID, 128, "%s%s", szSteamID, szArg);
3976 }
3977 db_resetPlayerBhopRecord(client, szSteamID);
3978 }
3979 return Plugin_Handled;
3980}
3981
3982public Action:Admin_ResetMultiBhopRecords(client, args)
3983{
3984 if(args == 0)
3985 {
3986 ReplyToCommand(client, "[KZ] Usage: sm_resetmultibhoprecord <steamid>");
3987 return Plugin_Handled;
3988 }
3989 if(args > 0)
3990 {
3991 decl String:szSteamID[128];
3992 decl String:szArg[128];
3993 Format(szSteamID, 128, "");
3994 for (new i = 1; i < 6; i++)
3995 {
3996 GetCmdArg(i, szArg, 128);
3997 if (!StrEqual(szArg, "", false))
3998 Format(szSteamID, 128, "%s%s", szSteamID, szArg);
3999 }
4000 db_resetPlayerMultiBhopRecord(client, szSteamID);
4001 }
4002 return Plugin_Handled;
4003}
4004
4005
4006public db_resetPlayerBhopRecord(client, String:steamid[128])
4007{
4008 decl String:szQuery[255];
4009 decl String:szsteamid[128*2+1];
4010 SQL_QuoteString(g_hDb, steamid, szsteamid, 128*2+1);
4011 Format(szQuery, 255, sql_resetBhopRecord, szsteamid);
4012 new Handle:pack = CreateDataPack();
4013 WritePackCell(pack, client);
4014 WritePackString(pack, steamid);
4015 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery, pack);
4016 PrintToConsole(client, "bhop record cleared (%s).", szsteamid);
4017 for (new i = 1; i <= MaxClients; i++)
4018 {
4019 if (IsValidClient(i))
4020 {
4021 decl String:szSteamId2[32];
4022 GetClientAuthString(i, szSteamId2, 32);
4023 if(StrEqual(szSteamId2,szsteamid))
4024 {
4025 g_js_BhopRank[i] = 99999999;
4026 g_js_fPersonal_Bhop_Record[i] = -1.0;
4027 }
4028 }
4029 }
4030}
4031
4032public db_resetPlayerDropBhopRecord(client, String:steamid[128])
4033{
4034 decl String:szQuery[255];
4035 decl String:szsteamid[128*2+1];
4036 SQL_QuoteString(g_hDb, steamid, szsteamid, 128*2+1);
4037 Format(szQuery, 255, sql_resetDropBhopRecord, szsteamid);
4038 new Handle:pack = CreateDataPack();
4039 WritePackCell(pack, client);
4040 WritePackString(pack, steamid);
4041 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery, pack);
4042 PrintToConsole(client, "dropbhop record cleared (%s).", szsteamid);
4043 for (new i = 1; i <= MaxClients; i++)
4044 {
4045 if (IsValidClient(i))
4046 {
4047 decl String:szSteamId2[32];
4048 GetClientAuthString(i, szSteamId2, 32);
4049 if(StrEqual(szSteamId2,szsteamid))
4050 {
4051 g_js_DropBhopRank[i] = 99999999;
4052 g_js_fPersonal_DropBhop_Record[i] = -1.0;
4053 }
4054 }
4055 }
4056}
4057
4058public db_resetPlayerWJRecord(client, String:steamid[128])
4059{
4060 decl String:szQuery[255];
4061 decl String:szsteamid[128*2+1];
4062 SQL_QuoteString(g_hDb, steamid, szsteamid, 128*2+1);
4063 Format(szQuery, 255, sql_resetWJRecord, szsteamid);
4064 new Handle:pack = CreateDataPack();
4065 WritePackCell(pack, client);
4066 WritePackString(pack, steamid);
4067 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery, pack);
4068 PrintToConsole(client, "wj record cleared (%s).", szsteamid);
4069 for (new i = 1; i <= MaxClients; i++)
4070 {
4071 if (IsValidClient(i))
4072 {
4073 decl String:szSteamId2[32];
4074 GetClientAuthString(i, szSteamId2, 32);
4075 if(StrEqual(szSteamId2,szsteamid))
4076 {
4077 g_js_WjRank[i] = 99999999;
4078 g_js_fPersonal_Wj_Record[i] = -1.0;
4079 }
4080 }
4081 }
4082}
4083
4084public db_resetPlayerJumpstats(client, String:steamid[128])
4085{
4086 decl String:szQuery[255];
4087 decl String:szsteamid[128*2+1];
4088 SQL_QuoteString(g_hDb, steamid, szsteamid, 128*2+1);
4089 Format(szQuery, 255, sql_resetJumpStats, szsteamid);
4090 new Handle:pack = CreateDataPack();
4091 WritePackCell(pack, client);
4092 WritePackString(pack, steamid);
4093 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery, pack);
4094 PrintToConsole(client, "jumpstats cleared (%s).", szsteamid);
4095 for (new i = 1; i <= MaxClients; i++)
4096 {
4097 if (IsValidClient(i))
4098 {
4099 decl String:szSteamId2[32];
4100 GetClientAuthString(i, szSteamId2, 32);
4101 if(StrEqual(szSteamId2,szsteamid))
4102 {
4103 g_js_MultiBhopRank[i] = 99999999;
4104 g_js_fPersonal_MultiBhop_Record[i] = -1.0;
4105 g_js_WjRank[i] = 99999999;
4106 g_js_fPersonal_Wj_Record[i] = -1.0;
4107 g_js_DropBhopRank[i] = 99999999;
4108 g_js_fPersonal_DropBhop_Record[i] = -1.0;
4109 g_js_BhopRank[i] = 99999999;
4110 g_js_fPersonal_Bhop_Record[i] = -1.0;
4111 g_js_LjRank[i] = 99999999;
4112 g_js_fPersonal_Lj_Record[i] = -1.0;
4113 }
4114 }
4115 }
4116}
4117
4118public db_resetPlayerMultiBhopRecord(client, String:steamid[128])
4119{
4120 decl String:szQuery[255];
4121 decl String:szsteamid[128*2+1];
4122 SQL_QuoteString(g_hDb, steamid, szsteamid, 128*2+1);
4123 Format(szQuery, 255, sql_resetMultiBhopRecord, szsteamid);
4124 new Handle:pack = CreateDataPack();
4125 WritePackCell(pack, client);
4126 WritePackString(pack, steamid);
4127 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery, pack);
4128 PrintToConsole(client, "multibhop record cleared (%s).", szsteamid);
4129 for (new i = 1; i <= MaxClients; i++)
4130 {
4131 if (IsValidClient(i))
4132 {
4133 decl String:szSteamId2[32];
4134 GetClientAuthString(i, szSteamId2, 32);
4135 if(StrEqual(szSteamId2,szsteamid))
4136 {
4137 g_js_MultiBhopRank[i] = 99999999;
4138 g_js_fPersonal_MultiBhop_Record[i] = -1.0;
4139 }
4140 }
4141 }
4142}
4143
4144public db_resetPlayerLjRecord(client, String:steamid[128])
4145{
4146 decl String:szQuery[255];
4147 decl String:szsteamid[128*2+1];
4148 SQL_QuoteString(g_hDb, steamid, szsteamid, 128*2+1);
4149 Format(szQuery, 255, sql_resetLjRecord, szsteamid);
4150 new Handle:pack = CreateDataPack();
4151 WritePackCell(pack, client);
4152 WritePackString(pack, steamid);
4153 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery, pack);
4154 PrintToConsole(client, "lj record cleared (%s).", szsteamid);
4155 for (new i = 1; i <= MaxClients; i++)
4156 {
4157 if (IsValidClient(i))
4158 {
4159 decl String:szSteamId2[32];
4160 GetClientAuthString(i, szSteamId2, 32);
4161 if(StrEqual(szSteamId2,szsteamid))
4162 {
4163 g_js_LjRank[i] = 99999999;
4164 g_js_fPersonal_Lj_Record[i] = -1.0;
4165 }
4166 }
4167 }
4168}
4169
4170public db_resetPlayerLjBlockRecord(client, String:steamid[128])
4171{
4172 decl String:szQuery[255];
4173 decl String:szsteamid[128*2+1];
4174 SQL_QuoteString(g_hDb, steamid, szsteamid, 128*2+1);
4175 Format(szQuery, 255, sql_resetLjBlockRecord, szsteamid);
4176 new Handle:pack = CreateDataPack();
4177 WritePackCell(pack, client);
4178 WritePackString(pack, steamid);
4179 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery, pack);
4180 PrintToConsole(client, "ljblock record cleared (%s).", szsteamid);
4181 for (new i = 1; i <= MaxClients; i++)
4182 {
4183 if (IsValidClient(i))
4184 {
4185 decl String:szSteamId2[32];
4186 GetClientAuthString(i, szSteamId2, 32);
4187 if(StrEqual(szSteamId2,szsteamid))
4188 {
4189 g_js_LjBlockRank[i] = 99999999;
4190 g_js_Personal_LjBlock_Record[i] = -1;
4191 }
4192 }
4193 }
4194}
4195
4196public db_dropPlayerJump(client)
4197{
4198 decl String:szQuery[255];
4199 Format(szQuery, 255, "UPDATE playerjumpstats SET wjrecord=-1.0, bhoprecord=-1.0, ljrecord=-1.0,dropbhoprecord=-1.0,multibhoprecord=-1.0");
4200 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery);
4201 PrintToConsole(client, "jumpstats records reseted.");
4202 for (new i = 1; i <= MaxClients; i++)
4203 {
4204 if (IsValidClient(i))
4205 {
4206 g_js_LjRank[i] = 99999999;
4207 g_js_fPersonal_Lj_Record[i] = -1.0;
4208 g_js_WjRank[i] = 99999999;
4209 g_js_fPersonal_Wj_Record[i] = -1.0;
4210 g_js_BhopRank[i] = 99999999;
4211 g_js_fPersonal_Bhop_Record[i] = -1.0;
4212 g_js_DropBhopRank[i] = 99999999;
4213 g_js_fPersonal_DropBhop_Record[i] = -1.0;
4214 g_js_MultiBhopRank[i] = 99999999;
4215 g_js_fPersonal_MultiBhop_Record[i] = -1.0;
4216 }
4217 }
4218}