-
Notifications
You must be signed in to change notification settings - Fork 110
shavit_core_pause_movement - add extra 2 cvars for pause #1250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -386,7 +386,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); | ||
|
|
@@ -901,23 +901,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); | ||
|
|
||
|
|
@@ -2461,7 +2468,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; | ||
| } | ||
|
|
@@ -3342,7 +3349,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}); | ||
|
|
@@ -3354,6 +3361,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]) | ||
|
|
@@ -3917,4 +3935,4 @@ void UpdateStyleSettings(int client) | |
| { | ||
| UpdateAiraccelerate(client, GetStyleSettingFloat(gA_Timers[client].bsStyle, "airaccelerate")); | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couldn't this be
else if(gA_Timers[client].bClientPaused && gCV_PauseMovement.IntValue >= 2)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still same shit, i just wrote that way