This commit is contained in:
lifestorm
2024-08-04 22:55:00 +03:00
parent 8064ba84d8
commit 73479cff9e
7338 changed files with 1718883 additions and 14 deletions

View File

@@ -0,0 +1,37 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
include("hands.lua")
include("pac_weapon.lua")
include("projectiles.lua")
local cvar = CreateConVar("pac_restrictions", "0", FCVAR_REPLICATED)
if CLIENT then
pac.AddHook("pac_EditorCalcView", "pac_restrictions", function()
if cvar:GetInt() > 0 and not pac.LocalPlayer:IsAdmin() then
local ent = pace.GetViewEntity()
local dir = pace.ViewPos - ent:EyePos()
local dist = ent:BoundingRadius() * ent:GetModelScale() * 4
local filter = player.GetAll()
table.insert(filter, ent)
if dir:Length() > dist then
pace.ViewPos = ent:EyePos() + (dir:GetNormalized() * dist)
end
local res = util.TraceHull({start = ent:EyePos(), endpos = pace.ViewPos, filter = filter, mins = Vector(1,1,1)*-8, maxs = Vector(1,1,1)*8})
if res.Hit then
return res.HitPos
end
end
end)
end