shavit-misc Add cvar UnNoclipOnRestart (#1232)
Some checks failed
Compile / Build SM ${{ matrix.sm-version }} (1.12) (push) Has been cancelled
Compile / Release (push) Has been cancelled

* shavit-misc Add cvar UnNoclipOnRestart


Add functionality to turn off noclip on timer restart, disabled by default u.u

I used to use a separate plugin I made for this, but figured it should be in the main plugin itself as a cvar instead. Since adding as a cvar, may as well see if it is wanted upstream.

* shavit-misc.sp shavit_misc_unnocliponrestart 1 by default (^:
This commit is contained in:
olivia 2025-04-10 18:41:20 -07:00 committed by GitHub
parent 420c8e02ea
commit 2726865399
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -112,6 +112,7 @@ Convar gCV_StopTimerWarning = null;
Convar gCV_WRMessages = null;
Convar gCV_BhopSounds = null;
Convar gCV_RestrictNoclip = null;
Convar gCV_UnNoclipOnRestart = null;
Convar gCV_SpecScoreboardOrder = null;
Convar gCV_BadSetLocalAnglesFix = null;
ConVar gCV_PauseMovement = null;
@ -295,6 +296,7 @@ public void OnPluginStart()
gCV_WRMessages = new Convar("shavit_misc_wrmessages", "3", "How many \"NEW <style> WR!!!\" messages to print?\n0 - Disabled", 0, true, 0.0, true, 100.0);
gCV_BhopSounds = new Convar("shavit_misc_bhopsounds", "1", "Should bhop (landing and jumping) sounds be muted?\n1 - Blocked while !hide is enabled\n2 - Always blocked", 0, true, 1.0, true, 2.0);
gCV_RestrictNoclip = new Convar("shavit_misc_restrictnoclip", "0", "Should noclip be be restricted\n0 - Disabled\n1 - No vertical velocity while in noclip in start zone\n2 - No noclip in start zone", 0, true, 0.0, true, 2.0);
gCV_UnNoclipOnRestart = new Convar("shavit_misc_unnocliponrestart", "1", "Should noclip be disabled when a player restarts their timer while in noclip?\n0 - Disabled\n1 - Normal movement will be restored on restart", 0, true, 0.0, true, 1.0);
gCV_SpecScoreboardOrder = new Convar("shavit_misc_spec_scoreboard_order", "1", "Use scoreboard ordering for players when changing target when spectating.", 0, true, 0.0, true, 1.0);
if (gEV_Type != Engine_TF2)
@ -2378,6 +2380,11 @@ public void Shavit_OnRestart(int client, int track)
SetEntProp(client, Prop_Send, "m_bHasHelmet", 1);
}
}
if(gCV_UnNoclipOnRestart.BoolValue)
{
SetEntityMoveType(client, MOVETYPE_WALK);
}
}
public Action Shavit_OnStyleCommandPre(int client, int oldstyle, int newstyle, int track)