Skip to content

Commit

Permalink
Add shavit_misc_prespeed 5 for 2d velocity limit.
Browse files Browse the repository at this point in the history
  • Loading branch information
kidfearless committed Mar 7, 2021
1 parent 99ac213 commit 70ae9bc
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions addons/sourcemod/scripting/shavit-misc.sp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public void OnPluginStart()

// cvars and stuff
gCV_GodMode = new Convar("shavit_misc_godmode", "3", "Enable godmode for players?\n0 - Disabled\n1 - Only prevent fall/world damage.\n2 - Only prevent damage from other players.\n3 - Full godmode.", 0, true, 0.0, true, 3.0);
gCV_PreSpeed = new Convar("shavit_misc_prespeed", "1", "Stop prespeeding in the start zone?\n0 - Disabled, fully allow prespeeding.\n1 - Limit relatively to prestrafelimit.\n2 - Block bunnyhopping in startzone.\n3 - Limit to prestrafelimit and block bunnyhopping.\n4 - Limit to prestrafelimit but allow prespeeding. Combine with shavit_core_nozaxisspeed 1 for SourceCode timer's behavior.", 0, true, 0.0, true, 4.0);
gCV_PreSpeed = new Convar("shavit_misc_prespeed", "1", "Stop prespeeding in the start zone?\n0 - Disabled, fully allow prespeeding.\n1 - Limit relatively to prestrafelimit.\n2 - Block bunnyhopping in startzone.\n3 - Limit to prestrafelimit and block bunnyhopping.\n4 - Limit to prestrafelimit but allow prespeeding. Combine with shavit_core_nozaxisspeed 1 for SourceCode timer's behavior.\n5 - Limit horizontal speed to prestrafe but allow prespeeding.", 0, true, 0.0, true, 5.0);
gCV_HideTeamChanges = new Convar("shavit_misc_hideteamchanges", "1", "Hide team changes in chat?\n0 - Disabled\n1 - Enabled", 0, true, 0.0, true, 1.0);
gCV_RespawnOnTeam = new Convar("shavit_misc_respawnonteam", "1", "Respawn whenever a player joins a team?\n0 - Disabled\n1 - Enabled", 0, true, 0.0, true, 1.0);
gCV_RespawnOnRestart = new Convar("shavit_misc_respawnonrestart", "1", "Respawn a dead player if they use the timer restart command?\n0 - Disabled\n1 - Enabled", 0, true, 0.0, true, 1.0);
Expand Down Expand Up @@ -1115,7 +1115,18 @@ public Action Shavit_OnUserCmdPre(int client, int &buttons, int &impulse, float

if(fScale < 1.0)
{
ScaleVector(fSpeed, fScale);
if(gCV_PreSpeed.IntValue == 5)
{
float zSpeed = fSpeed[2];
fSpeed[2] = 0.0;

ScaleVector(fSpeed, fScale);
fSpeed[2] = zSpeed;
}
else
{
ScaleVector(fSpeed, fScale);
}
}

TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, fSpeed);
Expand Down

0 comments on commit 70ae9bc

Please sign in to comment.