diff --git a/configs/shavit-styles.cfg b/configs/shavit-styles.cfg index 9416e145..1f08c6bf 100644 --- a/configs/shavit-styles.cfg +++ b/configs/shavit-styles.cfg @@ -132,7 +132,7 @@ "rankingmultiplier" "1.50" } - "6" + "5" { "name" "Half-Sideways" "shortname" "HSW" @@ -149,6 +149,34 @@ "rankingmultiplier" "1.20" } + "6" + { + "name" "D-Only" + "shortname" "D" + "htmlcolor" "9C5BBA" + "command" "d; donly" + + "autobhop" "0" + "easybhop" "0" + + "airaccelerate" "1000" + "runspeed" "260.00" + + "block_pleft" "1" + "block_pright" "1" + "block_pstrafe" "1" + + "block_a" "1" + "block_s" "1" + "block_d" "1" + + "strafe_count_w" "0" + "strafe_count_a" "0" + "strafe_count_s" "0" + + "rankingmultiplier" "1.50" + } + "7" { "name" "Low Gravity" diff --git a/scripting/shavit-core.sp b/scripting/shavit-core.sp index f5f91681..aecae89e 100644 --- a/scripting/shavit-core.sp +++ b/scripting/shavit-core.sp @@ -197,7 +197,7 @@ public void OnPluginStart() gF_HSW_Requirement = 449.00; sv_autobunnyhopping = FindConVar("sv_autobunnyhopping"); - sv_autobunnyhopping.Flags &= ~FCVAR_NOTIFY; + sv_autobunnyhopping.BoolValue = false; } else @@ -604,6 +604,7 @@ void ChangeClientStyle(int client, BhopStyle style) Call_Finish(); gBS_Style[client] = style; + UpdateAutoBhop(client); Shavit_PrintToChat(client, "You have selected to play %s%s%s.", gS_ChatStrings[sMessageStyle], gS_StyleStrings[style][sStyleName], gS_ChatStrings[sMessageText]); @@ -955,6 +956,7 @@ public void OnClientCookiesCached(int client) GetClientCookie(client, gH_StyleCookie, sCookie, 4); gBS_Style[client] = view_as(StringToInt(sCookie)); + UpdateAutoBhop(client); } public void OnClientPutInServer(int client) @@ -967,9 +969,10 @@ public void OnClientPutInServer(int client) } gB_Auto[client] = true; - gBS_Style[client] = view_as(0); gB_DoubleSteps[client] = false; gF_StrafeWarning[client] = 0.0; + gBS_Style[client] = view_as(0); + UpdateAutoBhop(client); if(AreClientCookiesCached(client)) { @@ -1092,6 +1095,9 @@ bool LoadStyles() char[][] sStyleCommands = new char[32][32]; int iCommands = ExplodeString(gS_StyleStrings[i][sChangeCommand], ";", sStyleCommands, 32, 32, false); + char[] sDescription = new char[128]; + FormatEx(sDescription, 128, "Change style to %s.", gS_StyleStrings[i][sStyleName]); + for(int x = 0; x < iCommands; x++) { TrimString(sStyleCommands[x]); @@ -1102,9 +1108,6 @@ bool LoadStyles() gSM_StyleCommands.SetValue(sCommand, i); - char[] sDescription = new char[128]; - FormatEx(sDescription, 128, "Change style to %s.", gS_StyleStrings[i][sStyleName]); - RegConsoleCmd(sCommand, Command_StyleChange, sDescription); } } @@ -1309,11 +1312,6 @@ public void PreThink(int client) if(IsPlayerAlive(client)) { sv_airaccelerate.IntValue = gA_StyleSettings[gBS_Style[client]][iAiraccelerate]; - - if(sv_autobunnyhopping != null) - { - sv_autobunnyhopping.BoolValue = (gA_StyleSettings[gBS_Style[client]][bAutobhop] && gB_Autobhop && gB_Auto[client]); - } } } @@ -1423,32 +1421,27 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 gI_Strafes[client]++; } - // autobhop for cs:s - // cs:go has a built-in autobhop cvar - if(gEV_Type == Engine_CSS) + if(gA_StyleSettings[gBS_Style[client]][bAutobhop] && gB_Autobhop && gB_Auto[client]) { - if(gA_StyleSettings[gBS_Style[client]][bAutobhop] && gB_Autobhop && gB_Auto[client]) + bool bInWater = (GetEntProp(client, Prop_Send, "m_nWaterLevel") >= 2); + bool bOnLadder = (GetEntityMoveType(client) == MOVETYPE_LADDER); + + if((buttons & IN_JUMP) > 0 && iGroundEntity == -1 && !bOnLadder && !bInWater) { - bool bInWater = (GetEntProp(client, Prop_Send, "m_nWaterLevel") >= 2); - bool bOnLadder = (GetEntityMoveType(client) == MOVETYPE_LADDER); - - if((buttons & IN_JUMP) > 0 && iGroundEntity == -1 && !bOnLadder && !bInWater) - { - buttons &= ~IN_JUMP; - } - - else if(gB_DoubleSteps[client] && (iGroundEntity != -1 || bOnLadder || bInWater)) - { - buttons |= IN_JUMP; - } + buttons &= ~IN_JUMP; } - else if(gB_DoubleSteps[client]) + else if(gB_DoubleSteps[client] && (iGroundEntity != -1 || bOnLadder || bInWater)) { buttons |= IN_JUMP; } } + else if(gB_DoubleSteps[client]) + { + buttons |= IN_JUMP; + } + if(bInStart && gB_BlockPreJump && !gA_StyleSettings[gBS_Style[client]][bPrespeed] && (vel[2] > 0 || (buttons & IN_JUMP) > 0)) { vel[2] = 0.0; @@ -1544,3 +1537,11 @@ void StopTimer_Cheat(int client, const char[] message) Shavit_StopTimer(client); Shavit_PrintToChat(client, "%sTimer stopped! %s%s", gS_ChatStrings[sMessageWarning], gS_ChatStrings[sMessageText], message); } + +void UpdateAutoBhop(int client) +{ + if(sv_autobunnyhopping != null) + { + sv_autobunnyhopping.ReplicateToClient(client, (gA_StyleSettings[gBS_Style[client]][bAutobhop] && gB_Autobhop && gB_Auto[client])? "1":"0"); + } +} diff --git a/scripting/shavit-hud.sp b/scripting/shavit-hud.sp index ef9ba3c8..1254ff73 100644 --- a/scripting/shavit-hud.sp +++ b/scripting/shavit-hud.sp @@ -582,7 +582,7 @@ void UpdateHUD(int client) { FormatEx(sHintText, 512, ""); Format(sHintText, 512, "%s\t%s Replay", sHintText, gS_StyleStrings[bsStyle][sHTMLColor], gS_StyleStrings[bsStyle][sStyleName]); - Format(sHintText, 512, "%s\n\tTime: %s%s", sHintText, sTime, sWR); + Format(sHintText, 512, "%s\n\tTime: %s / %s", sHintText, sTime, sWR); Format(sHintText, 512, "%s\n\tSpeed: %d", sHintText, iSpeed); Format(sHintText, 512, "%s", sHintText); }