initial commit

This commit is contained in:
achmad
2026-05-29 15:11:31 +07:00
commit 777ee9bad8
1539 changed files with 172449 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
local ____exports = {}
--- Аналог Entities.FindAllByClassnameWithin без VectorWS: обход через FindAllByClassname + дистанция.
function ____exports.findAllByClassnameInRadius(classname, center, radius)
local all = Entities:FindAllByClassname(classname)
local result = {}
local r2 = radius * radius
for ____, ent in ipairs(all) do
do
if not ent or ent:IsNull() then
goto __continue3
end
local pos = ent:GetAbsOrigin()
local dx = pos.x - center.x
local dy = pos.y - center.y
if dx * dx + dy * dy <= r2 then
result[#result + 1] = ent
end
end
::__continue3::
end
return result
end
--- Аналог Entities.FindByClassnameNearest: ближайшая сущность класса в пределах maxRadius.
function ____exports.findNearestByClassname(classname, origin, maxRadius)
local all = Entities:FindAllByClassname(classname)
local best
local bestDist = maxRadius + 1
for ____, ent in ipairs(all) do
do
if not ent or ent:IsNull() then
goto __continue8
end
local d = (origin - ent:GetAbsOrigin()):Length2D()
if d <= maxRadius and d < bestDist then
bestDist = d
best = ent
end
end
::__continue8::
end
return best
end
return ____exports