-
Автор темы
- #1
Разворачивает ебальник к противнику если у него нож, чтобы не пырнули в спину с 1й тычки
Пожалуйста, авторизуйтесь для просмотра ссылки.
Код:
function C_BasePlayer:IsLocalPlayer()
return self == EntityList.GetLocalPlayer()
end
function C_BasePlayer:IsEnemy()
return EntityList.GetLocalPlayer() and self:IsTeamMate() == false
end
function GetEnemiesWithKnife()
local ret = {}
local players = EntityList.GetPlayers()
if #players < 0 then return {} end
for i, player in pairs(players) do
local player_active_weapon = player:GetActiveWeapon()
if not player_active_weapon then return end
if player:IsEnemy() and player:IsAlive() and player_active_weapon:IsKnife() then
table.insert(ret, player)
end
end
return ret
end
local menu_min_distance = Menu.SliderInt("General", "Minimum distance", 200, 1, 2000)
local menu_enable_draw_dist = Menu.SwitchColor("General", "Draw minimum distance circle", false, Color.RGBA(255, 255, 255))
function AntiBackstab()
local local_player = EntityList.GetLocalPlayer()
if not local_player then return end
local enemies = GetEnemiesWithKnife()
if not enemies or #enemies < 0 then return end
local min_distance = menu_min_distance:Get()
for i, enemy in pairs(enemies) do
local enemy_origin = enemy:GetRenderOrigin()
local local_player_origin = local_player:GetRenderOrigin()
local distance_from_local_to_enemy = enemy_origin:DistTo(local_player_origin)
if min_distance >= distance_from_local_to_enemy then
AntiAim.OverrideYawOffset(180)
AntiAim.OverridePitch(0)
end
end
end
function RenderDistanceCircle()
local circle_enable = menu_enable_draw_dist:GetBool()
if not circle_enable then return end
local local_player = EntityList.GetLocalPlayer()
if not local_player then return end
if not local_player:IsAlive() then return end
local local_player_origin = local_player:GetRenderOrigin()
local circle_color = menu_enable_draw_dist:GetColor()
local min_distance = menu_min_distance:Get()
Render.Circle3D(local_player_origin, 58, min_distance, circle_color)
end
Cheat.RegisterCallback("draw", RenderDistanceCircle)
Cheat.RegisterCallback("prediction", AntiBackstab)
Последнее редактирование: