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