From a6665c4dfe415ae45932c8010d21d60f003103a0 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Sun, 4 Jun 2023 22:00:52 +0500 Subject: [PATCH] Fixed random stuck glitch (I hope) --- README.md | 3 +- .../beatrun/gamemode/cl/ToolMenuSettings.lua | 28 ++++- .../beatrun/gamemode/sh/sh_freerunsysall.lua | 13 +- vmaniprework/lua/autorun/client/cl_vmanip.lua | 5 +- vmaniprework/lua/autorun/server/sv_vmanip.lua | 12 +- .../lua/vmanip/anims/vmanip_baseanims.lua | 114 ++++++++---------- 6 files changed, 91 insertions(+), 84 deletions(-) diff --git a/README.md b/README.md index 685bc53..75c0024 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,12 @@ This version of the beatrun works on any version of the game (Chromium or not). * Change HUD's colors - `Beatrun_HUDTextColor`, `Beatrun_HUDCornerColor`, `Beatrun_HUDFloatingXPColor`. * Discord Rich Presence (extract `lua` folder to `garrysmod`, along side with `addons` folder). * Small camera punch when diving. -* Change max moving speed - `Beatrun_MaxSpeed`. * Ability to remove ziplines that created with *Zipline Gun* - RMB. * Removed your SteamID from right corner, because I can. * Allow players to spawn props without admin rights - `Beatrun_AllowPropSpawn`. ## TODO -- [ ] Configuration menu +- [X] Configurations menu - [ ] Gamemodes menu ## Fixes and changes from previous version diff --git a/beatrun/gamemodes/beatrun/gamemode/cl/ToolMenuSettings.lua b/beatrun/gamemodes/beatrun/gamemode/cl/ToolMenuSettings.lua index fad5639..29178c4 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl/ToolMenuSettings.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl/ToolMenuSettings.lua @@ -149,9 +149,6 @@ hook.Add("PopulateToolMenu", "Beatrun_ToolMenu", function() panel:ClearControls() panel:SetName("Misc Settings") - panel:NumSlider("Max Speed", "Beatrun_MaxSpeed", 0, 1000, 0) - panel:ControlHelp("Changes Max Moving Speed") - panel:CheckBox("Prop Spawning", "Beatrun_AllowPropSpawn") panel:ControlHelp("Allows players without admin rights to spawn props, entities and weapons") @@ -205,4 +202,29 @@ hook.Add("PopulateToolMenu", "Beatrun_ToolMenu", function() panel:CheckBox("Totsugeki Direction", "Beatrun_TotsugekiDir") panel:ControlHelp("Allows to Totsugeki into Another Direction\nCombined with Spam and Heading Allows You to Fly =)") end) + + spawnmenu.AddToolMenuOption("Beatrun", "Server", "beatrun_gamemodes", "Gamemodes", "", "", function(panel) + panel:ClearControls() + panel:SetName("Gamemodes Settings") + + local InfectionButton = vgui.Create("DButton", panel) + InfectionButton:SetText("Toggle Infection Gamemode") + InfectionButton:SetSize(0, 20) + InfectionButton.DoClick = function() + if GetGlobalBool(GM_DATATHEFT) then return notification.AddLegacy("Another gamemode is running!", NOTIFY_HINT, 2) end + + StartInfection() + end + panel:AddItem(InfectionButton) + + local DatatheftButton = vgui.Create("DButton", panel) + DatatheftButton:SetText("Toggle Data Theft Gamemode") + DatatheftButton:SetSize(0, 20) + DatatheftButton.DoClick = function() + if GetGlobalBool(GM_INFECTION) then return notification.AddLegacy("Another gamemode is running!", NOTIFY_HINT, 2) end + + StartDataTheft() + end + panel:AddItem(DatatheftButton) + end) end) \ No newline at end of file diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/sh_freerunsysall.lua b/beatrun/gamemodes/beatrun/gamemode/sh/sh_freerunsysall.lua index 2d08b4e..ead0130 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/sh_freerunsysall.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/sh_freerunsysall.lua @@ -1,6 +1,5 @@ local quakejump = CreateConVar("Beatrun_QuakeJump", 1, {FCVAR_REPLICATED, FCVAR_ARCHIVE}) local sidestep = CreateConVar("Beatrun_SideStep", 1, {FCVAR_REPLICATED, FCVAR_ARCHIVE}) -local max_speed = CreateConVar("Beatrun_MaxSpeed", 325, {FCVAR_REPLICATED, FCVAR_ARCHIVE}) local function Hardland(jt) local ply = LocalPlayer() @@ -230,8 +229,8 @@ hook.Add("SetupMove", "MESetupMove", function(ply, mv, cmd) ply.FootstepLand = true end - if ply:GetRunSpeed() ~= max_speed:GetInt() * ply:GetOverdriveMult() then - ply:SetRunSpeed(max_speed:GetInt() * ply:GetOverdriveMult()) + if ply:GetRunSpeed() ~= 325 * ply:GetOverdriveMult() then + ply:SetRunSpeed(325 * ply:GetOverdriveMult()) end if not ply:GetMEMoveLimit() then @@ -257,11 +256,11 @@ hook.Add("SetupMove", "MESetupMove", function(ply, mv, cmd) local MEAng = math.Truncate(ang:Forward().x, 2) local MEAngDiff = math.abs((MEAng - ply:GetMEAng()) * 100) - local weaponspeed = math.floor(max_speed:GetInt() / 1.66) + local weaponspeed = 150 local activewep = ply:GetActiveWeapon() if IsValid(activewep) and activewep:GetClass() ~= "runnerhands" then - weaponspeed = max_speed:GetInt() + weaponspeed = 250 end if (ismoving or ply:GetMantle() ~= 0) and ply:GetMESprintDelay() < CurTime() and (cmd:KeyDown(IN_SPEED) or ply:GetMantle() ~= 0 or not ply:OnGround() or (not ply:OnGround() or ply:GetMantle() ~= 0) and mv:GetVelocity().z > -450) then @@ -275,9 +274,9 @@ hook.Add("SetupMove", "MESetupMove", function(ply, mv, cmd) mult = mult * ply:GetMEMoveLimit() / 1000 end - ply:SetMEMoveLimit(math.Clamp(ply:GetMEMoveLimit() + mult * ply:GetOverdriveMult() * 2, 0, max_speed:GetInt() * ply:GetOverdriveMult())) + ply:SetMEMoveLimit(math.Clamp(ply:GetMEMoveLimit() + mult * ply:GetOverdriveMult() * 2, 0, 325 * ply:GetOverdriveMult())) elseif not ismoving and (not ply:Crouching() or ply:GetCrouchJump()) or CurTime() < ply:GetMESprintDelay() and ply:OnGround() then - ply:SetMEMoveLimit(math.Clamp(ply:GetMEMoveLimit() - 40, weaponspeed, max_speed:GetInt() * ply:GetOverdriveMult())) + ply:SetMEMoveLimit(math.Clamp(ply:GetMEMoveLimit() - 40, weaponspeed, 325 * ply:GetOverdriveMult())) end if MEAngDiff > 1.25 and ply:GetWallrun() == 0 then diff --git a/vmaniprework/lua/autorun/client/cl_vmanip.lua b/vmaniprework/lua/autorun/client/cl_vmanip.lua index 218c8c8..b9bcfa3 100644 --- a/vmaniprework/lua/autorun/client/cl_vmanip.lua +++ b/vmaniprework/lua/autorun/client/cl_vmanip.lua @@ -1,4 +1,5 @@ ---[[N++ Protip: View > Collapse Level 1 +--[[ +N++ Protip: View > Collapse Level 1 More detail on stuff in lua/vmanip/vmanip_baseanims.lua Please keep in mind that you do not fire events *through vmanip*. Think of it as a fully @@ -550,8 +551,6 @@ hook.Add("PostDrawViewModel", "VManip", function(vm, ply, weapon) end end) -local anglef = Angle(0, 1, 0) - --Very basic stuff, you see hook.Add("PostDrawViewModel", "VMLegs", function(vm, ply, weapon) if VMLegs:IsActive() then diff --git a/vmaniprework/lua/autorun/server/sv_vmanip.lua b/vmaniprework/lua/autorun/server/sv_vmanip.lua index 0abc8bb..93fec4a 100644 --- a/vmaniprework/lua/autorun/server/sv_vmanip.lua +++ b/vmaniprework/lua/autorun/server/sv_vmanip.lua @@ -5,14 +5,12 @@ util.AddNetworkString("VManip_StopHold") --VManip_StopHold: WriteString of anim to stop holding on client local function VManip_FindAndImport() + local path = "vmanip/anims/" + local anims = file.Find(path .. "*.lua", "lsv") -local path="vmanip/anims/" -local anims=file.Find(path.."*.lua","lsv") - -for k,v in pairs(anims) do - AddCSLuaFile(path..v) -end - + for k, v in pairs(anims) do + AddCSLuaFile(path .. v) + end end VManip_FindAndImport() \ No newline at end of file diff --git a/vmaniprework/lua/vmanip/anims/vmanip_baseanims.lua b/vmaniprework/lua/vmanip/anims/vmanip_baseanims.lua index d3017b7..b0c79b6 100644 --- a/vmaniprework/lua/vmanip/anims/vmanip_baseanims.lua +++ b/vmaniprework/lua/vmanip/anims/vmanip_baseanims.lua @@ -26,79 +26,69 @@ Hands Legs "model" - path to model -"speed" - playback speed +"speed" - playback speed "forwardboost" - forward offset "upboost" - vertical offset (in actual hammer units) ]] -VManip:RegisterAnim("use", -{ -["model"]="c_vmanipinteract.mdl", -["lerp_peak"]=0.4, -["lerp_speed_in"]=1, -["lerp_speed_out"]=0.8, -["lerp_curve"]=2.5, -["speed"]=1, -["startcycle"]=0.1, -["sounds"]={}, -["loop"]=false -} -) +VManip:RegisterAnim("use", { + ["model"] = "c_vmanipinteract.mdl", + ["lerp_peak"] = 0.4, + ["lerp_speed_in"] = 1, + ["lerp_speed_out"] = 0.8, + ["lerp_curve"] = 2.5, + ["speed"] = 1, + ["startcycle"] = 0.1, + ["sounds"] = {}, + ["loop"] = false +}) -VManip:RegisterAnim("vault", -{ -["model"]="c_vmanipvault.mdl", -["lerp_peak"]=0.4, -["lerp_speed_in"]=1, -["lerp_speed_out"]=0.5, -["lerp_curve"]=1, -["speed"]=1 -} -) +VManip:RegisterAnim("vault", { + ["model"] = "c_vmanipvault.mdl", + ["lerp_peak"] = 0.4, + ["lerp_speed_in"] = 1, + ["lerp_speed_out"] = 0.5, + ["lerp_curve"] = 1, + ["speed"] = 1 +}) -VManip:RegisterAnim("handslide", -{ -["model"]="c_vmanipvault.mdl", -["lerp_peak"]=0.2, -["lerp_speed_in"]=1, -["lerp_speed_out"]=0.8, -["lerp_curve"]=2, -["speed"]=1.5, -["holdtime"]=0.25, -} -) +VManip:RegisterAnim("handslide", { + ["model"] = "c_vmanipvault.mdl", + ["lerp_peak"] = 0.2, + ["lerp_speed_in"] = 1, + ["lerp_speed_out"] = 0.8, + ["lerp_curve"] = 2, + ["speed"] = 1.5, + ["holdtime"] = 0.25, +}) -VManip:RegisterAnim("adrenalinestim", -{ -["model"]="old/c_vmanip.mdl", -["lerp_peak"]=1.1, -["lerp_speed_in"]=1, -["speed"]=0.7, -["sounds"]={}, -["loop"]=false -} -) +VManip:RegisterAnim("adrenalinestim", { + ["model"] = "old/c_vmanip.mdl", + ["lerp_peak"] = 1.1, + ["lerp_speed_in"] = 1, + ["speed"] = 0.7, + ["sounds"] = {}, + ["loop"] = false +}) -VManip:RegisterAnim("thrownade", -{ -["model"]="c_vmanipgrenade.mdl", -["lerp_peak"]=0.85, -["lerp_speed_in"]=1.2, -["lerp_speed_out"]=1.2, -["lerp_curve"]=1, -["speed"]=1, -["holdtime"]=0.4, -} -) +VManip:RegisterAnim("thrownade", { + ["model"] = "c_vmanipgrenade.mdl", + ["lerp_peak"] = 0.85, + ["lerp_speed_in"] = 1.2, + ["lerp_speed_out"] = 1.2, + ["lerp_curve"] = 1, + ["speed"] = 1, + ["holdtime"] = 0.4, +}) --################################### -VMLegs:RegisterAnim("test", --lmao, im not recompiling to change THAT shit -{ -["model"]="c_vmaniplegs.mdl", -["speed"]=1.5, -["forwardboost"]=4, -["upwardboost"]=0 +--lmao, im not recompiling to change THAT shit +VMLegs:RegisterAnim("test", { + ["model"] = "c_vmaniplegs.mdl", + ["speed"] = 1.5, + ["forwardboost"] = 4, + ["upwardboost"] = 0 }) \ No newline at end of file