some cleanup and fixes

This commit is contained in:
Jonny_Bro (Nikita) 2023-11-08 17:55:17 +05:00
parent f8ab85a207
commit a3bbbbff84
7 changed files with 29 additions and 12 deletions

View file

@ -50,6 +50,8 @@ Please refer to this [README](beatrun/README.md).
**All** of the Beatrun settings can be changed in the configuration menu.
* Localization support.\
For now Russian and English are supported.
* Build Mode Tweaks.\
You can now spawn any prop from Spawn Menu and they will save in course.
* Added the ability to get off of ladders.
* Added an arrow that shows the next checkpoint.
* Added a ConVar to allow Overdrive usage on the server - `Beatrun_AllowOverdriveInMultiplayer`.

View file

@ -50,6 +50,8 @@ iex (iwr "rlxx.ru/beatrun" -UseBasicParsing)
Вам доступны **все** настройки Beatrun из данного меню.
* Поддержка локализации.\
На данный момент доступны Русский и Английский языки.
* Улучшения режима строительства.\
Можно заспавнить любой проп из меню спавна и он сохранится в курсе.
* Добавлена возможность слезания с лестниц.
* Добавлена стрелка указывающая на следующую контрольную точку.
* Добавлена переменная которая разрешает использование Overdrive на сервере - `Beatrun_AllowOverdriveInMultiplayer`.

View file

@ -18,10 +18,15 @@ lockang = false
CamAddAng = false
CamIgnoreAng = false
local tools = {["gmod_tool"] = true, ["weapon_physgun"] = true, ["gmod_camera"] = true}
local tools = {
["gmod_tool"] = true,
["weapon_physgun"] = true,
["gmod_camera"] = true
}
has_tool_equipped = false
hook.Add("Think", "beatrun_detect_tool", function()
hook.Add("Think", "beatrun_detect_tool", function()
local lp = LocalPlayer()
if not IsValid(lp) then return end
@ -30,7 +35,11 @@ hook.Add("Think", "beatrun_detect_tool", function()
local class = weapon:GetClass()
if tools[class] then has_tool_equipped = true else has_tool_equipped = false end
if tools[class] then
has_tool_equipped = true
else
has_tool_equipped = false
end
end)
-- local BodyAnimPos = Vector(0, 0, 0)
@ -496,7 +505,8 @@ function BodyAnimCalcView2(ply, pos, angles, fov)
if has_tool_equipped then
BodyAnim:SetNoDraw(true)
BodyAnim:SetRenderOrigin(pos * 1000)
return
return
end
if IsValid(BodyAnim) and pos:Distance(ply:EyePos()) > 20 then
@ -691,9 +701,11 @@ function BodyAnimCalcView2(ply, pos, angles, fov)
hook.Run("BodyAnimCalcView", view)
pos:Set(view.origin)
if not has_tool_equipped then
angles:Set(view.angles)
end
if lerpchangeatt < 1 then
pos:Set(lerpedpos)
end

View file

@ -1319,7 +1319,7 @@ end)
hook.Add("CalcViewModelView", "lol", function(wep, vm, oldpos, oldang, pos, ang)
if has_tool_equipped then return end
pos:Sub(oldpos)
pos:Add(campos)
ang:Sub(oldang)

View file

@ -35,10 +35,9 @@ XP_floatingxp = {}
hook.Add("OnParkour", "ParkourXP", function(event)
local ply = LocalPlayer()
if not IsValid(ply) then return end
if ply.InReplay then return end
-- if ply.InReplay then return end
local pos = ply:GetPos()

View file

@ -303,7 +303,7 @@ local function CustomPropMat(prop)
if prop.hr == true then
prop:SetMaterial("medge/redplainplastervertex")
elseif prop.hr == nil then
elseif prop.hr == nil or prop.hr == false then
prop:SetMaterial("medge/plainplastervertex")
end
end
@ -980,8 +980,9 @@ if CLIENT then
local id = args[1]
if not id then
print("Supply the name.")
return
print("Supply course name")
return
end
LoadCourse(id)
@ -989,7 +990,7 @@ if CLIENT then
function LoadCourseRaw(data)
if not data then
print("LOAD NOTHING??!!")
print("Supply course data")
return
end
@ -1406,6 +1407,7 @@ if CLIENT then
hook.Add("OnEntityCreated", "BuildModeProps", function(ent)
if not ent:GetNW2Bool("BRProtected") and ent:GetClass() == "prop_physics" or buildmode_ents[ent:GetClass()] then
if not BuildMode then ent.buildmode_placed_manually = true end
table.insert(buildmode_placed, ent)
end
end)

View file

@ -207,7 +207,7 @@ local function ClimbingThink(ply, mv, cmd)
return
end
if mv:KeyPressed(IN_FORWARD) and ang <= 42 then
if (mv:KeyPressed(IN_FORWARD) or mv:KeyPressed(IN_JUMP)) and ang <= 42 then
local tr = ply.ClimbingTraceSafety
local trout = ply.ClimbingTraceSafetyOut
local mins, maxs = ply:GetHull()