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