Compare commits

...

6 Commits

Author SHA1 Message Date
normalamron
1e40764161
Merge 5f925bc26d into 21a7b58c82 2025-10-08 00:23:14 +00:00
haooy
21a7b58c82 Reset players hp when needed
Some checks failed
Compile / Build SM ${{ matrix.sm-version }} (1.12) (push) Has been cancelled
Compile / Release (push) Has been cancelled
Reset players hp when needed
2025-10-08 00:05:10 +00:00
mourningsickness
133c4e5b12
shavit-hud.sp - add perf% to center hud (#1259)
Co-authored-by: rtldg <rtldg@protonmail.com>
2025-10-07 23:55:27 +00:00
normalamron
5f925bc26d
Merge branch 'shavitush:master' into master 2025-08-09 21:50:30 +03:00
normalamron
f2739af6ed new description 2025-07-10 18:29:45 +03:00
normalamron
107cbeb627 shavit_core_pause_movement
add extra 2 cvar for pause
2025-07-10 13:28:19 +03:00
5 changed files with 45 additions and 9 deletions

View File

@ -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)

View File

@ -387,7 +387,7 @@ public void OnPluginStart()
gCV_Restart = new Convar("shavit_core_restart", "1", "Allow commands that restart the timer?", 0, true, 0.0, true, 1.0);
gCV_Pause = new Convar("shavit_core_pause", "1", "Allow pausing?", 0, true, 0.0, true, 1.0);
gCV_PauseMovement = new Convar("shavit_core_pause_movement", "0", "Allow movement/noclip while paused?", 0, true, 0.0, true, 1.0);
gCV_PauseMovement = new Convar("shavit_core_pause_movement", "0", "Allow movement/noclip while paused?\n0 - Disabled, no movement while paused.\n1 - Allow movement/noclip while paused, must stand still to pause.\n2 - Allow movement/noclip while paused, can pause while moving. (Not recommended)\n3 - Disallow movement/noclip while paused, can pause while moving.", 0, true, 0.0, true, 3.0);
gCV_BlockPreJump = new Convar("shavit_core_blockprejump", "0", "Prevents jumping in the start zone.", 0, true, 0.0, true, 1.0);
gCV_NoZAxisSpeed = new Convar("shavit_core_nozaxisspeed", "1", "Don't start timer if vertical speed exists (btimes style).", 0, true, 0.0, true, 1.0);
gCV_VelocityTeleport = new Convar("shavit_core_velocityteleport", "0", "Teleport the client when changing its velocity? (for special styles)", 0, true, 0.0, true, 1.0);
@ -902,23 +902,30 @@ public Action Command_TogglePause(int client, int args)
Shavit_PrintToChat(client, "%T", "MessageUnpause", client, gS_ChatStrings.sText, gS_ChatStrings.sVariable, gS_ChatStrings.sText);
}
else if(gA_Timers[client].bClientPaused & (gCV_PauseMovement.IntValue == 2 || gCV_PauseMovement.IntValue == 3))
{
TeleportEntity(client, gF_PauseOrigin[client], gF_PauseAngles[client], gF_PauseVelocity[client]);
ResumeTimer(client);
Shavit_PrintToChat(client, "%T", "MessageUnpause", client, gS_ChatStrings.sText, gS_ChatStrings.sVariable, gS_ChatStrings.sText);
}
else
{
if((iFlags & CPR_NotOnGround) > 0)
if((iFlags & CPR_NotOnGround) && (gCV_PauseMovement.IntValue == 0 || gCV_PauseMovement.IntValue == 1))
{
Shavit_PrintToChat(client, "%T", "PauseNotOnGround", client, gS_ChatStrings.sWarning, gS_ChatStrings.sText);
return Plugin_Handled;
}
if((iFlags & CPR_Moving) > 0)
if((iFlags & CPR_Moving) && (gCV_PauseMovement.IntValue == 0 || gCV_PauseMovement.IntValue == 1))
{
Shavit_PrintToChat(client, "%T", "PauseMoving", client, gS_ChatStrings.sWarning, gS_ChatStrings.sText);
return Plugin_Handled;
}
if((iFlags & CPR_Duck) > 0)
if((iFlags & CPR_Duck) && (gCV_PauseMovement.IntValue == 0 || gCV_PauseMovement.IntValue == 1))
{
Shavit_PrintToChat(client, "%T", "PauseDuck", client, gS_ChatStrings.sWarning, gS_ChatStrings.sText);
@ -2462,7 +2469,7 @@ public any Native_ShouldProcessFrame(Handle plugin, int numParams)
public Action Shavit_OnStartPre(int client, int track)
{
if (GetTimerStatus(client) == Timer_Paused && gCV_PauseMovement.BoolValue)
if (GetTimerStatus(client) == Timer_Paused && (gCV_PauseMovement.IntValue == 1 || gCV_PauseMovement.IntValue == 2 || gCV_PauseMovement.IntValue == 3))
{
return Plugin_Stop;
}
@ -3353,7 +3360,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
int flags = GetEntityFlags(client);
if (gA_Timers[client].bClientPaused && IsPlayerAlive(client) && !gCV_PauseMovement.BoolValue)
if (gA_Timers[client].bClientPaused && IsPlayerAlive(client) && gCV_PauseMovement.IntValue == 0)
{
buttons = 0;
vel = view_as<float>({0.0, 0.0, 0.0});
@ -3365,6 +3372,17 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
return Plugin_Changed;
}
if (gA_Timers[client].bClientPaused && IsPlayerAlive(client) && gCV_PauseMovement.IntValue == 3)
{
buttons = 0;
TeleportEntity(client, gF_PauseOrigin[client], gF_PauseAngles[client], view_as<float>({0.0, 0.0, 0.0}));
SetEntityFlags(client, (flags | FL_ATCONTROLS));
//SetEntityMoveType(client, MOVETYPE_NONE);
return Plugin_Changed;
}
SetEntityFlags(client, (flags & ~FL_ATCONTROLS));
if (gI_HijackFrames[client])
@ -3953,4 +3971,4 @@ void UpdateStyleSettings(int client)
{
UpdateAiraccelerate(client, GetStyleSettingFloat(gA_Timers[client].bsStyle, "airaccelerate"));
}
}
}

View File

@ -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);
}

View File

@ -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);

View File

@ -85,6 +85,10 @@
{
"en" "Perfect jumps"
}
"HudPerfsCenter"
{
"en" "Perfect jumps (center hud)"
}
"HudDefaultPistol"
{
"en" "Default Pistol: 1=USP 2=Glock"