· 10 years ago · Aug 24, 2016, 04:00 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], "klew", "<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], "klew", "<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 //ownage
1988 else
1989 if (g_js_fJump_Distance[client] >= g_dist_pro_weird && g_js_fJump_Distance[client] < g_dist_leet_weird)
1990 {
1991 Format(g_js_szLastJumpDistance[client], "klew", "<font color='#ff8533'><b>%.2f units</b></font>", g_js_fJump_Distance[client]);
1992 g_js_LeetJump_Count[client]=0;
1993 //Client
1994 PrintToConsole(client, " ");
1995 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);
1996 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);
1997 PrintToConsole(client, "%s", szStrafeStats);
1998 decl String:buffer[255];
1999 Format(buffer, sizeof(buffer), "play %s", PROJUMP_RELATIVE_SOUND_PATH);
2000 if (g_bEnableQuakeSounds[client])
2001 ClientCommand(client, buffer);
2002 //all
2003 for (new i = 1; i <= MaxClients; i++)
2004 {
2005 if (IsValidClient(i))
2006 {
2007 if (g_bColorChat[i]==true && i != client)
2008 PrintToChat(i, "%t", "Jumpstats_WeirdAll",MOSSGREEN,WHITE,GREEN,szName, MOSSGREEN,GREEN, g_js_fJump_Distance[client],MOSSGREEN,GREEN);
2009 }
2010 }
2011 }
2012 //leet?
2013 else
2014 if (g_js_fJump_Distance[client] >= g_dist_leet_weird)
2015 {
2016 // strafe hack protection
2017 if (strafes == 0 || g_js_fPreStrafe[client] < 255.0)
2018 {
2019 ValidJump = false;
2020 Format(g_js_szLastJumpDistance[client], 256, "<font color='#948d8d'>invalid</font>");
2021 PostThinkPost(client, ground_frames);
2022 return;
2023 }
2024 Format(g_js_szLastJumpDistance[client], 256, "<font color='#9a0909'><b>%.2f units</b></font>", g_js_fJump_Distance[client]);
2025 g_js_LeetJump_Count[client]++;
2026 //Client
2027 PrintToConsole(client, " ");
2028 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);
2029 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);
2030 PrintToConsole(client, "%s", szStrafeStats);
2031 if (g_js_LeetJump_Count[client]==3)
2032 PrintToChat(client, "%t", "Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
2033 else
2034 if (g_js_LeetJump_Count[client]==5)
2035 PrintToChat(client, "%t", "Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
2036
2037 //all
2038 for (new i = 1; i <= MaxClients; i++)
2039 {
2040 if (IsValidClient(i))
2041 {
2042 if (g_bColorChat[i]==true && i != client)
2043 {
2044 PrintToChat(i, "%t", "Jumpstats_WeirdAll",MOSSGREEN,WHITE,DARKRED,szName, RED,DARKRED, g_js_fJump_Distance[client],RED,DARKRED);
2045 if (g_js_LeetJump_Count[client]==3)
2046 PrintToChat(i, "%t", "Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
2047 else
2048 if (g_js_LeetJump_Count[client]==5)
2049 PrintToChat(i, "%t", "Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
2050 }
2051 }
2052 }
2053 PlayLeetJumpSound(client);
2054 if (g_js_LeetJump_Count[client] != 3 && g_js_LeetJump_Count[client] != 5)
2055 {
2056 decl String:buffer[255];
2057 Format(buffer, sizeof(buffer), "play %s", LEETJUMP_RELATIVE_SOUND_PATH);
2058 }
2059 }
2060 else
2061 g_js_LeetJump_Count[client]=0;
2062
2063 //strafesync chat
2064 if (g_bStrafeSync[client] && g_js_fJump_Distance[client] >= g_dist_good_weird)
2065 PrintToChat(client,"%s", szStrafeSync);
2066
2067 //new best
2068 if (g_js_fPersonal_Wj_Record[client] < g_js_fJump_Distance[client] && !IsFakeClient(client) && ValidJump)
2069 {
2070 if (g_js_fPersonal_Wj_Record[client] > 0.0)
2071 PrintToChat(client, "%t", "Jumpstats_BeatWjBest",MOSSGREEN,WHITE,YELLOW, g_js_fJump_Distance[client]);
2072 g_js_fPersonal_Wj_Record[client] = g_js_fJump_Distance[client];
2073 db_updateWjRecord(client);
2074 }
2075 }
2076 }
2077 //BunnyHop
2078 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)
2079 {
2080 Format(g_js_szLastJumpDistance[client], 256, "<font color='#948d8d'>%.1f units</font>", g_js_fJump_Distance[client]);
2081 ValidJump=true;
2082 //good?
2083 if (g_js_fJump_Distance[client] >= g_dist_good_bhop && g_js_fJump_Distance[client] < g_dist_pro_bhop)
2084 {
2085 Format(g_js_szLastJumpDistance[client], 256, "<font color='#676060'><b>%.1f units</b></font>", g_js_fJump_Distance[client]);
2086 g_js_LeetJump_Count[client]=0;
2087 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);
2088 PrintToConsole(client, " ");
2089 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);
2090 PrintToConsole(client, "%s", szStrafeStats);
2091 }
2092 else
2093 //pro?
2094 if (g_js_fJump_Distance[client] >= g_dist_pro_bhop && g_js_fJump_Distance[client] < g_dist_leet_bhop)
2095 {
2096 Format(g_js_szLastJumpDistance[client], 256, "<font color='#21982a'><b>%.2f units</b></font>", g_js_fJump_Distance[client]);
2097 g_js_LeetJump_Count[client]=0;
2098 PrintToConsole(client, " ");
2099 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);
2100 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);
2101 PrintToConsole(client, "%s", szStrafeStats);
2102 decl String:buffer[255];
2103 Format(buffer, sizeof(buffer), "play %s", PROJUMP_RELATIVE_SOUND_PATH);
2104 if (g_bEnableQuakeSounds[client])
2105 ClientCommand(client, buffer);
2106 //all
2107 for (new i = 1; i <= MaxClients; i++)
2108 {
2109 if (IsValidClient(i))
2110 {
2111 if (g_bColorChat[i]==true && i != client)
2112 PrintToChat(i, "%t", "Jumpstats_BhopAll",MOSSGREEN,WHITE,GREEN,szName, MOSSGREEN,GREEN, g_js_fJump_Distance[client],MOSSGREEN,GREEN);
2113 }
2114 }
2115 }
2116 else
2117 {
2118 //leet?
2119 if (g_js_fJump_Distance[client] >= g_dist_leet_bhop && g_js_fMax_Speed_Final[client] > 330.0)
2120 {
2121 // strafe hack protection
2122 if (strafes == 0 || g_js_fPreStrafe[client] < 270.0)
2123 {
2124 ValidJump=false;
2125 Format(g_js_szLastJumpDistance[client], 256, "<font color='#948d8d'>invalid</font>");
2126 PostThinkPost(client, ground_frames);
2127 return;
2128 }
2129 Format(g_js_szLastJumpDistance[client], 256, "<font color='#9a0909'><b>%.2f units</b></font>", g_js_fJump_Distance[client]);
2130 g_js_LeetJump_Count[client]++;
2131 //Client
2132 PrintToConsole(client, " ");
2133 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);
2134 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);
2135 PrintToConsole(client, "%s", szStrafeStats);
2136 if (g_js_LeetJump_Count[client]==3)
2137 PrintToChat(client, "%t", "Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
2138 else
2139 if (g_js_LeetJump_Count[client]==5)
2140 PrintToChat(client, "%t", "Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
2141
2142 //all
2143 for (new i = 1; i <= MaxClients; i++)
2144 {
2145 if (IsValidClient(i))
2146 {
2147 if (g_bColorChat[i]==true && i != client)
2148 {
2149 PrintToChat(i, "%t", "Jumpstats_BhopAll",MOSSGREEN,WHITE,DARKRED,szName, RED,DARKRED, g_js_fJump_Distance[client],RED,DARKRED);
2150 if (g_js_LeetJump_Count[client]==3)
2151 PrintToChat(i, "%t", "Jumpstats_OnRampage",MOSSGREEN,WHITE,YELLOW,szName);
2152 else
2153 if (g_js_LeetJump_Count[client]==5)
2154 PrintToChat(i, "%t", "Jumpstats_IsDominating",MOSSGREEN,WHITE,YELLOW,szName);
2155 }
2156 }
2157 }
2158 PlayLeetJumpSound(client);
2159 if (g_js_LeetJump_Count[client] != 3 && g_js_LeetJump_Count[client] != 5)
2160 {
2161 decl String:buffer[255];
2162 Format(buffer, sizeof(buffer), "play %s", LEETJUMP_RELATIVE_SOUND_PATH);
2163 }
2164 }
2165 else
2166 {
2167 g_js_LeetJump_Count[client]=0;
2168 }
2169 }
2170
2171 //strafe sync chat
2172 if (g_bStrafeSync[client] && g_js_fJump_Distance[client] >= g_dist_good_bhop)
2173 PrintToChat(client,"%s", szStrafeSync);
2174
2175 //new best
2176 if (g_js_fPersonal_Bhop_Record[client] < g_js_fJump_Distance[client] && !IsFakeClient(client) && ValidJump)
2177 {
2178 if (g_js_fPersonal_Bhop_Record[client] > 0.0)
2179 PrintToChat(client, "%t", "Jumpstats_BeatBhopBest",MOSSGREEN,WHITE,YELLOW, g_js_fJump_Distance[client]);
2180 g_js_fPersonal_Bhop_Record[client] = g_js_fJump_Distance[client];
2181 db_updateBhopRecord(client);
2182 }
2183
2184 }
2185 if (!ValidJump)
2186 g_js_LeetJump_Count[client]=0;
2187 PostThinkPost(client, ground_frames);
2188}
2189
2190public PostThinkPost(client, ground_frames)
2191{
2192 g_js_bPlayerJumped[client] = false;
2193 g_js_Last_Ground_Frames[client] = ground_frames;
2194}
2195
2196public Action:Client_Ljblock(client, args)
2197{
2198 if (IsValidClient(client) && IsPlayerAlive(client))
2199 LJBlockMenu(client);
2200 return Plugin_Handled;
2201}
2202
2203public LJBlockMenu(client)
2204{
2205 new Handle:menu = CreateMenu(LjBlockMenuHandler);
2206 SetMenuTitle(menu, "LJ Block Jump Menu");
2207 AddMenuItem(menu, "0", "Select Destination");
2208 AddMenuItem(menu, "0", "Reset Destination");
2209 SetMenuOptionFlags(menu, MENUFLAG_BUTTON_EXIT);
2210 DisplayMenu(menu, client, MENU_TIME_FOREVER);
2211}
2212
2213public LjBlockMenuHandler(Handle:menu, MenuAction:action, client, select)
2214{
2215 if(action == MenuAction_Select)
2216 {
2217 if(select == 0)
2218 {
2219 Function_BlockJump(client);
2220 LJBlockMenu(client);
2221 }
2222 else if(select == 1)
2223 {
2224 g_bLJBlock[client] = false;
2225 LJBlockMenu(client);
2226 }
2227 }
2228}
2229
2230public Action:Client_InfoPanel(client, args)
2231{
2232 InfoPanel(client);
2233 if (g_bInfoPanel[client] == true)
2234 PrintToChat(client, "%t", "Info1", MOSSGREEN,WHITE);
2235 else
2236 PrintToChat(client, "%t", "Info2", MOSSGREEN,WHITE);
2237 return Plugin_Handled;
2238}
2239
2240public InfoPanel(client)
2241{
2242 if (g_bInfoPanel[client])
2243 g_bInfoPanel[client] = false;
2244 else
2245 {
2246 g_bInfoPanel[client] = true;
2247 }
2248}
2249
2250public Action:Client_StrafeSync(client, args)
2251{
2252 StrafeSync(client);
2253 if (g_bStrafeSync[client])
2254 PrintToChat(client, "%t", "StrafeSync1", MOSSGREEN,WHITE);
2255 else
2256 PrintToChat(client, "%t", "StrafeSync2", MOSSGREEN,WHITE);
2257 return Plugin_Handled;
2258}
2259
2260public Action:Client_Stats(client, args)
2261{
2262 g_bdetailView[client]=false;
2263 decl String:szSteamId[32];
2264 if (IsValidClient(client))
2265 GetClientAuthString(client, szSteamId, 32);
2266 db_viewJumpStats(client, szSteamId)
2267 return Plugin_Handled;
2268}
2269
2270
2271public StrafeSync(client)
2272{
2273 if (g_bStrafeSync[client])
2274 g_bStrafeSync[client] = false;
2275 else
2276 g_bStrafeSync[client] = true;
2277}
2278
2279public Action:Client_QuakeSounds(client, args)
2280{
2281 QuakeSounds(client);
2282 if (g_bEnableQuakeSounds[client])
2283 PrintToChat(client, "%t", "QuakeSounds1", MOSSGREEN,WHITE);
2284 else
2285 PrintToChat(client, "%t", "QuakeSounds2", MOSSGREEN,WHITE);
2286 return Plugin_Handled;
2287}
2288
2289public QuakeSounds(client)
2290{
2291 if (g_bEnableQuakeSounds[client])
2292 g_bEnableQuakeSounds[client] = false;
2293 else
2294 g_bEnableQuakeSounds[client] = true;
2295}
2296
2297public Action:Client_Colorchat(client, args)
2298{
2299 ColorChat(client);
2300 if (g_bColorChat[client])
2301 PrintToChat(client, "%t", "Colorchat1", MOSSGREEN,WHITE);
2302 else
2303 PrintToChat(client, "%t", "Colorchat2", MOSSGREEN,WHITE);
2304 return Plugin_Handled;
2305}
2306
2307public PlayLeetJumpSound(client)
2308{
2309 decl String:buffer[255];
2310
2311 //all sound
2312 if (g_js_LeetJump_Count[client] == 3 || g_js_LeetJump_Count[client] == 5)
2313 {
2314 for (new i = 1; i <= MaxClients; i++)
2315 {
2316 if(IsValidClient(i) && !IsFakeClient(i) && i != client && g_bColorChat[i] && g_bEnableQuakeSounds[i])
2317 {
2318 if (g_js_LeetJump_Count[client]==3)
2319 {
2320 Format(buffer, sizeof(buffer), "play %s", LEETJUMP_RAMPAGE_RELATIVE_SOUND_PATH);
2321 ClientCommand(i, buffer);
2322 }
2323 else
2324 if (g_js_LeetJump_Count[client]==5)
2325 {
2326 Format(buffer, sizeof(buffer), "play %s", LEETJUMP_DOMINATING_RELATIVE_SOUND_PATH);
2327 ClientCommand(i, buffer);
2328 }
2329 }
2330 }
2331 }
2332
2333 //client sound
2334 if (IsValidClient(client) && !IsFakeClient(client) && g_bEnableQuakeSounds[client])
2335 {
2336 if (g_js_LeetJump_Count[client] != 3 && g_js_LeetJump_Count[client] != 5)
2337 {
2338 Format(buffer, sizeof(buffer), "play %s", LEETJUMP_RELATIVE_SOUND_PATH);
2339 ClientCommand(client, buffer);
2340 }
2341 else
2342 if (g_js_LeetJump_Count[client]==3)
2343 {
2344 Format(buffer, sizeof(buffer), "play %s", LEETJUMP_RAMPAGE_RELATIVE_SOUND_PATH);
2345 ClientCommand(client, buffer);
2346 }
2347 else
2348 if (g_js_LeetJump_Count[client]==5)
2349 {
2350 Format(buffer, sizeof(buffer), "play %s", LEETJUMP_DOMINATING_RELATIVE_SOUND_PATH);
2351 ClientCommand(client, buffer);
2352 }
2353 }
2354}
2355
2356public ColorChat(client)
2357{
2358 if (g_bColorChat[client])
2359 g_bColorChat[client] = false;
2360 else
2361 g_bColorChat[client] = true;
2362}
2363
2364public Action:Client_Top(client, args)
2365{
2366 JumpTopMenu(client);
2367 return Plugin_Handled;
2368}
2369
2370public JumpTopMenu(client)
2371{
2372 new Handle:topmenu2 = CreateMenu(JumpTopMenuHandler);
2373 SetMenuTitle(topmenu2, "Jump Top");
2374 AddMenuItem(topmenu2, "!lj", "Top 20 Longjump");
2375 AddMenuItem(topmenu2, "!ljblock", "Top 20 Block Longjump");
2376 AddMenuItem(topmenu2, "!bhop", "Top 20 Bunnyhop");
2377 AddMenuItem(topmenu2, "!multibhop", "Top 20 Multi-Bunnyhop");
2378 AddMenuItem(topmenu2, "!dropbhop", "Top 20 Drop-Bunnyhop");
2379 AddMenuItem(topmenu2, "!wj", "Top 20 Weirdjump");
2380 SetMenuOptionFlags(topmenu2, MENUFLAG_BUTTON_EXIT);
2381 DisplayMenu(topmenu2, client, MENU_TIME_FOREVER);
2382}
2383
2384public JumpTopMenuHandler(Handle:menu, MenuAction:action, param1,param2)
2385{
2386 if(action == MenuAction_Select)
2387 {
2388 switch(param2)
2389 {
2390 case 0: db_selectTopLj(param1);
2391 case 1: db_selectTopLjBlock(param1);
2392 case 2: db_selectTopBhop(param1);
2393 case 3: db_selectTopMultiBhop(param1);
2394 case 4: db_selectTopDropBhop(param1);
2395 case 5: db_selectTopWj(param1);
2396 }
2397 }
2398}
2399
2400
2401///SQL
2402
2403public db_updateLjRecord(client)
2404{
2405 decl String:szQuery[255];
2406 decl String:szSteamId[32];
2407 if (IsValidClient(client))
2408 GetClientAuthString(client, szSteamId, 32);
2409 else
2410 return;
2411 Format(szQuery, 255, sql_selectPlayerJumpLJ, szSteamId);
2412 if (!IsFakeClient(client))
2413 SQL_TQuery(g_hDb, SQL_UpdateLjRecordCallback, szQuery, client,DBPrio_Low);
2414}
2415
2416public db_updateLjBlockRecord(client)
2417{
2418 decl String:szQuery[255];
2419 decl String:szSteamId[32];
2420 if (IsValidClient(client))
2421 GetClientAuthString(client, szSteamId, 32);
2422 else
2423 return;
2424 Format(szQuery, 255, sql_selectPlayerJumpLJBlock, szSteamId);
2425 if (!IsFakeClient(client))
2426 SQL_TQuery(g_hDb, SQL_UpdateLjBlockRecordCallback, szQuery, client,DBPrio_Low);
2427}
2428
2429public db_updateWjRecord(client)
2430{
2431 decl String:szQuery[255];
2432 decl String:szSteamId[32];
2433 if (IsValidClient(client))
2434 GetClientAuthString(client, szSteamId, 32);
2435 else
2436 return;
2437 Format(szQuery, 255, sql_selectPlayerJumpWJ, szSteamId);
2438 if (!IsFakeClient(client))
2439 SQL_TQuery(g_hDb, SQL_UpdateWjRecordCallback, szQuery, client,DBPrio_Low);
2440}
2441
2442public db_updateBhopRecord(client)
2443{
2444 decl String:szQuery[255];
2445 decl String:szSteamId[32];
2446 if (IsValidClient(client))
2447 GetClientAuthString(client, szSteamId, 32);
2448 else
2449 return;
2450 Format(szQuery, 255, sql_selectPlayerJumpBhop, szSteamId);
2451 if (!IsFakeClient(client))
2452 SQL_TQuery(g_hDb, SQL_UpdateBhopRecordCallback, szQuery, client,DBPrio_Low);
2453}
2454
2455public db_updateDropBhopRecord(client)
2456{
2457 decl String:szQuery[255];
2458 decl String:szSteamId[32];
2459 if (IsValidClient(client))
2460 GetClientAuthString(client, szSteamId, 32);
2461 else
2462 return;
2463 Format(szQuery, 255, sql_selectPlayerJumpDropBhop, szSteamId);
2464 if (!IsFakeClient(client))
2465 SQL_TQuery(g_hDb, SQL_UpdateDropBhopRecordCallback, szQuery, client,DBPrio_Low);
2466}
2467
2468public db_updateMultiBhopRecord(client)
2469{
2470 decl String:szQuery[255];
2471 decl String:szSteamId[32];
2472 if (IsValidClient(client))
2473 GetClientAuthString(client, szSteamId, 32);
2474 else
2475 return;
2476 Format(szQuery, 255, sql_selectPlayerJumpMultiBhop, szSteamId);
2477 if (!IsFakeClient(client))
2478 SQL_TQuery(g_hDb, SQL_UpdateMultiBhopRecordCallback, szQuery, client,DBPrio_Low);
2479}
2480
2481
2482public SQL_UpdateLjRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2483{
2484 new client = data;
2485 if (IsValidClient(client))
2486 {
2487 decl String:szQuery[512];
2488 decl String:szUName[MAX_NAME_LENGTH];
2489 GetClientName(client, szUName, MAX_NAME_LENGTH);
2490 decl String:szSteamId[32];
2491 GetClientAuthString(client, szSteamId, 32);
2492 decl String:szName[MAX_NAME_LENGTH*2+1];
2493 SQL_QuoteString(g_hDb, szUName, szName, MAX_NAME_LENGTH*2+1);
2494 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2495 {
2496 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);
2497 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2498 }
2499 else
2500 {
2501 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]);
2502 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2503 }
2504 db_viewLjRecord2(client);
2505 }
2506}
2507
2508public SQL_viewBhop2RecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
2509{
2510 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2511 {
2512 decl String:szName[MAX_NAME_LENGTH];
2513 new rank = SQL_GetRowCount(hndl);
2514 new Handle:pack = data;
2515 ResetPack(pack);
2516 new client = ReadPackCell(pack);
2517 ReadPackString(pack, szName, MAX_NAME_LENGTH);
2518 CloseHandle(pack);
2519 if (rank < 21 && rank < g_js_BhopRank[client])
2520 {
2521 g_js_BhopRank[client] = rank;
2522 for(new i = 1; i <= GetMaxClients(); i++)
2523 {
2524 if(IsValidClient(i) && !IsFakeClient(i))
2525 {
2526 PrintToChat(i, "%t", "Jumpstats_BhopTop", MOSSGREEN, WHITE, YELLOW, szName, rank, g_js_fPersonal_Bhop_Record[client]);
2527 PrintToConsole(i, "[JS] %s is now #%i in the Bunnyhop Top 20! [%.3f units]", szName, rank, g_js_fPersonal_Bhop_Record[client]);
2528 }
2529 }
2530 }
2531 }
2532}
2533
2534public SQL_viewDropBhop2RecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
2535{
2536 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2537 {
2538 decl String:szName[MAX_NAME_LENGTH];
2539 new rank = SQL_GetRowCount(hndl);
2540 new Handle:pack = data;
2541 ResetPack(pack);
2542 new client = ReadPackCell(pack);
2543 ReadPackString(pack, szName, MAX_NAME_LENGTH);
2544 CloseHandle(pack);
2545 if (rank < 21 && rank < g_js_DropBhopRank[client])
2546 {
2547 g_js_DropBhopRank[client] = rank;
2548 for(new i = 1; i <= GetMaxClients(); i++)
2549 {
2550 if(IsValidClient(i) && !IsFakeClient(i))
2551 {
2552 PrintToChat(i, "%t", "Jumpstats_DropBhopTop", MOSSGREEN, WHITE, YELLOW, szName, rank, g_js_fPersonal_DropBhop_Record[client]);
2553 PrintToConsole(i, "[JS] %s is now #%i in the Drop-Bunnyhop Top 20! [%.3f units]", szName, rank, g_js_fPersonal_DropBhop_Record[client]);
2554 }
2555 }
2556 }
2557 }
2558}
2559
2560public db_viewMultiBhopRecord2(client)
2561{
2562 decl String:szQuery[512];
2563 decl String:szSteamId[32];
2564 if (IsValidClient(client))
2565 GetClientAuthString(client, szSteamId, 32);
2566 else
2567 return;
2568 Format(szQuery, 512, sql_selectPlayerJumpMultiBhop, szSteamId);
2569 SQL_TQuery(g_hDb, SQL_viewMultiBhop2RecordCallback, szQuery, client,DBPrio_Low);
2570}
2571
2572public SQL_viewMultiBhop2RecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2573{
2574 new client = data;
2575 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2576 {
2577 decl String:szQuery[512];
2578 decl String:szName[MAX_NAME_LENGTH];
2579 decl String:szSteamId[32];
2580 SQL_FetchString(hndl, 0, szSteamId, MAX_NAME_LENGTH);
2581 SQL_FetchString(hndl, 1, szName, MAX_NAME_LENGTH);
2582 new Handle:pack = CreateDataPack();
2583 WritePackCell(pack, client);
2584 WritePackString(pack, szName);
2585 Format(szQuery, 512, sql_selectPlayerRankMultiBhop, szSteamId);
2586 SQL_TQuery(g_hDb, SQL_viewMultiBhop2RecordCallback2, szQuery, pack,DBPrio_Low);
2587 }
2588}
2589
2590public SQL_viewMultiBhop2RecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
2591{
2592 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2593 {
2594 decl String:szName[MAX_NAME_LENGTH];
2595 new rank = SQL_GetRowCount(hndl);
2596 new Handle:pack = data;
2597 ResetPack(pack);
2598 new client = ReadPackCell(pack);
2599 ReadPackString(pack, szName, MAX_NAME_LENGTH);
2600 CloseHandle(pack);
2601 if (rank < 21 && rank < g_js_MultiBhopRank[client])
2602 {
2603 g_js_MultiBhopRank[client] = rank;
2604 for(new i = 1; i <= GetMaxClients(); i++)
2605 {
2606 if(IsValidClient(i) && !IsFakeClient(i))
2607 {
2608 PrintToChat(i, "%t", "Jumpstats_MultiBhopTop", MOSSGREEN, WHITE, YELLOW, szName, rank, g_js_fPersonal_MultiBhop_Record[client]);
2609 PrintToConsole(i, "[JS] %s is now #%i in the Multi-Bunnyhop Top 20! [%.3f units]", szName, rank, g_js_fPersonal_MultiBhop_Record[client]);
2610 }
2611 }
2612 }
2613 }
2614}
2615
2616public db_viewLjRecord2(client)
2617{
2618 decl String:szQuery[512];
2619 decl String:szSteamId[32];
2620 if (IsValidClient(client))
2621 GetClientAuthString(client, szSteamId, 32);
2622 else
2623 return;
2624 Format(szQuery, 512, sql_selectPlayerJumpLJ, szSteamId);
2625 SQL_TQuery(g_hDb, SQL_viewLj2RecordCallback, szQuery, client,DBPrio_Low);
2626}
2627
2628public db_viewLjBlockRecord2(client)
2629{
2630 decl String:szQuery[512];
2631 decl String:szSteamId[32];
2632 if (IsValidClient(client))
2633 GetClientAuthString(client, szSteamId, 32);
2634 else
2635 return;
2636 Format(szQuery, 512, sql_selectPlayerJumpLJBlock, szSteamId);
2637 SQL_TQuery(g_hDb, SQL_viewLjBlock2RecordCallback, szQuery, client,DBPrio_Low);
2638}
2639
2640public SQL_viewLjBlock2RecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2641{
2642 new client = data;
2643 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2644 {
2645 decl String:szQuery[512];
2646 decl String:szName[MAX_NAME_LENGTH];
2647 decl String:szSteamId[32];
2648 SQL_FetchString(hndl, 0, szSteamId, MAX_NAME_LENGTH);
2649 SQL_FetchString(hndl, 1, szName, MAX_NAME_LENGTH);
2650 new Handle:pack = CreateDataPack();
2651 WritePackCell(pack, client);
2652 WritePackString(pack, szName);
2653 Format(szQuery, 512, sql_selectPlayerRankLjBlock, szSteamId);
2654 SQL_TQuery(g_hDb, SQL_viewLjBlock2RecordCallback2, szQuery, pack,DBPrio_Low);
2655 }
2656}
2657
2658
2659public SQL_viewLj2RecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2660{
2661 new client = data;
2662 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2663 {
2664 decl String:szQuery[512];
2665 decl String:szName[MAX_NAME_LENGTH];
2666 decl String:szSteamId[32];
2667 SQL_FetchString(hndl, 0, szSteamId, MAX_NAME_LENGTH);
2668 SQL_FetchString(hndl, 1, szName, MAX_NAME_LENGTH);
2669 new Handle:pack = CreateDataPack();
2670 WritePackCell(pack, client);
2671 WritePackString(pack, szName);
2672 Format(szQuery, 512, sql_selectPlayerRankLj, szSteamId);
2673 SQL_TQuery(g_hDb, SQL_viewLj2RecordCallback2, szQuery, pack,DBPrio_Low);
2674 }
2675}
2676
2677public SQL_viewLjBlock2RecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
2678{
2679 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2680 {
2681 decl String:szName[MAX_NAME_LENGTH];
2682 new rank = SQL_GetRowCount(hndl);
2683 new Handle:pack = data;
2684 ResetPack(pack);
2685 new client = ReadPackCell(pack);
2686 ReadPackString(pack, szName, MAX_NAME_LENGTH);
2687 CloseHandle(pack);
2688
2689 if (rank < 21 && rank < g_js_LjBlockRank[client])
2690 {
2691 g_js_LjBlockRank[client] = rank;
2692 for(new i = 1; i <= GetMaxClients(); i++)
2693 {
2694 if(IsValidClient(i) && !IsFakeClient(i))
2695 {
2696 PrintToChat(i, "%t", "Jumpstats_LjBlockTop", MOSSGREEN, WHITE, YELLOW, szName, rank, g_js_Personal_LjBlock_Record[client],g_js_fPersonal_LjBlockRecord_Dist[client]);
2697 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]);
2698 }
2699 }
2700 }
2701 }
2702}
2703
2704public SQL_viewLj2RecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
2705{
2706 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2707 {
2708 decl String:szName[MAX_NAME_LENGTH];
2709 new rank = SQL_GetRowCount(hndl);
2710 new Handle:pack = data;
2711 ResetPack(pack);
2712 new client = ReadPackCell(pack);
2713 ReadPackString(pack, szName, MAX_NAME_LENGTH);
2714 CloseHandle(pack);
2715
2716 if (rank < 21 && rank < g_js_LjRank[client])
2717 {
2718 g_js_LjRank[client] = rank;
2719 for(new i = 1; i <= GetMaxClients(); i++)
2720 {
2721 if(IsValidClient(i) && !IsFakeClient(i))
2722 {
2723 PrintToChat(i, "%t", "Jumpstats_LjTop", MOSSGREEN, WHITE, YELLOW, szName, rank, g_js_fPersonal_Lj_Record[client]);
2724 PrintToConsole(i, "[JS] %s is now #%i in the Longjump 20! [%.3f units]", szName, rank, g_js_fPersonal_Lj_Record[client]);
2725 }
2726 }
2727 }
2728 }
2729}
2730
2731public db_viewWjRecord2(client)
2732{
2733 decl String:szQuery[512];
2734 decl String:szSteamId[32];
2735 if (IsValidClient(client))
2736 GetClientAuthString(client, szSteamId, 32);
2737 else
2738 return;
2739 Format(szQuery, 512, sql_selectPlayerJumpWJ, szSteamId);
2740 SQL_TQuery(g_hDb, SQL_viewWj2RecordCallback, szQuery, client,DBPrio_Low);
2741}
2742
2743public SQL_viewWj2RecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2744{
2745 new client = data;
2746 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2747 {
2748 decl String:szQuery[512];
2749 decl String:szName[MAX_NAME_LENGTH];
2750 decl String:szSteamId[32];
2751 SQL_FetchString(hndl, 0, szSteamId, MAX_NAME_LENGTH);
2752 SQL_FetchString(hndl, 1, szName, MAX_NAME_LENGTH);
2753 new Handle:pack = CreateDataPack();
2754 WritePackCell(pack, client);
2755 WritePackString(pack, szName);
2756 Format(szQuery, 512, sql_selectPlayerRankWJ, szSteamId);
2757 SQL_TQuery(g_hDb, SQL_viewWj2RecordCallback2, szQuery, pack,DBPrio_Low);
2758 }
2759}
2760
2761public SQL_viewWj2RecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
2762{
2763 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2764 {
2765 decl String:szName[MAX_NAME_LENGTH];
2766 new rank = SQL_GetRowCount(hndl);
2767 new Handle:pack = data;
2768 ResetPack(pack);
2769 new client = ReadPackCell(pack);
2770 ReadPackString(pack, szName, MAX_NAME_LENGTH);
2771 CloseHandle(pack);
2772
2773 if (rank < 21 && rank < g_js_WjRank[client])
2774 {
2775 g_js_WjRank[client] = rank;
2776 for(new i = 1; i <= GetMaxClients(); i++)
2777 {
2778 if(IsValidClient(i) && !IsFakeClient(i))
2779 {
2780 PrintToChat(i, "%t", "Jumpstats_WjTop", MOSSGREEN, WHITE, YELLOW, szName, rank, g_js_fPersonal_Wj_Record[client]);
2781 PrintToConsole(i, "[JS] %s is now #%i in the Weirdjump 20! [%.3f units]", szName, rank, g_js_fPersonal_Wj_Record[client]);
2782 }
2783 }
2784 }
2785 }
2786}
2787
2788public SQL_UpdateLjBlockRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2789{
2790 new client = data;
2791 if (IsValidClient(client))
2792 {
2793 decl String:szQuery[512];
2794 decl String:szUName[MAX_NAME_LENGTH];
2795 GetClientName(client, szUName, MAX_NAME_LENGTH);
2796 decl String:szSteamId[32];
2797 GetClientAuthString(client, szSteamId, 32);
2798 decl String:szName[MAX_NAME_LENGTH*2+1];
2799 SQL_QuoteString(g_hDb, szUName, szName, MAX_NAME_LENGTH*2+1);
2800 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2801 {
2802 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);
2803 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2804 }
2805 else
2806 {
2807 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]);
2808 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2809 }
2810 db_viewLjBlockRecord2(client);
2811 }
2812}
2813
2814public SQL_UpdateWjRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2815{
2816 new client = data;
2817 if (IsValidClient(client))
2818 {
2819 decl String:szQuery[512];
2820 decl String:szUName[MAX_NAME_LENGTH];
2821 GetClientName(client, szUName, MAX_NAME_LENGTH);
2822 decl String:szSteamId[32];
2823 GetClientAuthString(client, szSteamId, 32);
2824 decl String:szName[MAX_NAME_LENGTH*2+1];
2825 SQL_QuoteString(g_hDb, szUName, szName, MAX_NAME_LENGTH*2+1);
2826 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2827 {
2828 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);
2829 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2830 }
2831 else
2832 {
2833 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]);
2834 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2835 }
2836 }
2837 db_viewWjRecord2(client);
2838}
2839
2840public SQL_UpdateDropBhopRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2841{
2842 new client = data;
2843 if (IsValidClient(client))
2844 {
2845 decl String:szQuery[512];
2846 decl String:szUName[MAX_NAME_LENGTH];
2847 GetClientName(client, szUName, MAX_NAME_LENGTH);
2848 decl String:szName[MAX_NAME_LENGTH*2+1];
2849 decl String:szSteamId[32];
2850 GetClientAuthString(client, szSteamId, 32);
2851 SQL_QuoteString(g_hDb, szUName, szName, MAX_NAME_LENGTH*2+1);
2852 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2853 {
2854 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);
2855 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2856 }
2857 else
2858 {
2859 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]);
2860 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2861 }
2862 }
2863 db_viewDropBhopRecord2(client);
2864}
2865
2866public db_viewDropBhopRecord2(client)
2867{
2868 decl String:szQuery[512];
2869 decl String:szSteamId[32];
2870 if (IsValidClient(client))
2871 GetClientAuthString(client, szSteamId, 32);
2872 else
2873 return;
2874 Format(szQuery, 512, sql_selectPlayerJumpDropBhop, szSteamId);
2875 SQL_TQuery(g_hDb, SQL_viewDropBhop2RecordCallback, szQuery, client,DBPrio_Low);
2876}
2877
2878public SQL_viewDropBhop2RecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2879{
2880 new client = data;
2881 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2882 {
2883 decl String:szQuery[512];
2884 decl String:szName[MAX_NAME_LENGTH];
2885 decl String:szSteamId[32];
2886 SQL_FetchString(hndl, 0, szSteamId, 32);
2887 SQL_FetchString(hndl, 1, szName, MAX_NAME_LENGTH);
2888 new Handle:pack = CreateDataPack();
2889 WritePackCell(pack, client);
2890 WritePackString(pack, szName);
2891 Format(szQuery, 512, sql_selectPlayerRankDropBhop, szSteamId);
2892 SQL_TQuery(g_hDb, SQL_viewDropBhop2RecordCallback2, szQuery, pack,DBPrio_Low);
2893 }
2894}
2895
2896public SQL_viewBhop2RecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2897{
2898 new client = data;
2899 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2900 {
2901 decl String:szQuery[512];
2902 decl String:szName[MAX_NAME_LENGTH];
2903 decl String:szSteamId[32];
2904 SQL_FetchString(hndl, 0, szSteamId, 32);
2905 SQL_FetchString(hndl, 1, szName, MAX_NAME_LENGTH);
2906 new Handle:pack = CreateDataPack();
2907 WritePackCell(pack, client);
2908 WritePackString(pack, szName);
2909 Format(szQuery, 512, sql_selectPlayerRankBhop, szSteamId);
2910 SQL_TQuery(g_hDb, SQL_viewBhop2RecordCallback2, szQuery, pack,DBPrio_Low);
2911 }
2912}
2913
2914public SQL_UpdateBhopRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2915{
2916 new client = data;
2917 if (IsValidClient(client))
2918 {
2919 decl String:szQuery[512];
2920 decl String:szUName[MAX_NAME_LENGTH];
2921 GetClientName(client, szUName, MAX_NAME_LENGTH);
2922 decl String:szName[MAX_NAME_LENGTH*2+1];
2923 decl String:szSteamId[32];
2924 GetClientAuthString(client, szSteamId, 32);
2925 SQL_QuoteString(g_hDb, szUName, szName, MAX_NAME_LENGTH*2+1);
2926 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2927 {
2928 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);
2929 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2930 }
2931 else
2932 {
2933 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]);
2934 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2935 }
2936 db_viewBhopRecord2(client);
2937 }
2938}
2939
2940public db_viewBhopRecord2(client)
2941{
2942 decl String:szQuery[512];
2943 decl String:szSteamId[32];
2944 if (IsValidClient(client))
2945 GetClientAuthString(client, szSteamId, 32);
2946 else
2947 return;
2948 Format(szQuery, 512, sql_selectPlayerJumpBhop, szSteamId);
2949 SQL_TQuery(g_hDb, SQL_viewBhop2RecordCallback, szQuery, client,DBPrio_Low);
2950}
2951
2952
2953public SQL_UpdateMultiBhopRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
2954{
2955 new client = data;
2956 if (IsValidClient(client))
2957 {
2958 decl String:szQuery[512];
2959 decl String:szUName[MAX_NAME_LENGTH];
2960 GetClientName(client, szUName, MAX_NAME_LENGTH);
2961 decl String:szName[MAX_NAME_LENGTH*2+1];
2962 decl String:szSteamId[32];
2963 if (IsValidClient(client))
2964 GetClientAuthString(client, szSteamId, 32);
2965 else
2966 return;
2967 SQL_QuoteString(g_hDb, szUName, szName, MAX_NAME_LENGTH*2+1);
2968 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
2969 {
2970 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);
2971 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2972 }
2973 else
2974 {
2975 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]);
2976 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery,DBPrio_Low);
2977 }
2978 db_viewMultiBhopRecord2(client);
2979 }
2980}
2981
2982public db_selectTopLj(client)
2983{
2984 decl String:szQuery[1024];
2985 Format(szQuery, 1024, sql_selectPlayerJumpTopLJ);
2986 SQL_TQuery(g_hDb, sql_selectPlayerJumpTopLJCallback, szQuery, client,DBPrio_Low);
2987}
2988
2989public db_selectTopLjBlock(client)
2990{
2991 decl String:szQuery[1024];
2992 Format(szQuery, 1024, sql_selectPlayerJumpTopLJBlock);
2993 SQL_TQuery(g_hDb, sql_selectPlayerJumpTopLJBlockCallback, szQuery, client,DBPrio_Low);
2994}
2995
2996public db_selectTopWj(client)
2997{
2998 decl String:szQuery[1024];
2999 Format(szQuery, 1024, sql_selectPlayerJumpTopWJ);
3000 SQL_TQuery(g_hDb, sql_selectPlayerJumpTopWJCallback, szQuery, client,DBPrio_Low);
3001}
3002
3003public db_selectTopBhop(client)
3004{
3005 decl String:szQuery[1024];
3006 Format(szQuery, 1024, sql_selectPlayerJumpTopBhop);
3007 SQL_TQuery(g_hDb, sql_selectPlayerJumpTopBhopCallback, szQuery, client,DBPrio_Low);
3008}
3009
3010public db_selectTopDropBhop(client)
3011{
3012 decl String:szQuery[1024];
3013 Format(szQuery, 1024, sql_selectPlayerJumpTopDropBhop);
3014 SQL_TQuery(g_hDb, sql_selectPlayerJumpTopDropBhopCallback, szQuery, client,DBPrio_Low);
3015}
3016
3017
3018public db_selectTopMultiBhop(client)
3019{
3020 decl String:szQuery[1024];
3021 Format(szQuery, 1024, sql_selectPlayerJumpTopMultiBhop);
3022 SQL_TQuery(g_hDb, sql_selectPlayerJumpTopMultiBhopCallback, szQuery, client,DBPrio_Low);
3023}
3024
3025public sql_selectPlayerJumpTopLJBlockCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3026{
3027 new client = data;
3028 decl String:szValue[128];
3029 decl String:szName[64];
3030 decl String:szSteamID[32];
3031 new ljblock;
3032 new Float:ljrecord;
3033 new String:szStrafes[32];
3034 new strafes;
3035 new Handle:menu = CreateMenu(LjBlockJumpMenuHandler1);
3036 SetMenuTitle(menu, "Top 20 Block Longjump\n Rank Block Distance Strafes Player");
3037 SetMenuPagination(menu, 5);
3038 if(SQL_HasResultSet(hndl))
3039 {
3040 new i = 1;
3041 while (SQL_FetchRow(hndl))
3042 {
3043 SQL_FetchString(hndl, 0, szName, 64);
3044 ljblock = SQL_FetchInt(hndl, 1);
3045 ljrecord = SQL_FetchFloat(hndl, 2);
3046 strafes = SQL_FetchInt(hndl, 3);
3047 SQL_FetchString(hndl, 4, szSteamID, 32);
3048 if (strafes < 10)
3049 Format(szStrafes, 32, " %i ", strafes);
3050 else
3051 Format(szStrafes, 32, "%i", strafes);
3052 if (i < 10)
3053 Format(szValue, 128, "[0%i.] %i %.3f units %s » %s", i, ljblock,ljrecord,szStrafes, szName);
3054 else
3055 Format(szValue, 128, "[%i.] %i %.3f units %s » %s", i, ljblock,ljrecord,szStrafes, szName);
3056 AddMenuItem(menu, szSteamID, szValue, ITEMDRAW_DEFAULT);
3057 i++;
3058 }
3059 }
3060 SetMenuOptionFlags(menu, MENUFLAG_BUTTON_EXIT);
3061 DisplayMenu(menu, client, MENU_TIME_FOREVER);
3062}
3063
3064
3065public sql_selectPlayerJumpTopLJCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3066{
3067 new client = data;
3068 decl String:szValue[128];
3069 decl String:szName[64];
3070 decl String:szSteamID[32];
3071 new Float:ljrecord;
3072 new String:szStrafes[32];
3073 new strafes;
3074 new Handle:menu = CreateMenu(LjJumpMenuHandler1);
3075 SetMenuTitle(menu, "Top 20 Longjump\n Rank Distance Strafes Player");
3076 SetMenuPagination(menu, 5);
3077 if(SQL_HasResultSet(hndl))
3078 {
3079 new i = 1;
3080 while (SQL_FetchRow(hndl))
3081 {
3082 SQL_FetchString(hndl, 0, szName, 64);
3083 ljrecord = SQL_FetchFloat(hndl, 1);
3084 strafes = SQL_FetchInt(hndl, 2);
3085 SQL_FetchString(hndl, 3, szSteamID, 32);
3086 if (strafes < 10)
3087 Format(szStrafes, 32, " %i ", strafes);
3088 else
3089 Format(szStrafes, 32, "%i", strafes);
3090 if (i < 10)
3091 Format(szValue, 128, "[0%i.] %.3f units %s » %s", i, ljrecord,szStrafes, szName);
3092 else
3093 Format(szValue, 128, "[%i.] %.3f units %s » %s", i, ljrecord,szStrafes, szName);
3094 AddMenuItem(menu, szSteamID, szValue, ITEMDRAW_DEFAULT);
3095 i++;
3096 }
3097 }
3098 SetMenuOptionFlags(menu, MENUFLAG_BUTTON_EXIT);
3099 DisplayMenu(menu, client, MENU_TIME_FOREVER);
3100}
3101
3102public sql_selectPlayerJumpTopWJCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3103{
3104 new client = data;
3105 decl String:szValue[128];
3106 decl String:szName[64];
3107 new Float:ljrecord;
3108 new String:szStrafes[32];
3109 decl String:szSteamID[32];
3110 new strafes;
3111 new Handle:menu = CreateMenu(WjJumpMenuHandler1);
3112 SetMenuTitle(menu, "Top 20 Weirdjump\n Rank Distance Strafes Player");
3113 SetMenuPagination(menu, 5);
3114 if(SQL_HasResultSet(hndl))
3115 {
3116 new i = 1;
3117 while (SQL_FetchRow(hndl))
3118 {
3119 SQL_FetchString(hndl, 0, szName, 64);
3120 ljrecord = SQL_FetchFloat(hndl, 1);
3121 strafes = SQL_FetchInt(hndl, 2);
3122 SQL_FetchString(hndl, 3, szSteamID, 32);
3123 if (strafes < 10)
3124 Format(szStrafes, 32, " %i ", strafes);
3125 else
3126 Format(szStrafes, 32, "%i", strafes);
3127 if (i < 10)
3128 Format(szValue, 128, "[0%i.] %.3f units %s » %s", i, ljrecord,szStrafes, szName);
3129 else
3130 Format(szValue, 128, "[%i.] %.3f units %s » %s", i, ljrecord,szStrafes, szName);
3131 AddMenuItem(menu, szSteamID, szValue, ITEMDRAW_DEFAULT);
3132 i++;
3133 }
3134 }
3135 SetMenuOptionFlags(menu, MENUFLAG_BUTTON_EXIT);
3136 DisplayMenu(menu, client, MENU_TIME_FOREVER);
3137}
3138
3139public sql_selectPlayerJumpTopBhopCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3140{
3141 new client = data;
3142 decl String:szValue[128];
3143 decl String:szName[64];
3144 new Float:bhoprecord;
3145 decl String:szSteamID[32];
3146 new String:szStrafes[32];
3147 new strafes;
3148 new Handle:menu = CreateMenu(BhopJumpMenuHandler1);
3149 SetMenuTitle(menu, "Top 20 Bunnyhop\n Rank Distance Strafes Player");
3150 SetMenuPagination(menu, 5);
3151 if(SQL_HasResultSet(hndl))
3152 {
3153 new i = 1;
3154 while (SQL_FetchRow(hndl))
3155 {
3156 SQL_FetchString(hndl, 0, szName, 64);
3157 bhoprecord = SQL_FetchFloat(hndl, 1);
3158 strafes = SQL_FetchInt(hndl, 2);
3159 SQL_FetchString(hndl, 3, szSteamID, 32);
3160 if (strafes < 10)
3161 Format(szStrafes, 32, " %i ", strafes);
3162 else
3163 Format(szStrafes, 32, "%i", strafes);
3164 if (i < 10)
3165 Format(szValue, 128, "[0%i.] %.3f units %s » %s", i, bhoprecord,szStrafes, szName);
3166 else
3167 Format(szValue, 128, "[%i.] %.3f units %s » %s", i, bhoprecord,szStrafes, szName);
3168 AddMenuItem(menu, szSteamID, szValue, ITEMDRAW_DEFAULT);
3169 i++;
3170 }
3171 }
3172 SetMenuOptionFlags(menu, MENUFLAG_BUTTON_EXIT);
3173 DisplayMenu(menu, client, MENU_TIME_FOREVER);
3174}
3175
3176public sql_selectPlayerJumpTopDropBhopCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3177{
3178 new client = data;
3179 decl String:szValue[128];
3180 decl String:szName[64];
3181 new Float:bhoprecord;
3182 decl String:szSteamID[32];
3183 new String:szStrafes[32];
3184 new strafes;
3185 new Handle:menu = CreateMenu(DropBhopJumpMenuHandler1);
3186 SetMenuTitle(menu, "Top 20 Drop-Bunnyhop\n Rank Distance Strafes Player");
3187 SetMenuPagination(menu, 5);
3188 if(SQL_HasResultSet(hndl))
3189 {
3190 new i = 1;
3191 while (SQL_FetchRow(hndl))
3192 {
3193 SQL_FetchString(hndl, 0, szName, 64);
3194 bhoprecord = SQL_FetchFloat(hndl, 1);
3195 strafes = SQL_FetchInt(hndl, 2);
3196 SQL_FetchString(hndl, 3, szSteamID, 32);
3197 if (strafes < 10)
3198 Format(szStrafes, 32, " %i ", strafes);
3199 else
3200 Format(szStrafes, 32, "%i", strafes);
3201 if (i < 10)
3202 Format(szValue, 128, "[0%i.] %.3f units %s » %s", i, bhoprecord,szStrafes, szName);
3203 else
3204 Format(szValue, 128, "[%i.] %.3f units %s » %s", i, bhoprecord,szStrafes, szName);
3205 AddMenuItem(menu, szSteamID, szValue, ITEMDRAW_DEFAULT);
3206 i++;
3207 }
3208 }
3209 SetMenuOptionFlags(menu, MENUFLAG_BUTTON_EXIT);
3210 DisplayMenu(menu, client, MENU_TIME_FOREVER);
3211}
3212
3213public sql_selectPlayerJumpTopMultiBhopCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3214{
3215 new client = data;
3216 decl String:szValue[128];
3217 decl String:szName[64];
3218 new Float:multibhoprecord;
3219 decl String:szSteamID[32];
3220 new String:szStrafes[32];
3221 new strafes;
3222 new Handle:menu = CreateMenu(MultiBhopJumpMenuHandler1);
3223 SetMenuTitle(menu, "Top 20 Multi-Bunnyhop\n Rank Distance Strafes Player");
3224 SetMenuPagination(menu, 5);
3225 if(SQL_HasResultSet(hndl))
3226 {
3227 new i = 1;
3228 while (SQL_FetchRow(hndl))
3229 {
3230 SQL_FetchString(hndl, 0, szName, 64);
3231 multibhoprecord = SQL_FetchFloat(hndl, 1);
3232 strafes = SQL_FetchInt(hndl, 2);
3233 SQL_FetchString(hndl, 3, szSteamID, 32);
3234 if (strafes < 10)
3235 Format(szStrafes, 32, " %i ", strafes);
3236 else
3237 Format(szStrafes, 32, "%i", strafes);
3238 if (i < 10)
3239 Format(szValue, 128, "[0%i.] %.3f units %s » %s", i, multibhoprecord,szStrafes, szName);
3240 else
3241 Format(szValue, 128, "[%i.] %.3f units %s » %s", i, multibhoprecord,szStrafes, szName);
3242 AddMenuItem(menu, szSteamID, szValue, ITEMDRAW_DEFAULT);
3243 i++;
3244 }
3245 }
3246 SetMenuOptionFlags(menu, MENUFLAG_BUTTON_EXIT);
3247 DisplayMenu(menu, client, MENU_TIME_FOREVER);
3248}
3249
3250public LjBlockJumpMenuHandler1(Handle:menu, MenuAction:action, param1, param2)
3251{
3252 if (action == MenuAction_Select)
3253 {
3254 JumpTopMenu(param1);
3255 }
3256 else if (action == MenuAction_End)
3257 {
3258 CloseHandle(menu);
3259 }
3260}
3261
3262public LjJumpMenuHandler1(Handle:menu, MenuAction:action, param1, param2)
3263{
3264 if (action == MenuAction_Select)
3265 {
3266 g_bdetailView[param1]=true;
3267 decl String:id[32];
3268 GetMenuItem(menu, param2, id, sizeof(id));
3269 db_viewJumpStats(param1, id);
3270 }
3271 else if (action == MenuAction_End)
3272 {
3273 CloseHandle(menu);
3274 }
3275}
3276public WjJumpMenuHandler1(Handle:menu, MenuAction:action, param1, param2)
3277{
3278 if (action == MenuAction_Select)
3279 {
3280 g_bdetailView[param1]=true;
3281 decl String:id[32];
3282 GetMenuItem(menu, param2, id, sizeof(id));
3283 db_viewJumpStats(param1, id);
3284 }
3285 else if (action == MenuAction_End)
3286 {
3287 CloseHandle(menu);
3288 }
3289}
3290public BhopJumpMenuHandler1(Handle:menu, MenuAction:action, param1, param2)
3291{
3292 if (action == MenuAction_Select)
3293 {
3294 g_bdetailView[param1]=true;
3295 decl String:id[32];
3296 GetMenuItem(menu, param2, id, sizeof(id));
3297 db_viewJumpStats(param1, id);
3298 }
3299 else if (action == MenuAction_End)
3300 {
3301 CloseHandle(menu);
3302 }
3303}
3304public DropBhopJumpMenuHandler1(Handle:menu, MenuAction:action, param1, param2)
3305{
3306 if (action == MenuAction_Select)
3307 {
3308 g_bdetailView[param1]=true;
3309 decl String:id[32];
3310 GetMenuItem(menu, param2, id, sizeof(id));
3311 db_viewJumpStats(param1, id);
3312 }
3313 else if (action == MenuAction_End)
3314 {
3315 CloseHandle(menu);
3316 }
3317}
3318
3319public MultiBhopJumpMenuHandler1(Handle:menu, MenuAction:action, param1, param2)
3320{
3321 if (action == MenuAction_Select)
3322 {
3323 g_bdetailView[param1]=true;
3324 decl String:id[32];
3325 GetMenuItem(menu, param2, id, sizeof(id));
3326 db_viewJumpStats(param1, id);
3327 }
3328 else if (action == MenuAction_End)
3329 {
3330 CloseHandle(menu);
3331 }
3332}
3333
3334public SQL_CheckCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3335{
3336}
3337
3338public db_viewJumpStats(client, String:szSteamId[32])
3339{
3340 decl String:szQuery[1024];
3341 Format(szQuery, 1024, sql_selectJumpStats, szSteamId);
3342 SQL_TQuery(g_hDb, SQL_ViewJumpStatsCallback, szQuery, client,DBPrio_Low);
3343}
3344
3345public SQL_ViewJumpStatsCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3346{
3347 new client = data;
3348 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3349 {
3350 decl String:szSteamId[32];
3351 decl String:szName[17];
3352 decl String:szVr[255];
3353
3354 //get the result
3355 SQL_FetchString(hndl, 0, szSteamId, MAX_NAME_LENGTH);
3356 SQL_FetchString(hndl, 1, szName, 17);
3357 new Float:bhoprecord = SQL_FetchFloat(hndl, 2);
3358 new Float:bhoppre = SQL_FetchFloat(hndl, 3);
3359 new Float:bhopmax = SQL_FetchFloat(hndl, 4);
3360 new bhopstrafes = SQL_FetchInt(hndl, 5);
3361 new bhopsync = SQL_FetchInt(hndl, 6);
3362 new Float:ljrecord = SQL_FetchFloat(hndl, 7);
3363 new Float:ljpre = SQL_FetchFloat(hndl, 8);
3364 new Float:ljmax = SQL_FetchFloat(hndl, 9);
3365 new ljstrafes = SQL_FetchInt(hndl, 10);
3366 new ljsync = SQL_FetchInt(hndl, 11);
3367 new Float:multibhoprecord = SQL_FetchFloat(hndl, 12);
3368 new Float:multibhoppre = SQL_FetchFloat(hndl, 13);
3369 new Float:multibhopmax = SQL_FetchFloat(hndl, 14);
3370 new multibhopstrafes = SQL_FetchInt(hndl, 15);
3371 new multibhopsync = SQL_FetchInt(hndl, 17);
3372 new Float:wjrecord = SQL_FetchFloat(hndl, 18);
3373 new Float:wjpre = SQL_FetchFloat(hndl, 19);
3374 new Float:wjmax = SQL_FetchFloat(hndl, 20);
3375 new wjstrafes = SQL_FetchInt(hndl, 21);
3376 new wjsync = SQL_FetchInt(hndl, 22);
3377 new Float:dropbhoprecord = SQL_FetchFloat(hndl, 23);
3378 new Float:dropbhoppre = SQL_FetchFloat(hndl, 24);
3379 new Float:dropbhopmax = SQL_FetchFloat(hndl, 25);
3380 new dropbhopstrafes = SQL_FetchInt(hndl, 26);
3381 new dropbhopsync = SQL_FetchInt(hndl, 27);
3382 new Float:ljheight = SQL_FetchFloat(hndl, 28);
3383 new Float:bhopheight = SQL_FetchFloat(hndl, 29);
3384 new Float:multibhopheight = SQL_FetchFloat(hndl, 30);
3385 new Float:dropbhopheight = SQL_FetchFloat(hndl, 31);
3386 new Float:wjheight = SQL_FetchFloat(hndl, 32);
3387 new ljblockdist = SQL_FetchInt(hndl, 33);
3388 new Float:ljblockrecord = SQL_FetchFloat(hndl, 34);
3389 new Float:ljblockpre = SQL_FetchFloat(hndl, 35);
3390 new Float:ljblockmax = SQL_FetchFloat(hndl, 36);
3391 new ljblockstrafes = SQL_FetchInt(hndl, 37);
3392 new ljblocksync = SQL_FetchInt(hndl, 38);
3393 new Float:ljblockheight = SQL_FetchFloat(hndl, 39);
3394
3395
3396 if (bhoprecord >0.0 || ljrecord > 0.0 || multibhoprecord > 0.0 || wjrecord > 0.0 || dropbhoprecord > 0.0 || ljblockdist > 0)
3397 {
3398 Format(szVr, 255, "JS: %s\nType Distance Strafes Pre Max Height Sync", szName);
3399 new Handle:menu = CreateMenu(JumpStatsMenuHandler);
3400 SetMenuTitle(menu, szVr);
3401 if (ljrecord > 0.0)
3402 {
3403 if (ljstrafes>9)
3404 Format(szVr, 255, "LJ: %.3f %i %.2f %.2f %.1f %i%c", ljrecord,ljstrafes,ljpre,ljmax,ljheight,ljsync,PERCENT);
3405 else
3406 Format(szVr, 255, "LJ: %.3f %i %.2f %.2f %.1f %i%c", ljrecord,ljstrafes,ljpre,ljmax,ljheight,ljsync,PERCENT);
3407 AddMenuItem(menu, szVr, szVr);
3408 }
3409 if (ljblockdist > 0)
3410 {
3411 if (ljstrafes>9)
3412 Format(szVr, 255, "BlockLJ: %i|%.1f %i %.2f %.2f %.1f %i%c", ljblockdist,ljblockrecord,ljblockstrafes,ljblockpre,ljblockmax,ljblockheight,ljblocksync,PERCENT);
3413 else
3414 Format(szVr, 255, "BlockLJ: %i|%.1f %i %.2f %.2f %.1f %i%c", ljblockdist,ljblockrecord,ljblockstrafes,ljblockpre,ljblockmax,ljblockheight,ljblocksync,PERCENT);
3415 AddMenuItem(menu, szVr, szVr);
3416 }
3417 if (bhoprecord > 0.0)
3418 {
3419 if (bhopstrafes>9)
3420 Format(szVr, 255, "Bhop: %.3f %i %.2f %.2f %.1f %i%c", bhoprecord,bhopstrafes,bhoppre,bhopmax,bhopheight,bhopsync,PERCENT);
3421 else
3422 Format(szVr, 255, "Bhop: %.3f %i %.2f %.2f %.1f %i%c", bhoprecord,bhopstrafes,bhoppre,bhopmax,bhopheight,bhopsync,PERCENT);
3423 AddMenuItem(menu, szVr, szVr);
3424 }
3425 if (dropbhoprecord > 0.0)
3426 {
3427 if (dropbhopstrafes>9)
3428 Format(szVr, 255, "DropBhop: %.3f %i %.2f %.2f %.1f %i%c", dropbhoprecord,dropbhopstrafes,dropbhoppre,dropbhopmax,dropbhopheight,dropbhopsync,PERCENT);
3429 else
3430 Format(szVr, 255, "DropBhop: %.3f %i %.2f %.2f %.1f %i%c", dropbhoprecord,dropbhopstrafes,dropbhoppre,dropbhopmax,dropbhopheight,dropbhopsync,PERCENT);
3431 AddMenuItem(menu, szVr, szVr);
3432 }
3433 if (multibhoprecord > 0.0)
3434 {
3435 if (multibhopstrafes>9)
3436 Format(szVr, 255, "MultiBhop: %.3f %i %.2f %.2f %.1f %i%c", multibhoprecord,multibhopstrafes,multibhoppre,multibhopmax,multibhopheight,multibhopsync,PERCENT);
3437 else
3438 Format(szVr, 255, "MultiBhop: %.3f %i %.2f %.2f %.1f %i%c", multibhoprecord,multibhopstrafes,multibhoppre,multibhopmax,multibhopheight,multibhopsync,PERCENT);
3439 AddMenuItem(menu, szVr, szVr);
3440 }
3441 if (wjrecord > 0.0)
3442 {
3443 if (wjstrafes>9)
3444 Format(szVr, 255, "WJ: %.3f %i %.2f %.2f %.1f %i%c", wjrecord,wjstrafes,wjpre,wjmax,wjheight,wjsync,PERCENT);
3445 else
3446 Format(szVr, 255, "WJ: %.3f %i %.2f %.2f %.1f %i%c", wjrecord,wjstrafes,wjpre,wjmax,wjheight,wjsync,PERCENT);
3447 AddMenuItem(menu, szVr, szVr);
3448 }
3449 //SetMenuPagination(menu, 5);
3450 SetMenuPagination(menu, MENU_NO_PAGINATION);
3451 SetMenuOptionFlags(menu, MENUFLAG_BUTTON_EXIT);
3452 DisplayMenu(menu, client, MENU_TIME_FOREVER);
3453 }
3454 else
3455 PrintToChat(client, "%t", "noJumpRecords",MOSSGREEN,WHITE);
3456
3457
3458 }
3459 else
3460 {
3461 PrintToChat(client, "%t", "noJumpRecords",MOSSGREEN,WHITE);
3462 }
3463}
3464
3465public JumpStatsMenuHandler(Handle:menu, MenuAction:action, param1,param2)
3466{
3467 if (action == MenuAction_Cancel || action == MenuAction_Select)
3468 {
3469 if (g_bdetailView[param1])
3470 {
3471 g_bdetailView[param1] = false;
3472 JumpTopMenu(param1);
3473 }
3474 }
3475}
3476
3477public db_viewPersonalLJRecord(client, String:szSteamId[32])
3478{
3479 decl String:szQuery[512];
3480 Format(szQuery, 512, sql_selectPlayerJumpLJ, szSteamId);
3481 SQL_TQuery(g_hDb, SQL_LJRecordCallback, szQuery, client,DBPrio_Low);
3482}
3483
3484public SQL_LJRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3485{
3486 new client = data;
3487 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3488 {
3489 g_js_fPersonal_Lj_Record[client] = SQL_FetchFloat(hndl, 2);
3490 if (g_js_fPersonal_Lj_Record[client] > -1.0)
3491 {
3492 decl String:szSteamId[32];
3493 decl String:szQuery[512];
3494 if (IsValidClient(client))
3495 {
3496 GetClientAuthString(client, szSteamId, 32);
3497 Format(szQuery, 255, sql_selectPlayerRankLj, szSteamId);
3498 SQL_TQuery(g_hDb, SQL_viewLjRecordCallback2, szQuery, client,DBPrio_Low);
3499 }
3500 }
3501 else
3502 {
3503 g_js_LjRank[client] = 99999999;
3504 g_js_fPersonal_Lj_Record[client] = -1.0;
3505 }
3506 }
3507 else
3508 {
3509 g_js_LjRank[client] = 99999999;
3510 g_js_fPersonal_Lj_Record[client] = -1.0;
3511 }
3512}
3513
3514public db_viewPersonalLJBlockRecord(client, String:szSteamId[32])
3515{
3516 decl String:szQuery[512];
3517 Format(szQuery, 512, sql_selectPlayerJumpLJBlock, szSteamId);
3518 SQL_TQuery(g_hDb, SQL_LJBlockRecordCallback, szQuery, client,DBPrio_Low);
3519}
3520
3521public db_viewPersonalBhopRecord(client, String:szSteamId[32])
3522{
3523 decl String:szQuery[512];
3524 Format(szQuery, 512, sql_selectPlayerJumpBhop, szSteamId);
3525 SQL_TQuery(g_hDb, SQL_ViewBhopRecordCallback, szQuery, client,DBPrio_Low);
3526}
3527
3528public db_viewPersonalDropBhopRecord(client, String:szSteamId[32])
3529{
3530 decl String:szQuery[512];
3531 Format(szQuery, 512, sql_selectPlayerJumpDropBhop, szSteamId);
3532 SQL_TQuery(g_hDb, SQL_ViewDropBhopRecordCallback, szQuery, client,DBPrio_Low);
3533}
3534
3535
3536public db_viewPersonalWeirdRecord(client, String:szSteamId[32])
3537{
3538 decl String:szQuery[512];
3539 Format(szQuery, 512, sql_selectPlayerJumpWJ, szSteamId);
3540 SQL_TQuery(g_hDb, SQL_ViewWeirdRecordCallback, szQuery, client,DBPrio_Low);
3541}
3542
3543stock FakePrecacheSound( const String:szPath[] )
3544{
3545 AddToStringTable( FindStringTable( "soundprecache" ), szPath );
3546}
3547
3548public db_viewPersonalMultiBhopRecord(client, String:szSteamId[32])
3549{
3550 decl String:szQuery[512];
3551 Format(szQuery, 512, sql_selectPlayerJumpMultiBhop, szSteamId);
3552 SQL_TQuery(g_hDb, SQL_ViewMultiBhopRecordCallback, szQuery, client,DBPrio_Low);
3553}
3554
3555public SQL_LJBlockRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3556{
3557 new client = data;
3558 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3559 {
3560 g_js_Personal_LjBlock_Record[client] = SQL_FetchInt(hndl, 2);
3561 g_js_fPersonal_LjBlockRecord_Dist[client] = SQL_FetchFloat(hndl, 3);
3562 if (g_js_Personal_LjBlock_Record[client] > -1)
3563 {
3564 decl String:szSteamId[32];
3565 decl String:szQuery[512];
3566 if (IsValidClient(client))
3567 {
3568 GetClientAuthString(client, szSteamId, 32);
3569 Format(szQuery, 255, sql_selectPlayerRankLjBlock, szSteamId);
3570 SQL_TQuery(g_hDb, SQL_viewLjBlockRecordCallback2, szQuery, client,DBPrio_Low);
3571 }
3572 }
3573 else
3574 {
3575 g_js_LjBlockRank[client] = 99999999;
3576 g_js_Personal_LjBlock_Record[client] = -1;
3577 g_js_fPersonal_LjBlockRecord_Dist[client] = -1.0;
3578 }
3579 }
3580 else
3581 {
3582 g_js_LjBlockRank[client] = 99999999;
3583 g_js_Personal_LjBlock_Record[client] = -1;
3584 g_js_fPersonal_LjBlockRecord_Dist[client] = -1.0;
3585 }
3586}
3587
3588public SQL_viewLjRecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
3589{
3590 new client = data;
3591 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3592 {
3593 g_js_LjRank[client]= SQL_GetRowCount(hndl);
3594 }
3595}
3596
3597public SQL_viewLjBlockRecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
3598{
3599 new client = data;
3600 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3601 {
3602 g_js_LjBlockRank[client]= SQL_GetRowCount(hndl);
3603 }
3604}
3605
3606public SQL_ViewBhopRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3607{
3608 new client = data;
3609 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3610 {
3611 g_js_fPersonal_Bhop_Record[client] = SQL_FetchFloat(hndl, 2);
3612 if (g_js_fPersonal_Bhop_Record[client] > -1.0)
3613 {
3614 decl String:szSteamId[32];
3615 decl String:szQuery[512];
3616 if (IsValidClient(client))
3617 {
3618 GetClientAuthString(client, szSteamId, 32);
3619 Format(szQuery, 255, sql_selectPlayerRankBhop, szSteamId);
3620 SQL_TQuery(g_hDb, SQL_viewBhopRecordCallback2, szQuery, client,DBPrio_Low);
3621 }
3622 }
3623 else
3624 {
3625 g_js_BhopRank[client] = 99999999;
3626 g_js_fPersonal_Bhop_Record[client] = -1.0;
3627 }
3628 }
3629 else
3630 {
3631 g_js_BhopRank[client] = 99999999;
3632 g_js_fPersonal_Bhop_Record[client] = -1.0;
3633 }
3634}
3635
3636public SQL_ViewDropBhopRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3637{
3638 new client = data;
3639 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3640 {
3641 g_js_fPersonal_DropBhop_Record[client] = SQL_FetchFloat(hndl, 2);
3642 if (g_js_fPersonal_DropBhop_Record[client] > -1.0)
3643 {
3644 decl String:szSteamId[32];
3645 decl String:szQuery[512];
3646
3647 if (IsValidClient(client))
3648 {
3649 GetClientAuthString(client, szSteamId, 32);
3650 Format(szQuery, 255, sql_selectPlayerRankDropBhop, szSteamId);
3651 SQL_TQuery(g_hDb, SQL_viewDropBhopRecordCallback2, szQuery, client,DBPrio_Low);
3652 }
3653
3654 }
3655 else
3656 {
3657 g_js_DropBhopRank[client] = 99999999;
3658 g_js_fPersonal_DropBhop_Record[client] = -1.0;
3659 }
3660 }
3661 else
3662 {
3663 g_js_DropBhopRank[client] = 99999999;
3664 g_js_fPersonal_DropBhop_Record[client] = -1.0;
3665 }
3666}
3667
3668public SQL_viewDropBhopRecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
3669{
3670 new client = data;
3671 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3672 g_js_DropBhopRank[client]= SQL_GetRowCount(hndl);
3673}
3674
3675public SQL_ViewWeirdRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3676{
3677 new client = data;
3678 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3679 {
3680 g_js_fPersonal_Wj_Record[client] = SQL_FetchFloat(hndl, 2);
3681 if (g_js_fPersonal_Wj_Record[client] > -1.0)
3682 {
3683 decl String:szSteamId[32];
3684 decl String:szQuery[512];
3685
3686 if (IsValidClient(client))
3687 {
3688 GetClientAuthString(client, szSteamId, 32);
3689 Format(szQuery, 255, sql_selectPlayerRankWJ, szSteamId);
3690 SQL_TQuery(g_hDb, SQL_viewWeirdRecordCallback2, szQuery, client,DBPrio_Low);
3691 }
3692
3693 }
3694 else
3695 {
3696 g_js_WjRank[client] = 99999999;
3697 g_js_fPersonal_Wj_Record[client] = -1.0;
3698 }
3699 }
3700 else
3701 {
3702 g_js_WjRank[client] = 99999999;
3703 g_js_fPersonal_Wj_Record[client] = -1.0;
3704 }
3705}
3706
3707public SQL_viewWeirdRecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
3708{
3709 new client = data;
3710 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3711 g_js_WjRank[client]= SQL_GetRowCount(hndl);
3712}
3713
3714public SQL_ViewMultiBhopRecordCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
3715{
3716 new client = data;
3717 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3718 {
3719 g_js_fPersonal_MultiBhop_Record[client] = SQL_FetchFloat(hndl, 2);
3720 if (g_js_fPersonal_MultiBhop_Record[client] > -1.0)
3721 {
3722 decl String:szSteamId[32];
3723 decl String:szQuery[512];
3724
3725 if (IsValidClient(client))
3726 {
3727 GetClientAuthString(client, szSteamId, 32);
3728 Format(szQuery, 255, sql_selectPlayerRankMultiBhop, szSteamId);
3729 SQL_TQuery(g_hDb, SQL_viewMultiBhopRecordCallback2, szQuery, client,DBPrio_Low);
3730 }
3731 }
3732 else
3733 {
3734 g_js_MultiBhopRank[client] = 99999999;
3735 g_js_fPersonal_MultiBhop_Record[client] = -1.0;
3736 }
3737 }
3738 else
3739 {
3740 g_js_MultiBhopRank[client] = 99999999;
3741 g_js_fPersonal_MultiBhop_Record[client] = -1.0;
3742 }
3743}
3744
3745public SQL_viewBhopRecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
3746{
3747 new client = data;
3748 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3749 g_js_BhopRank[client]= SQL_GetRowCount(hndl);
3750}
3751
3752public SQL_viewMultiBhopRecordCallback2(Handle:owner, Handle:hndl, const String:error[], any:data)
3753{
3754 new client = data;
3755 if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
3756 g_js_MultiBhopRank[client]= SQL_GetRowCount(hndl);
3757}
3758
3759//admin stuff
3760public Action:Admin_DropPlayerJump(client, args)
3761{
3762 db_dropPlayerJump(client);
3763 return Plugin_Handled;
3764}
3765
3766public Action:Admin_ResetAllLjRecords(client, args)
3767{
3768 decl String:szQuery[255];
3769 Format(szQuery, 255, "UPDATE playerjumpstats SET ljrecord=-1.0");
3770 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery);
3771 PrintToConsole(client, "lj records reseted.");
3772 for (new i = 1; i <= MaxClients; i++)
3773 {
3774 if (IsValidClient(i))
3775 {
3776 g_js_LjRank[i] = 99999999;
3777 g_js_fPersonal_Lj_Record[i] = -1.0;
3778 }
3779 }
3780 return Plugin_Handled;
3781}
3782
3783public Action:Admin_ResetAllWjRecords(client, args)
3784{
3785 decl String:szQuery[255];
3786 Format(szQuery, 255, "UPDATE playerjumpstats SET wjrecord=-1.0");
3787 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery);
3788 PrintToConsole(client, "wj records reseted.");
3789 for (new i = 1; i <= MaxClients; i++)
3790 {
3791 if (IsValidClient(i))
3792 {
3793 g_js_WjRank[i] = 99999999;
3794 g_js_fPersonal_Wj_Record[i] = -1.0;
3795 }
3796 }
3797 return Plugin_Handled;
3798}
3799
3800public Action:Admin_ResetAllBhopRecords(client, args)
3801{
3802 decl String:szQuery[255];
3803 Format(szQuery, 255, "UPDATE playerjumpstats SET bhoprecord=-1.0");
3804 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery);
3805 PrintToConsole(client, "bhop records reseted.");
3806 for (new i = 1; i <= MaxClients; i++)
3807 {
3808 if (IsValidClient(i))
3809 {
3810 g_js_BhopRank[i] = 99999999;
3811 g_js_fPersonal_Bhop_Record[i] = -1.0;
3812 }
3813 }
3814 return Plugin_Handled;
3815}
3816
3817public Action:Admin_ResetAllDropBhopRecords(client, args)
3818{
3819 decl String:szQuery[255];
3820 Format(szQuery, 255, "UPDATE playerjumpstats SET dropbhoprecord=-1.0");
3821 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery);
3822 PrintToConsole(client, "dropbhop records reseted.");
3823 for (new i = 1; i <= MaxClients; i++)
3824 {
3825 if (IsValidClient(i))
3826 {
3827 g_js_DropBhopRank[i] = 99999999;
3828 g_js_fPersonal_DropBhop_Record[i] = -1.0;
3829 }
3830 }
3831 return Plugin_Handled;
3832}
3833
3834public Action:Admin_ResetAllMultiBhopRecords(client, args)
3835{
3836 decl String:szQuery[255];
3837 Format(szQuery, 255, "UPDATE playerjumpstats SET multibhoprecord=-1.0");
3838 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery);
3839 PrintToConsole(client, "multibhop records reseted.");
3840 for (new i = 1; i <= MaxClients; i++)
3841 {
3842 if (IsValidClient(i))
3843 {
3844 g_js_MultiBhopRank[i] = 99999999;
3845 g_js_fPersonal_MultiBhop_Record[i] = -1.0;
3846 }
3847 }
3848 return Plugin_Handled;
3849}
3850
3851public Action:Admin_ResetAllLjBlockRecords(client, args)
3852{
3853 decl String:szQuery[255];
3854 Format(szQuery, 255, "UPDATE playerjumpstats SET ljblockdist=-1");
3855 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery);
3856 PrintToConsole(client, "ljblock records reseted.");
3857 for (new i = 1; i <= MaxClients; i++)
3858 {
3859 if (IsValidClient(i))
3860 {
3861 g_js_MultiBhopRank[i] = 99999999;
3862 g_js_fPersonal_MultiBhop_Record[i] = -1.0;
3863 }
3864 }
3865 return Plugin_Handled;
3866}
3867
3868public Action:Admin_ResetLjRecords(client, args)
3869{
3870 if(args == 0)
3871 {
3872 ReplyToCommand(client, "[KZ] Usage: sm_resetljrecord <steamid>");
3873 return Plugin_Handled;
3874 }
3875 if(args > 0)
3876 {
3877 decl String:szSteamID[128];
3878 decl String:szArg[128];
3879 Format(szSteamID, 128, "");
3880 for (new i = 1; i < 6; i++)
3881 {
3882 GetCmdArg(i, szArg, 128);
3883 if (!StrEqual(szArg, "", false))
3884 Format(szSteamID, 128, "%s%s", szSteamID, szArg);
3885 }
3886 db_resetPlayerLjRecord(client, szSteamID);
3887 }
3888 return Plugin_Handled;
3889}
3890
3891public Action:Admin_ResetLjBlockRecords(client, args)
3892{
3893 if(args == 0)
3894 {
3895 ReplyToCommand(client, "[KZ] Usage: sm_resetljblockrecord <steamid>");
3896 return Plugin_Handled;
3897 }
3898 if(args > 0)
3899 {
3900 decl String:szSteamID[128];
3901 decl String:szArg[128];
3902 Format(szSteamID, 128, "");
3903 for (new i = 1; i < 6; i++)
3904 {
3905 GetCmdArg(i, szArg, 128);
3906 if (!StrEqual(szArg, "", false))
3907 Format(szSteamID, 128, "%s%s", szSteamID, szArg);
3908 }
3909 db_resetPlayerLjBlockRecord(client, szSteamID);
3910 }
3911 return Plugin_Handled;
3912}
3913
3914public Action:Admin_ResetWjRecords(client, args)
3915{
3916 if(args == 0)
3917 {
3918 ReplyToCommand(client, "[KZ] Usage: sm_resetwjrecord <steamid>");
3919 return Plugin_Handled;
3920 }
3921 if(args > 0)
3922 {
3923 decl String:szSteamID[128];
3924 decl String:szArg[128];
3925 Format(szSteamID, 128, "");
3926 for (new i = 1; i < 6; i++)
3927 {
3928 GetCmdArg(i, szArg, 128);
3929 if (!StrEqual(szArg, "", false))
3930 Format(szSteamID, 128, "%s%s", szSteamID, szArg);
3931 }
3932 db_resetPlayerWJRecord(client, szSteamID);
3933 }
3934 return Plugin_Handled;
3935}
3936
3937public Action:Admin_ResetPlayerJumpstats(client, args)
3938{
3939 if(args == 0)
3940 {
3941 ReplyToCommand(client, "[KZ] Usage: sm_resetplayerjumpstats <steamid>");
3942 return Plugin_Handled;
3943 }
3944 if(args > 0)
3945 {
3946 decl String:szSteamID[128];
3947 decl String:szArg[128];
3948 Format(szSteamID, 128, "");
3949 for (new i = 1; i < 6; i++)
3950 {
3951 GetCmdArg(i, szArg, 128);
3952 if (!StrEqual(szArg, "", false))
3953 Format(szSteamID, 128, "%s%s", szSteamID, szArg);
3954 }
3955 db_resetPlayerJumpstats(client, szSteamID);
3956 }
3957 return Plugin_Handled;
3958}
3959
3960public Action:Admin_ResetDropBhopRecords(client, args)
3961{
3962 if(args == 0)
3963 {
3964 ReplyToCommand(client, "[KZ] Usage: sm_resetdropbhoprecord <steamid>");
3965 return Plugin_Handled;
3966 }
3967 if(args > 0)
3968 {
3969 decl String:szSteamID[128];
3970 decl String:szArg[128];
3971 Format(szSteamID, 128, "");
3972 for (new i = 1; i < 6; i++)
3973 {
3974 GetCmdArg(i, szArg, 128);
3975 if (!StrEqual(szArg, "", false))
3976 Format(szSteamID, 128, "%s%s", szSteamID, szArg);
3977 }
3978 db_resetPlayerDropBhopRecord(client, szSteamID);
3979 }
3980 return Plugin_Handled;
3981}
3982
3983
3984public Action:Admin_ResetBhopRecords(client, args)
3985{
3986 if(args == 0)
3987 {
3988 ReplyToCommand(client, "[KZ] Usage: sm_resetbhoprecord <steamid>");
3989 return Plugin_Handled;
3990 }
3991 if(args > 0)
3992 {
3993 decl String:szSteamID[128];
3994 decl String:szArg[128];
3995 Format(szSteamID, 128, "");
3996 for (new i = 1; i < 6; i++)
3997 {
3998 GetCmdArg(i, szArg, 128);
3999 if (!StrEqual(szArg, "", false))
4000 Format(szSteamID, 128, "%s%s", szSteamID, szArg);
4001 }
4002 db_resetPlayerBhopRecord(client, szSteamID);
4003 }
4004 return Plugin_Handled;
4005}
4006
4007public Action:Admin_ResetMultiBhopRecords(client, args)
4008{
4009 if(args == 0)
4010 {
4011 ReplyToCommand(client, "[KZ] Usage: sm_resetmultibhoprecord <steamid>");
4012 return Plugin_Handled;
4013 }
4014 if(args > 0)
4015 {
4016 decl String:szSteamID[128];
4017 decl String:szArg[128];
4018 Format(szSteamID, 128, "");
4019 for (new i = 1; i < 6; i++)
4020 {
4021 GetCmdArg(i, szArg, 128);
4022 if (!StrEqual(szArg, "", false))
4023 Format(szSteamID, 128, "%s%s", szSteamID, szArg);
4024 }
4025 db_resetPlayerMultiBhopRecord(client, szSteamID);
4026 }
4027 return Plugin_Handled;
4028}
4029
4030
4031public db_resetPlayerBhopRecord(client, String:steamid[128])
4032{
4033 decl String:szQuery[255];
4034 decl String:szsteamid[128*2+1];
4035 SQL_QuoteString(g_hDb, steamid, szsteamid, 128*2+1);
4036 Format(szQuery, 255, sql_resetBhopRecord, szsteamid);
4037 new Handle:pack = CreateDataPack();
4038 WritePackCell(pack, client);
4039 WritePackString(pack, steamid);
4040 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery, pack);
4041 PrintToConsole(client, "bhop record cleared (%s).", szsteamid);
4042 for (new i = 1; i <= MaxClients; i++)
4043 {
4044 if (IsValidClient(i))
4045 {
4046 decl String:szSteamId2[32];
4047 GetClientAuthString(i, szSteamId2, 32);
4048 if(StrEqual(szSteamId2,szsteamid))
4049 {
4050 g_js_BhopRank[i] = 99999999;
4051 g_js_fPersonal_Bhop_Record[i] = -1.0;
4052 }
4053 }
4054 }
4055}
4056
4057public db_resetPlayerDropBhopRecord(client, String:steamid[128])
4058{
4059 decl String:szQuery[255];
4060 decl String:szsteamid[128*2+1];
4061 SQL_QuoteString(g_hDb, steamid, szsteamid, 128*2+1);
4062 Format(szQuery, 255, sql_resetDropBhopRecord, szsteamid);
4063 new Handle:pack = CreateDataPack();
4064 WritePackCell(pack, client);
4065 WritePackString(pack, steamid);
4066 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery, pack);
4067 PrintToConsole(client, "dropbhop record cleared (%s).", szsteamid);
4068 for (new i = 1; i <= MaxClients; i++)
4069 {
4070 if (IsValidClient(i))
4071 {
4072 decl String:szSteamId2[32];
4073 GetClientAuthString(i, szSteamId2, 32);
4074 if(StrEqual(szSteamId2,szsteamid))
4075 {
4076 g_js_DropBhopRank[i] = 99999999;
4077 g_js_fPersonal_DropBhop_Record[i] = -1.0;
4078 }
4079 }
4080 }
4081}
4082
4083public db_resetPlayerWJRecord(client, String:steamid[128])
4084{
4085 decl String:szQuery[255];
4086 decl String:szsteamid[128*2+1];
4087 SQL_QuoteString(g_hDb, steamid, szsteamid, 128*2+1);
4088 Format(szQuery, 255, sql_resetWJRecord, szsteamid);
4089 new Handle:pack = CreateDataPack();
4090 WritePackCell(pack, client);
4091 WritePackString(pack, steamid);
4092 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery, pack);
4093 PrintToConsole(client, "wj record cleared (%s).", szsteamid);
4094 for (new i = 1; i <= MaxClients; i++)
4095 {
4096 if (IsValidClient(i))
4097 {
4098 decl String:szSteamId2[32];
4099 GetClientAuthString(i, szSteamId2, 32);
4100 if(StrEqual(szSteamId2,szsteamid))
4101 {
4102 g_js_WjRank[i] = 99999999;
4103 g_js_fPersonal_Wj_Record[i] = -1.0;
4104 }
4105 }
4106 }
4107}
4108
4109public db_resetPlayerJumpstats(client, String:steamid[128])
4110{
4111 decl String:szQuery[255];
4112 decl String:szsteamid[128*2+1];
4113 SQL_QuoteString(g_hDb, steamid, szsteamid, 128*2+1);
4114 Format(szQuery, 255, sql_resetJumpStats, szsteamid);
4115 new Handle:pack = CreateDataPack();
4116 WritePackCell(pack, client);
4117 WritePackString(pack, steamid);
4118 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery, pack);
4119 PrintToConsole(client, "jumpstats cleared (%s).", szsteamid);
4120 for (new i = 1; i <= MaxClients; i++)
4121 {
4122 if (IsValidClient(i))
4123 {
4124 decl String:szSteamId2[32];
4125 GetClientAuthString(i, szSteamId2, 32);
4126 if(StrEqual(szSteamId2,szsteamid))
4127 {
4128 g_js_MultiBhopRank[i] = 99999999;
4129 g_js_fPersonal_MultiBhop_Record[i] = -1.0;
4130 g_js_WjRank[i] = 99999999;
4131 g_js_fPersonal_Wj_Record[i] = -1.0;
4132 g_js_DropBhopRank[i] = 99999999;
4133 g_js_fPersonal_DropBhop_Record[i] = -1.0;
4134 g_js_BhopRank[i] = 99999999;
4135 g_js_fPersonal_Bhop_Record[i] = -1.0;
4136 g_js_LjRank[i] = 99999999;
4137 g_js_fPersonal_Lj_Record[i] = -1.0;
4138 }
4139 }
4140 }
4141}
4142
4143public db_resetPlayerMultiBhopRecord(client, String:steamid[128])
4144{
4145 decl String:szQuery[255];
4146 decl String:szsteamid[128*2+1];
4147 SQL_QuoteString(g_hDb, steamid, szsteamid, 128*2+1);
4148 Format(szQuery, 255, sql_resetMultiBhopRecord, szsteamid);
4149 new Handle:pack = CreateDataPack();
4150 WritePackCell(pack, client);
4151 WritePackString(pack, steamid);
4152 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery, pack);
4153 PrintToConsole(client, "multibhop record cleared (%s).", szsteamid);
4154 for (new i = 1; i <= MaxClients; i++)
4155 {
4156 if (IsValidClient(i))
4157 {
4158 decl String:szSteamId2[32];
4159 GetClientAuthString(i, szSteamId2, 32);
4160 if(StrEqual(szSteamId2,szsteamid))
4161 {
4162 g_js_MultiBhopRank[i] = 99999999;
4163 g_js_fPersonal_MultiBhop_Record[i] = -1.0;
4164 }
4165 }
4166 }
4167}
4168
4169public db_resetPlayerLjRecord(client, String:steamid[128])
4170{
4171 decl String:szQuery[255];
4172 decl String:szsteamid[128*2+1];
4173 SQL_QuoteString(g_hDb, steamid, szsteamid, 128*2+1);
4174 Format(szQuery, 255, sql_resetLjRecord, szsteamid);
4175 new Handle:pack = CreateDataPack();
4176 WritePackCell(pack, client);
4177 WritePackString(pack, steamid);
4178 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery, pack);
4179 PrintToConsole(client, "lj record cleared (%s).", szsteamid);
4180 for (new i = 1; i <= MaxClients; i++)
4181 {
4182 if (IsValidClient(i))
4183 {
4184 decl String:szSteamId2[32];
4185 GetClientAuthString(i, szSteamId2, 32);
4186 if(StrEqual(szSteamId2,szsteamid))
4187 {
4188 g_js_LjRank[i] = 99999999;
4189 g_js_fPersonal_Lj_Record[i] = -1.0;
4190 }
4191 }
4192 }
4193}
4194
4195public db_resetPlayerLjBlockRecord(client, String:steamid[128])
4196{
4197 decl String:szQuery[255];
4198 decl String:szsteamid[128*2+1];
4199 SQL_QuoteString(g_hDb, steamid, szsteamid, 128*2+1);
4200 Format(szQuery, 255, sql_resetLjBlockRecord, szsteamid);
4201 new Handle:pack = CreateDataPack();
4202 WritePackCell(pack, client);
4203 WritePackString(pack, steamid);
4204 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery, pack);
4205 PrintToConsole(client, "ljblock record cleared (%s).", szsteamid);
4206 for (new i = 1; i <= MaxClients; i++)
4207 {
4208 if (IsValidClient(i))
4209 {
4210 decl String:szSteamId2[32];
4211 GetClientAuthString(i, szSteamId2, 32);
4212 if(StrEqual(szSteamId2,szsteamid))
4213 {
4214 g_js_LjBlockRank[i] = 99999999;
4215 g_js_Personal_LjBlock_Record[i] = -1;
4216 }
4217 }
4218 }
4219}
4220
4221public db_dropPlayerJump(client)
4222{
4223 decl String:szQuery[255];
4224 Format(szQuery, 255, "UPDATE playerjumpstats SET wjrecord=-1.0, bhoprecord=-1.0, ljrecord=-1.0,dropbhoprecord=-1.0,multibhoprecord=-1.0");
4225 SQL_TQuery(g_hDb, SQL_CheckCallback, szQuery);
4226 PrintToConsole(client, "jumpstats records reseted.");
4227 for (new i = 1; i <= MaxClients; i++)
4228 {
4229 if (IsValidClient(i))
4230 {
4231 g_js_LjRank[i] = 99999999;
4232 g_js_fPersonal_Lj_Record[i] = -1.0;
4233 g_js_WjRank[i] = 99999999;
4234 g_js_fPersonal_Wj_Record[i] = -1.0;
4235 g_js_BhopRank[i] = 99999999;
4236 g_js_fPersonal_Bhop_Record[i] = -1.0;
4237 g_js_DropBhopRank[i] = 99999999;
4238 g_js_fPersonal_DropBhop_Record[i] = -1.0;
4239 g_js_MultiBhopRank[i] = 99999999;
4240 g_js_fPersonal_MultiBhop_Record[i] = -1.0;
4241 }
4242 }
4243}