Fixed random stuck glitch (I hope)

This commit is contained in:
Jonny_Bro (Nikita) 2023-06-04 22:00:52 +05:00
parent c13bc69b95
commit a6665c4dfe
6 changed files with 91 additions and 84 deletions

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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()

View file

@ -32,73 +32,63 @@ Legs
]]
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
})