-
Автор темы
- #1
Шапка, надеюсь вы поможете)
JavaScript:
var screen_size = Render.GetScreenSize();
var scr_x = screen_size[0] - 170;
var scr_y = screen_size[1] - 20;
UI.AddCheckbox("Key Binds");
UI.AddSliderInt("keybinds_x", 0, scr_x);
UI.AddSliderInt("keybinds_y", 0, scr_y);
function clamp(v, min_int, max_int){
return Math.max(Math.min(v, max_int), min_int);
}
UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "keybinds_x", false);
UI.SetEnabled("Misc", "JAVASCRIPT", "Script items", "keybinds_y", false);
var kb_x = UI.GetValue("Script items", "keybinds_x");
var kb_y = UI.GetValue("Script items", "keybinds_y");
function kb()
{
if(!UI.GetValue("Script items", "Key Binds")) return;
var h = [];
const fontpixel = Render.AddFont( "Verdana", 7, 100);
if (UI.IsHotkeyActive("Anti-Aim", "Extra", "Slow walk")) {
h.push("Slow Walk")
}
if (UI.IsHotkeyActive("Anti-Aim", "Extra", "Fake duck")) {
h.push("Fake Duck")
}
if (UI.IsHotkeyActive("Misc", "General", "Movement", "Auto peek")) {
h.push("Auto Peek")
}
if (UI.IsHotkeyActive("Anti-Aim", "Fake angles", "Inverter")) {
h.push("Anti-Aim invert")
}
if (UI.IsHotkeyActive("Rage", "General", "General", "Force safe point")) {
h.push("Safe Point")
}
if (UI.IsHotkeyActive("Rage", "General", "General", "Force body aim")) {
h.push("Body Aim")
}
if (UI.IsHotkeyActive("Rage", "Exploits", "Double tap")) {
h.push("Double Tap")
}
if (UI.IsHotkeyActive("Rage", "Exploits", "Hide shots")) {
h.push("Hide shots")
}
if (UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Script items", "Damage Override")) {
h.push("Min DMG")
}
const rainbow = [
Math.floor(Math.sin(Global.Realtime() * 2) * 127 + 128),
Math.floor(Math.sin(Global.Realtime() * 2 + 2) * 127 + 128),
Math.floor(Math.sin(Global.Realtime() * 2 + 4) * 127 + 128),
255
];
Render.FilledRect(kb_x, kb_y, 170, 20, [15, 15, 15, 255]);
Render.StringCustom(kb_x + 60, kb_y + 4, 0, "Key Binds", [255, 255, 255, 255], fontpixel);
Render.FilledRect(kb_x, kb_y, 170, 2, [224, 61, 61, 255]);
Render.FilledRect(kb_x, kb_y + 20, 170, 20 + 15 * (h.length - 1), [15, 15, 15, 20]);
for (i = 0; i < h.length; i++)
{
Render.StringCustom(kb_x + 5, kb_y + 23 + 15 * i, 0, h[i], [255, 255, 255, 255], fontpixel);
Render.StringCustom(kb_x + 123, kb_y + 23 + 15 * i, 0, "[toggled]", [255, 255, 255, 255], fontpixel);
}
}
function movekb() {
if(!UI.IsMenuOpen()) return;
cursor_pos = Input.GetCursorPosition();
if(!Input.IsKeyPressed(0x01)){
kb_is_moving = false;
kb_old_cursor = cursor_pos;
}
if((cursor_pos[0] >= kb_x && cursor_pos[0] <= kb_x + 170 && cursor_pos[1] >= kb_y && cursor_pos[1] <= kb_y + 18) || (kb_is_moving)){
kb_is_moving = true;
kb_x = clamp(cursor_pos[0] - kb_old_cursor[0] + kb_x, 0, Render.GetScreenSize()[0] - 170);
kb_y = clamp(cursor_pos[1] - kb_old_cursor[1] + kb_y, 0, Render.GetScreenSize()[1] - 18);
kb_old_cursor = cursor_pos;
UI.SetValue("Script items", "keybinds_x", kb_x);
UI.SetValue("Script items", "keybinds_y", kb_y);
}
}
Cheat.RegisterCallback("Draw", "kb");
Cheat.RegisterCallback("Draw", "movekb");