pidjan
-
Автор темы
- #1
Код:
JavaScript:
UI.AddCheckbox("Water");
UI.AddCheckbox("Binds");
//SHADOW
const draw_shadow = function(x, y, int, text, outline_color, font) {
Render.StringCustom(x, y + 1, int, text, outline_color, font);
//TEXT
Render.StringCustom(x, y, int, text, [255, 255, 255, 255], font);
}
//Metamod watermark
const in_bounds = function(vec, x, y, x2, y2){
return (vec[0] > x) && (vec[1] > y) && (vec[0] < x2) && (vec[1] < y2)
}
var screen = Global.GetScreenSize();
var stored1 = false;
var x_offs1 = 0;
var y_offs1 = 0;
const watermark = function() {
if(!UI.GetValue("Script items", "Water")) return;
var name = "onetap [metamod]";
var username1 = UI.GetString("Script items", "Water username");
var username = username1 != "" ? username1 : Cheat.GetUsername();
var tickrate = Globals.Tickrate();
var delay = Math.round(Local.Latency()*1000/2);
var now = new Date();
var hours = now.getHours(), mins = now.getMinutes();
var time = (hours < 10 ? "0" + hours : hours) + ":" + (mins < 10 ? "0" + mins : mins);
var font = Render.AddFont("Verdana", 8, 100);
var text = '';
if(World.GetServerString())
text = name + " | " + username + " | " + "delay: " + delay + "ms" + " | " + tickrate + "tick" + " | ";
else
text = name + " | " + username + " | ";
text += time;
var w = Render.TextSizeCustom(text, font)[0] + 10;
var x = UI.GetValue("Script items", "water_x"), y = UI.GetValue("Script items", "water_y");
Render.FilledRect(x, y, w, 18, [0, 0, 0, 240]);
Render.FilledRect(x, y, w, 2, [90, 120, 240, 255]);
draw_shadow(x + 5, y+3, 0, text, [0, 0, 0, 255], font);
if(UI.IsMenuOpen() && Input.IsKeyPressed(0x1)){
var mouse_pos = Global.GetCursorPosition();
if (in_bounds(mouse_pos, x, y, x + 200, y + 40)) {
if(!stored1){
x_offs1 = mouse_pos[0] - x;
y_offs1 = mouse_pos[1] - y;
stored1 = true;
}
UI.SetValue("Script items", "water_x", mouse_pos[0] - x_offs1);
UI.SetValue("Script items", "water_y", mouse_pos[1] - y_offs1);
}
} else if(stored1) stored1 = false;
}
//ALL BINDS
const binds = [
["Double tap", ["Rage", "Exploits", "Double tap"]],
["On shot anti-aim", ["Rage", "Exploits", "Hide shots"]],
["Duck peek assist", ["Anti-Aim", "Extra", "Fake duck"]],
["Force body aim", ["Rage", "General", "General", "Force body aim"]],
["Quick peek assist", ["Misc", "GENERAL", "Movement", "Auto peek"]],
["Safe point override", ["Rage", "General", "General", "Force safe point"]],
["Slow motion", ["Anti-Aim", "Extra", "Slow walk"]],
["Damage override", ["Script items", "Damage override"]],
["Back", ["Anti-Aim", "Rage Anti-Aim", "Back dir"]],
["Right", ["Anti-Aim", "Rage Anti-Aim", "Right dir"]],
["Left", ["Anti-Aim", "Rage Anti-Aim", "Left dir"]]
]
//ALL BINDS
//Metamod keybinds
var stored = false;
var x_offs = 0;
var y_offs = 0;
const keybinds = function() {
if(!UI.GetValue("Script items", "Binds")) return;
var n = [];
var x = UI.GetValue("Script items", "keybinds_x"), y = UI.GetValue("Script items", "keybinds_y");
for(var j in binds){
if(UI.IsHotkeyActive.apply(null, binds[j][1])) n.push(j);
}
var font = Render.AddFont("Verdana", 8, 100);
Render.FilledRect(x, y, 150, 18, [0, 0, 0, 240]);
Render.StringCustom(x + 75, y + 1, 1, "keybinds", [255, 255, 255, 255], font);
for(var i in n) {
draw_shadow(x + 1, y + 18 + 15 * i, 0, binds[n[i]][0], [0, 0, 0, 255], font);
draw_shadow(x + 125, y + 18 + 15 * i, 0, "[on]", [0, 0, 0, 255], font);
}
Render.FilledRect( x, y - 2, 150, 2, [90, 120, 240, 255]);
if(UI.IsMenuOpen() && Input.IsKeyPressed(0x1)){
var mouse_pos = Global.GetCursorPosition();
if (in_bounds(mouse_pos, x, y, x + 200, y + 40)) {
if(!stored){
x_offs = mouse_pos[0] - x;
y_offs = mouse_pos[1] - y;
stored = true;
}
UI.SetValue("Script items", "keybinds_x", mouse_pos[0] - x_offs);
UI.SetValue("Script items", "keybinds_y", mouse_pos[1] - y_offs);
}
} else if(stored) stored = false;
}
UI.AddSliderInt("keybinds_x", 0, screen[0]);
UI.AddSliderInt("keybinds_y", 0, screen[1]);
UI.SetEnabled("Script items", "keybinds_x", false);
UI.SetEnabled("Script items", "keybinds_y", false);
UI.AddSliderInt("water_x", 0, screen[0]);
UI.AddSliderInt("water_y", 0, screen[1]);
UI.SetEnabled("Script items", "water_x", false);
UI.SetEnabled("Script items", "water_y", false);
UI.SetValue("Script items", "water_x", 1522);
UI.SetValue("Script items", "water_y", 24);
UI.SetValue("Script items", "keybinds_x", 3);
UI.SetValue("Script items", "keybinds_y", 500);
UI.AddTextbox("Water username");
Cheat.RegisterCallback("Draw", "watermark");
Cheat.RegisterCallback("Draw", "keybinds");
_________________
[====keybinds====]
Key__________ [on]
[====keybinds====]
Key__________ [on]
_______________________________________________
onetap [metamod] | Username | delay: 0ms | 64tick | 10:30
onetap [metamod] | Username | delay: 0ms | 64tick | 10:30
Последнее редактирование: