Мог ли бы кинуть? добрые люди.
var lp = Entity.GetLocalPlayer
var lp = Entity.GetLocalPlayer
var screen_size = Render.GetScreenSize();
var center_screen = [screen_size[0]/2, screen_size[1]/2 ]
UI.AddSubTab(["Config", "SUBTAB_MGR"], "Out of FOV");
var path = ["Config", "Out of FOV", "Out of FOV"]
UI.AddColorPicker(path, "Color")
UI.AddColorPicker(path, "Dormant color")
UI.AddCheckbox(path, "Only draw when offscreen")
UI.AddSliderInt(path, "Distance", 50, 450);
function rad( deg )
{
return deg * Math.PI / 180
}
function rotate_angle(cx, cy, deg, distance, xmp, ymp)
{
var viewAngles = Local.GetViewAngles()
deg = rad( deg - viewAngles[1] )
var x = Math.sin( deg ) * distance * xmp
var y = Math.cos( deg ) * distance * ymp
x = cx - x
y = cy - y
return [ x, y ]
}
function normalize_yaw(angle) {
angle = (angle % 360 + 360) % 360;
return angle > 180 ? angle - 360 : angle;
}
function calculate_yaw(src, to) {
var delta = [src[0] - to[0], src[1] - to[1]]
var yaw = Math.atan(delta[1]/delta[0])
yaw = normalize_yaw(yaw * 180 / Math.PI)
if (delta[0] >= 0)
yaw = normalize_yaw(yaw + 180)
return yaw
}
//This method just looks better
function drawArrow(angle, distance, color, size) {
var new_point = rotate_angle(center_screen[0], center_screen[1], angle, distance, 1, 1)
var top = rotate_angle(new_point[0], new_point[1], angle, size, 1, 1)
var left = rotate_angle( new_point[0], new_point[1], angle + (size/1.75), size/1.75, 1, 1)
var right = rotate_angle( new_point[0], new_point[1], angle - (size/1.75), size/1.75, 1, 1)
Render.Polygon( [ top, right, left ], [color[0], color[1], color[2], color[3]] );
}
function world_point_visible(origin) {
var w2s = Render.WorldToScreen(origin)
if (w2s[0] < 0 || w2s[0] > screen_size[0] || w2s[1] < 0 || w2s[1] > screen_size[1])
return false
else
return true
}
function paint() {
if (Entity.IsAlive(lp()) == false)
return
var players = Entity.GetEnemies();
var local_origin = Entity.GetRenderOrigin(lp());
var color_g = UI.GetColor(["Config", "Out of FOV", "Out of FOV", "Color"])
var dormant_color_g = UI.GetColor(["Config", "Out of FOV", "Out of FOV", "Dormant color"])
var draw_vis_g = UI.GetValue(["Config", "Out of FOV", "Out of FOV", "Only draw when offscreen"])
var distance_g = UI.GetValue(["Config", "Out of FOV", "Out of FOV", "Distance"])
for (var i in players) {
var player = players[i]
if (Entity.IsValid(player) && Entity.IsAlive(player)) {
var player_origin = Entity.GetRenderOrigin(player);
var yaw = calculate_yaw(local_origin, player_origin);
var do_draw = world_point_visible(player_origin) && draw_vis_g
if (!do_draw)
drawArrow(yaw, distance_g, Entity.IsDormant(player) ? dormant_color_g : color_g, 50)
}
}
}
Cheat.RegisterCallback("Draw", "paint");
Проект предоставляет различный материал, относящийся к сфере киберспорта, программирования, ПО для игр, а также позволяет его участникам общаться на многие другие темы. Почта для жалоб: admin@yougame.biz