From 00feb624c2c78c94d2780ce694eff0226379f5d2 Mon Sep 17 00:00:00 2001 From: rtldg Date: Wed, 23 Jul 2025 23:06:24 +0000 Subject: [PATCH 01/10] Fix the on-ground 0.5s start-timer check from 89e97dfd3d5710ec5c25bafa78f0ded2c05d15a9 --- addons/sourcemod/scripting/shavit-core.sp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/addons/sourcemod/scripting/shavit-core.sp b/addons/sourcemod/scripting/shavit-core.sp index cd91bb1e..98aad5f1 100644 --- a/addons/sourcemod/scripting/shavit-core.sp +++ b/addons/sourcemod/scripting/shavit-core.sp @@ -2569,10 +2569,15 @@ bool CanStartTimer(int client, int track, bool skipGroundCheck) if (skipGroundTimer) return true; - int halfSecOfTicks = RoundFloat(0.5 / GetTickInterval()); - int onGroundTicks = gI_LastTickcount[client] - gI_FirstTouchedGround[client]; + if (gI_FirstTouchedGround[client] > 0) + { + int halfSecOfTicks = RoundFloat(0.5 / GetTickInterval()); + int onGroundTicks = gI_LastTickcount[client] - gI_FirstTouchedGround[client]; - return onGroundTicks >= halfSecOfTicks; + return onGroundTicks >= halfSecOfTicks; + } + + return false; } void StartTimer(int client, int track, bool skipGroundCheck) @@ -3672,6 +3677,11 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 } } + if (!bOnGround) + { + gI_FirstTouchedGround[client] = 0; + } + // This can be bypassed by spamming +duck on CSS which causes `iGroundEntity` to be `-1` here... // (e.g. an autobhop + velocity_limit style...) // m_hGroundEntity changes from 0 -> -1 same tick which causes problems and I'm not sure what the best way / place to handle that is... From 128940ff193e2b0ff22c6cc8eaa660e7b7883a6f Mon Sep 17 00:00:00 2001 From: rtldg Date: Fri, 25 Jul 2025 01:17:07 +0000 Subject: [PATCH 02/10] Fix the on-ground 0.5s start-timer even further dot dot dot --- addons/sourcemod/scripting/shavit-core.sp | 46 ++++++++++++++++++----- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/addons/sourcemod/scripting/shavit-core.sp b/addons/sourcemod/scripting/shavit-core.sp index 98aad5f1..6d3362bc 100644 --- a/addons/sourcemod/scripting/shavit-core.sp +++ b/addons/sourcemod/scripting/shavit-core.sp @@ -92,7 +92,8 @@ Handle gH_Forwards_OnProcessMovementPost = null; // player timer variables timer_snapshot_t gA_Timers[MAXPLAYERS+1]; bool gB_Auto[MAXPLAYERS+1]; -int gI_FirstTouchedGround[MAXPLAYERS+1]; +// 0 is in air, 1 or greater is on ground, -1 means client was on ground with zero...ish... velocity +int gI_FirstTouchedGroundForStartTimer[MAXPLAYERS+1]; int gI_LastTickcount[MAXPLAYERS+1]; // these are here until the compiler bug is fixed @@ -2569,10 +2570,15 @@ bool CanStartTimer(int client, int track, bool skipGroundCheck) if (skipGroundTimer) return true; - if (gI_FirstTouchedGround[client] > 0) + if (gI_FirstTouchedGroundForStartTimer[client] < 0) + { + // was on ground with zero...ish... velocity... + return true; + } + else if (gI_FirstTouchedGroundForStartTimer[client] > 0) { int halfSecOfTicks = RoundFloat(0.5 / GetTickInterval()); - int onGroundTicks = gI_LastTickcount[client] - gI_FirstTouchedGround[client]; + int onGroundTicks = gI_LastTickcount[client] - gI_FirstTouchedGroundForStartTimer[client]; return onGroundTicks >= halfSecOfTicks; } @@ -2769,7 +2775,7 @@ public void OnClientPutInServer(int client) gA_Timers[client].fNextFrameTime = 0.0; gA_Timers[client].fplayer_speedmod = 1.0; gS_DeleteMap[client][0] = 0; - gI_FirstTouchedGround[client] = 0; + gI_FirstTouchedGroundForStartTimer[client] = 0; gI_LastTickcount[client] = 0; gI_HijackFrames[client] = 0; gI_LastPrintedSteamID[client] = 0; @@ -3652,10 +3658,35 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 gI_LastTickcount[client] = tickcount; + if (bOnGround) + { + if (gI_FirstTouchedGroundForStartTimer[client] == 0) + { + // just landed (or teleported to the ground or whatever) + gI_FirstTouchedGroundForStartTimer[client] = tickcount; + } + + if (gI_FirstTouchedGroundForStartTimer[client] > 0) + { + float fSpeed[3]; + GetEntPropVector(client, Prop_Data, "m_vecAbsVelocity", fSpeed); + + // zero...ish... velocity... (squared-ish (cubed?)) + if (GetVectorLength(fSpeed, true) <= 1000.0) + { + gI_FirstTouchedGroundForStartTimer[client] = -1; + } + } + } + else + { + gI_FirstTouchedGroundForStartTimer[client] = 0; + } + if(bOnGround && !gA_Timers[client].bOnGround) { gA_Timers[client].iLandingTick = tickcount; - gI_FirstTouchedGround[client] = tickcount; + gI_FirstTouchedGroundForStartTimer[client] = tickcount; if (gEV_Type != Engine_TF2 && GetStyleSettingBool(gA_Timers[client].bsStyle, "easybhop")) { @@ -3677,11 +3708,6 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 } } - if (!bOnGround) - { - gI_FirstTouchedGround[client] = 0; - } - // This can be bypassed by spamming +duck on CSS which causes `iGroundEntity` to be `-1` here... // (e.g. an autobhop + velocity_limit style...) // m_hGroundEntity changes from 0 -> -1 same tick which causes problems and I'm not sure what the best way / place to handle that is... From 0ebfa900b9468c6413ebf10b61dd35cc27d20e34 Mon Sep 17 00:00:00 2001 From: rtldg Date: Thu, 31 Jul 2025 02:11:42 +0000 Subject: [PATCH 03/10] =?UTF-8?q?bump=20to=20srcwr=F0=9F=92=BE=20v2.0.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index feffdd3b..82da0e2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,8 +36,8 @@ jobs: wget https://github.com/srcwr/eventqueuefixfix/releases/download/v1.0.1/eventqueuefixfix-v1.0.1-def5b0e-windows-x32.zip unzip eventqueuefixfix-v1.0.1-def5b0e-windows-x32.zip "addons/sourcemod/extensions/*" rm "addons/sourcemod/extensions/eventqueuefixfix.pdb" - wget https://github.com/srcwr/srcwrfloppy/releases/download/v2.0.3/srcwrfloppy-v2.0.3.zip - unzip -qO UTF-8 srcwrfloppy-v2.0.3.zip "addons/sourcemod/extensions/*" + wget https://github.com/srcwr/srcwrfloppy/releases/download/v2.0.4/srcwrfloppy-v2.0.4.zip + unzip -qO UTF-8 srcwrfloppy-v2.0.4.zip "addons/sourcemod/extensions/*" rm "addons/sourcemod/extensions/srcwr💾.pdb" - name: Run compiler From 71c674663f1948c05cb36032dcc691a4c41d1b50 Mon Sep 17 00:00:00 2001 From: normalamron Date: Sat, 9 Aug 2025 22:15:33 +0300 Subject: [PATCH 04/10] prevent prac warning spam in start zone --- addons/sourcemod/scripting/shavit-core.sp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sourcemod/scripting/shavit-core.sp b/addons/sourcemod/scripting/shavit-core.sp index 6d3362bc..2c8a3da6 100644 --- a/addons/sourcemod/scripting/shavit-core.sp +++ b/addons/sourcemod/scripting/shavit-core.sp @@ -2301,7 +2301,7 @@ public int Native_SetPracticeMode(Handle handler, int numParams) bool practice = view_as(GetNativeCell(2)); bool alert = view_as(GetNativeCell(3)); - if(alert && practice && !gA_Timers[client].bPracticeMode && (!gB_HUD || (Shavit_GetHUDSettings(client) & HUD_NOPRACALERT) == 0)) + if(alert && practice && !gA_Timers[client].bPracticeMode && (!gB_HUD || (Shavit_GetHUDSettings(client) & HUD_NOPRACALERT) == 0) && !Shavit_InsideZone(client, Zone_Start, -1)) { Shavit_PrintToChat(client, "%T", "PracticeModeAlert", client, gS_ChatStrings.sWarning, gS_ChatStrings.sText); } From 1993c22112061248ce079602f410d8ef7bc231ca Mon Sep 17 00:00:00 2001 From: rtldg Date: Tue, 30 Sep 2025 23:32:24 +0000 Subject: [PATCH 05/10] changelog moment --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c047517..9f26d45b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,11 @@ Note: Dates are UTC+0. -# v3.?.? - ? - 2025-0?-? - rtldg +# v3.?.? - ? - 2025-??-? - rtldg what will go here? hmm i wonder... maybe vscript pull request? maybe updating tf2 gamedata because i forgot? who knows... +thank pixel for finding that the 0.5s on-ground start-timer thing wasn't working + # v3.5.1 - small things - 2025-06-24 - rtldg From 7d3913bc3e52ef8249ad6733af70d767a2257230 Mon Sep 17 00:00:00 2001 From: mourningsickness Date: Tue, 30 Sep 2025 16:33:03 -0700 Subject: [PATCH 06/10] add !worldrecord/!wr aliases (!serverrecord/!sr) (#1257) --- addons/sourcemod/scripting/shavit-wr.sp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/addons/sourcemod/scripting/shavit-wr.sp b/addons/sourcemod/scripting/shavit-wr.sp index a09231e0..d05156b3 100644 --- a/addons/sourcemod/scripting/shavit-wr.sp +++ b/addons/sourcemod/scripting/shavit-wr.sp @@ -187,10 +187,15 @@ public void OnPluginStart() // player commands RegConsoleCmd("sm_wr", Command_WorldRecord, "View the leaderboard of a map. Usage: sm_wr [map]"); RegConsoleCmd("sm_worldrecord", Command_WorldRecord, "View the leaderboard of a map. Usage: sm_worldrecord [map]"); + RegConsoleCmd("sm_sr", Command_WorldRecord, "View the leaderboard of a map. Usage: sm_sr [map]"); + RegConsoleCmd("sm_serverrecord", Command_WorldRecord, "View the leaderboard of a map. Usage: sm_serverrecord [map]"); RegConsoleCmd("sm_bwr", Command_WorldRecord, "View the leaderboard of a map. Usage: sm_bwr [map] [bonus number]"); RegConsoleCmd("sm_bworldrecord", Command_WorldRecord, "View the leaderboard of a map. Usage: sm_bworldrecord [map] [bonus number]"); RegConsoleCmd("sm_bonusworldrecord", Command_WorldRecord, "View the leaderboard of a map. Usage: sm_bonusworldrecord [map] [bonus number]"); + RegConsoleCmd("sm_bsr", Command_WorldRecord, "View the leaderboard of a map. Usage: sm_bsr [map] [bonus number]"); + RegConsoleCmd("sm_bserverrecord", Command_WorldRecord, "View the leaderboard of a map. Usage: sm_bserverrecord [map] [bonus number]"); + RegConsoleCmd("sm_bonusserverrecord", Command_WorldRecord, "View the leaderboard of a map. Usage: sm_bonusserverrecord [map] [bonus number]"); RegConsoleCmd("sm_recent", Command_RecentRecords, "View the recent #1 times set."); RegConsoleCmd("sm_recentrecords", Command_RecentRecords, "View the recent #1 times set."); @@ -438,9 +443,17 @@ void RegisterWRCommands(int style) gSM_StyleCommands.SetValue(sCommand, style); RegConsoleCmd(sCommand, Command_WorldRecord_Style, sDescription); + FormatEx(sCommand, sizeof(sCommand), "sm_sr%s", sStyleCommands[x]); + gSM_StyleCommands.SetValue(sCommand, style); + RegConsoleCmd(sCommand, Command_WorldRecord_Style, sDescription); + FormatEx(sCommand, sizeof(sCommand), "sm_bwr%s", sStyleCommands[x]); gSM_StyleCommands.SetValue(sCommand, style); RegConsoleCmd(sCommand, Command_WorldRecord_Style, sDescription); + + FormatEx(sCommand, sizeof(sCommand), "sm_bsr%s", sStyleCommands[x]); + gSM_StyleCommands.SetValue(sCommand, style); + RegConsoleCmd(sCommand, Command_WorldRecord_Style, sDescription); } } From a350d7982ca92c0ebf592d4d2040432c2677ff5e Mon Sep 17 00:00:00 2001 From: mourningsickness Date: Tue, 30 Sep 2025 16:44:38 -0700 Subject: [PATCH 07/10] Add tier selection menu to mapsleft and mapsdone menus (with "All" option, for current functionality) (#1262) --- addons/sourcemod/scripting/shavit-stats.sp | 103 ++++++++++++++++-- .../translations/shavit-stats.phrases.txt | 4 + 2 files changed, 96 insertions(+), 11 deletions(-) diff --git a/addons/sourcemod/scripting/shavit-stats.sp b/addons/sourcemod/scripting/shavit-stats.sp index 25bdcb3d..0ab423f2 100644 --- a/addons/sourcemod/scripting/shavit-stats.sp +++ b/addons/sourcemod/scripting/shavit-stats.sp @@ -56,6 +56,7 @@ int gI_MapType[MAXPLAYERS+1]; int gI_Style[MAXPLAYERS+1]; int gI_MenuPos[MAXPLAYERS+1]; int gI_Track[MAXPLAYERS+1]; +int gI_Tier[MAXPLAYERS+1]; int gI_TargetSteamID[MAXPLAYERS+1]; char gS_TargetName[MAXPLAYERS+1][MAX_NAME_LENGTH]; @@ -753,10 +754,47 @@ public int MenuHandler_MapsDoneLeft_Track(Menu menu, MenuAction action, int para { if(action == MenuAction_Select) { - char sInfo[8]; + char sInfo[8], sTier[16]; menu.GetItem(param2, sInfo, 8); gI_Track[param1] = StringToInt(sInfo); + if(gB_Rankings) + { + Menu submenu = new Menu(MenuHandler_MapsDoneLeft_Tier); + submenu.SetTitle("%T\n ", "SelectTier", param1); + + submenu.AddItem("0", "All"); + + for(int i = 1; i <= 10; ++i) + { + IntToString(i, sInfo, 8); + FormatEx(sTier, 16, "Tier %d", i); + submenu.AddItem(sInfo, sTier); + } + + submenu.Display(param1, MENU_TIME_FOREVER); + } + else + { + ShowMaps(param1); + } + } + else if(action == MenuAction_End) + { + delete menu; + } + + return 0; +} + +public int MenuHandler_MapsDoneLeft_Tier(Menu menu, MenuAction action, int param1, int param2) +{ + if(action == MenuAction_Select) + { + char sInfo[8]; + menu.GetItem(param2, sInfo, 8); + gI_Tier[param1] = StringToInt(sInfo); + ShowMaps(param1); } else if(action == MenuAction_End) @@ -1180,7 +1218,7 @@ public int MenuHandler_TypeHandler(Menu menu, MenuAction action, int param1, int { if(action == MenuAction_Select) { - char sInfo[32]; + char sInfo[32], sTier[16]; menu.GetItem(param2, sInfo, 32); char sExploded[2][4]; @@ -1189,7 +1227,26 @@ public int MenuHandler_TypeHandler(Menu menu, MenuAction action, int param1, int gI_Track[param1] = StringToInt(sExploded[0]); gI_MapType[param1] = StringToInt(sExploded[1]); - ShowMaps(param1); + if(gB_Rankings) + { + Menu submenu = new Menu(MenuHandler_MapsDoneLeft_Tier); + submenu.SetTitle("%T\n ", "SelectTier", param1); + + submenu.AddItem("0", "All"); + + for(int i = 1; i <= 10; ++i) + { + IntToString(i, sInfo, 8); + FormatEx(sTier, 16, "Tier %d", i); + submenu.AddItem(sInfo, sTier); + } + + submenu.Display(param1, MENU_TIME_FOREVER); + } + else + { + ShowMaps(param1); + } } else if(action == MenuAction_Cancel && param2 == MenuCancel_ExitBack) { @@ -1210,21 +1267,39 @@ void ShowMaps(int client) return; } - char sQuery[512]; + char sQuery[512], tierStr[32]; + + if(gI_Tier[client] > 0) + { + FormatEx(tierStr, 32, " AND t.tier = %d", gI_Tier[client]); + } + else + { + gI_Tier[client] = 0; + } if(gI_MapType[client] == MAPSDONE) { - FormatEx(sQuery, 512, - "SELECT a.map, a.time, a.jumps, a.id, COUNT(b.map) + 1 as 'rank', a.points FROM %splayertimes a LEFT JOIN %splayertimes b ON a.time > b.time AND a.map = b.map AND a.style = b.style AND a.track = b.track WHERE a.auth = %d AND a.style = %d AND a.track = %d GROUP BY a.map, a.time, a.jumps, a.id, a.points ORDER BY a.%s;", - gS_MySQLPrefix, gS_MySQLPrefix, gI_TargetSteamID[client], gI_Style[client], gI_Track[client], (gB_Rankings)? "points DESC":"map"); + if(gB_Rankings) + { + FormatEx(sQuery, 512, + "SELECT a.map, a.time, a.jumps, a.id, COUNT(b.map) + 1 as 'rank', a.points FROM %splayertimes a LEFT JOIN %splayertimes b ON a.time > b.time AND a.map = b.map AND a.style = b.style AND a.track = b.track LEFT JOIN %smaptiers t ON a.map = t.map WHERE a.auth = %d AND a.style = %d AND a.track = %d%s GROUP BY a.map, a.time, a.jumps, a.id, a.points ORDER BY a.points DESC;", + gS_MySQLPrefix, gS_MySQLPrefix, gS_MySQLPrefix, gI_TargetSteamID[client], gI_Style[client], gI_Track[client], tierStr); + } + else + { + FormatEx(sQuery, 512, + "SELECT a.map, a.time, a.jumps, a.id, COUNT(b.map) + 1 as 'rank', a.points FROM %splayertimes a LEFT JOIN %splayertimes b ON a.time > b.time AND a.map = b.map AND a.style = b.style AND a.track = b.track WHERE a.auth = %d AND a.style = %d AND a.track = %d GROUP BY a.map, a.time, a.jumps, a.id, a.points ORDER BY a.map;", + gS_MySQLPrefix, gS_MySQLPrefix, gI_TargetSteamID[client], gI_Style[client], gI_Track[client]); + } } else { if(gB_Rankings) { FormatEx(sQuery, 512, - "SELECT DISTINCT m.map, t.tier FROM %smapzones m LEFT JOIN %smaptiers t ON m.map = t.map WHERE m.type = 0 AND m.track = %d AND m.map NOT IN (SELECT DISTINCT map FROM %splayertimes WHERE auth = %d AND style = %d AND track = %d) ORDER BY m.map;", - gS_MySQLPrefix, gS_MySQLPrefix, gI_Track[client], gS_MySQLPrefix, gI_TargetSteamID[client], gI_Style[client], gI_Track[client]); + "SELECT DISTINCT m.map, t.tier FROM %smapzones m LEFT JOIN %smaptiers t ON m.map = t.map WHERE m.type = 0 AND m.track = %d%s AND m.map NOT IN (SELECT DISTINCT map FROM %splayertimes WHERE auth = %d AND style = %d AND track = %d) ORDER BY m.map;", + gS_MySQLPrefix, gS_MySQLPrefix, gI_Track[client], tierStr, gS_MySQLPrefix, gI_TargetSteamID[client], gI_Style[client], gI_Track[client]); } else { @@ -1328,13 +1403,19 @@ public void ShowMapsCallback(Database db, DBResultSet results, const char[] erro menu.AddItem(sRecordID, sDisplay); } + char sTier[8]; + if(gI_Tier[client] > 0) + { + FormatEx(sTier, 8, "T%d ", gI_Tier[client]); + } + if(gI_MapType[client] == MAPSDONE) { - menu.SetTitle("%T (%s)", "MapsDoneFor", client, gS_StyleStrings[gI_Style[client]].sShortName, gS_TargetName[client], rows, sTrack); + menu.SetTitle("%s%T (%s)", sTier, "MapsDoneFor", client, gS_StyleStrings[gI_Style[client]].sShortName, gS_TargetName[client], rows, sTrack); } else { - menu.SetTitle("%T (%s)", "MapsLeftFor", client, gS_StyleStrings[gI_Style[client]].sShortName, gS_TargetName[client], rows, sTrack); + menu.SetTitle("%s%T (%s)", sTier, "MapsLeftFor", client, gS_StyleStrings[gI_Style[client]].sShortName, gS_TargetName[client], rows, sTrack); } if(menu.ItemCount == 0) diff --git a/addons/sourcemod/translations/shavit-stats.phrases.txt b/addons/sourcemod/translations/shavit-stats.phrases.txt index c0c0f749..37830648 100644 --- a/addons/sourcemod/translations/shavit-stats.phrases.txt +++ b/addons/sourcemod/translations/shavit-stats.phrases.txt @@ -16,6 +16,10 @@ { "en" "Select timer track:" } + "SelectTier" + { + "en" "Select map tier:" + } "MapsDone" { "en" "Maps done" From 7cbb25054126f7bf331fb2f70ceb77525774decf Mon Sep 17 00:00:00 2001 From: rtldg Date: Tue, 30 Sep 2025 23:57:30 +0000 Subject: [PATCH 08/10] Make it easier to change the max tier --- addons/sourcemod/scripting/shavit-rankings.sp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/addons/sourcemod/scripting/shavit-rankings.sp b/addons/sourcemod/scripting/shavit-rankings.sp index 34dcafc7..6f37e457 100644 --- a/addons/sourcemod/scripting/shavit-rankings.sp +++ b/addons/sourcemod/scripting/shavit-rankings.sp @@ -631,9 +631,11 @@ public Action Command_SetTier(int client, int args) int tier = StringToInt(sArg); - if(args == 0 || tier < 1 || tier > 10) + int maxtier = GetMaxTier(); + + if(args == 0 || tier < 1 || tier > maxtier) { - ReplyToCommand(client, "%T", "ArgumentsMissing", client, "sm_settier (1-10) [map]"); + ReplyToCommand(client, "%T", "ArgumentsMissing", client, "sm_settier (1-%d) [map]", maxtier); return Plugin_Handled; } @@ -1722,3 +1724,10 @@ public void SQL_DeleteMap_Callback(Database db, DBResultSet results, const char[ UpdateAllPoints(true); } } + +int GetMaxTier() +{ + float val = 10.0; + gCV_DefaultTier.GetBounds(ConVarBound_Upper, val); + return RoundToFloor(val); +} From 133c4e5b125fa942159fcadbe792982e2a6fe13f Mon Sep 17 00:00:00 2001 From: mourningsickness Date: Tue, 7 Oct 2025 16:55:27 -0700 Subject: [PATCH 09/10] shavit-hud.sp - add perf% to center hud (#1259) Co-authored-by: rtldg --- addons/sourcemod/scripting/include/shavit/hud.inc | 1 + addons/sourcemod/scripting/shavit-hud.sp | 15 ++++++++++++++- .../sourcemod/translations/shavit-hud.phrases.txt | 4 ++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/addons/sourcemod/scripting/include/shavit/hud.inc b/addons/sourcemod/scripting/include/shavit/hud.inc index b08a03c9..965052f9 100644 --- a/addons/sourcemod/scripting/include/shavit/hud.inc +++ b/addons/sourcemod/scripting/include/shavit/hud.inc @@ -42,6 +42,7 @@ #define HUD_GLOCK (1 << 14) // makes you spawn with a Glock #define HUD_DEBUGTARGETNAME (1 << 15) // admin option to show current targetname & classname #define HUD_SPECTATORSDEAD (1 << 16) // for only showing spectators list when you're dead/spectating. +#define HUD_PERFS_CENTER (1 << 17) // for the perf percentage in the center hud. e.g. "Jumps: 20 (66.6%)" // HUD2 - these settings will *disable* elements for the main hud #define HUD2_TIME (1 << 0) diff --git a/addons/sourcemod/scripting/shavit-hud.sp b/addons/sourcemod/scripting/shavit-hud.sp index c50b421f..bc0476fa 100644 --- a/addons/sourcemod/scripting/shavit-hud.sp +++ b/addons/sourcemod/scripting/shavit-hud.sp @@ -209,6 +209,7 @@ public void OnPluginStart() ..."HUD_USP 8192\n" ..."HUD_GLOCK 16384\n" ..."HUD_SPECTATORSDEAD 65536\n" + ..."HUD_PERFS_CENTER 131072\n" ); IntToString(HUD_DEFAULT2, defaultHUD, 8); @@ -776,6 +777,10 @@ Action ShowHUDMenu(int client, int item) FormatEx(sHudItem, 64, "%T", "HudPerfs", client); menu.AddItem(sInfo, sHudItem); + FormatEx(sInfo, 16, "!%d", HUD_PERFS_CENTER); + FormatEx(sHudItem, 64, "%T", "HudPerfsCenter", client); + menu.AddItem(sInfo, sHudItem); + FormatEx(sInfo, 16, "@%d", HUD2_STYLE); FormatEx(sHudItem, 64, "%T", "HudStyleText", client); menu.AddItem(sInfo, sHudItem); @@ -1369,7 +1374,15 @@ int AddHUDToBuffer_Source2013(int client, huddata_t data, char[] buffer, int max if((gI_HUD2Settings[client] & HUD2_JUMPS) == 0) { - FormatEx(sLine, 128, "%T: %d", "HudJumpsText", client, data.iJumps); + if (!Shavit_GetStyleSettingBool(data.iStyle, "autobhop") && (gI_HUDSettings[client] & HUD_PERFS_CENTER)) + { + FormatEx(sLine, 128, "%T: %d (%.1f%)", "HudJumpsText", client, data.iJumps, Shavit_GetPerfectJumps(data.iTarget)); + } + else + { + FormatEx(sLine, 128, "%T: %d", "HudJumpsText", client, data.iJumps); + } + AddHUDLine(buffer, maxlen, sLine, iLines); } diff --git a/addons/sourcemod/translations/shavit-hud.phrases.txt b/addons/sourcemod/translations/shavit-hud.phrases.txt index dea5c879..020e20b4 100644 --- a/addons/sourcemod/translations/shavit-hud.phrases.txt +++ b/addons/sourcemod/translations/shavit-hud.phrases.txt @@ -85,6 +85,10 @@ { "en" "Perfect jumps" } + "HudPerfsCenter" + { + "en" "Perfect jumps (center hud)" + } "HudDefaultPistol" { "en" "Default Pistol: 1=USP 2=Glock" From 21a7b58c82c98136fbdd43c13ba33090241642f5 Mon Sep 17 00:00:00 2001 From: haooy <45737655+xhaooy@users.noreply.github.com> Date: Fri, 19 Sep 2025 17:30:08 +0200 Subject: [PATCH 10/10] Reset players hp when needed Reset players hp when needed --- addons/sourcemod/scripting/shavit-misc.sp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sourcemod/scripting/shavit-misc.sp b/addons/sourcemod/scripting/shavit-misc.sp index ccf26fb9..1f5739f3 100644 --- a/addons/sourcemod/scripting/shavit-misc.sp +++ b/addons/sourcemod/scripting/shavit-misc.sp @@ -2454,7 +2454,7 @@ public void Shavit_OnRestart(int client, int track) { SetEntPropFloat(client, Prop_Send, "m_flStamina", 0.0); - if (gCV_RestartWithFullHP.BoolValue) + if (gCV_RestartWithFullHP.BoolValue && GetClientHealth(client) <= 100) { SetEntityHealth(client, 100); SetEntProp(client, Prop_Send, "m_ArmorValue", 100);