mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-06 18:08:26 +00:00
shavit_core_pause_movement
add extra 2 cvar for pause
This commit is contained in:
parent
4f43b628ae
commit
107cbeb627
@ -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_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_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, fully allow movement.\n1 - Allow movement/noclip while paused. Need to stand on the ground.\n2 - Allow to pause while moving and you can move while paused.(not recommended)\n3 - Allow to pause while moving but freeze you when paused.", 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_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_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);
|
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);
|
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
|
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);
|
Shavit_PrintToChat(client, "%T", "PauseNotOnGround", client, gS_ChatStrings.sWarning, gS_ChatStrings.sText);
|
||||||
|
|
||||||
return Plugin_Handled;
|
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);
|
Shavit_PrintToChat(client, "%T", "PauseMoving", client, gS_ChatStrings.sWarning, gS_ChatStrings.sText);
|
||||||
|
|
||||||
return Plugin_Handled;
|
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);
|
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)
|
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;
|
return Plugin_Stop;
|
||||||
}
|
}
|
||||||
@ -3342,7 +3349,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
|
|||||||
|
|
||||||
int flags = GetEntityFlags(client);
|
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;
|
buttons = 0;
|
||||||
vel = view_as<float>({0.0, 0.0, 0.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;
|
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));
|
SetEntityFlags(client, (flags & ~FL_ATCONTROLS));
|
||||||
|
|
||||||
if (gI_HijackFrames[client])
|
if (gI_HijackFrames[client])
|
||||||
@ -3917,4 +3935,4 @@ void UpdateStyleSettings(int client)
|
|||||||
{
|
{
|
||||||
UpdateAiraccelerate(client, GetStyleSettingFloat(gA_Timers[client].bsStyle, "airaccelerate"));
|
UpdateAiraccelerate(client, GetStyleSettingFloat(gA_Timers[client].bsStyle, "airaccelerate"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user