Вопрос Помогите с чекбоксами отк3!

Начинающий
Статус
Оффлайн
Регистрация
16 Ноя 2020
Сообщения
82
Реакции[?]
5
Поинты[?]
0
Если не трудно, помогите пожалуйста с чек боксами.
Я просто учусь сейчас. вот на примере клан тега.
Кто поможет буду Благодарен.







var currentTick = 0;
var lastTick = 0;
var special = false
var speed = 22;
var ctag = 0
function Draw(){
currentTick = parseInt(Globals.Curtime() * 1000);
if (currentTick - (10000 / speed) >= lastTick){
switch ((ctag) % 42){
case 0:{
Local.SetClanTag("s ");
break;
}
case 1:{
Local.SetClanTag("sk ");
break;
}
case 2:{
Local.SetClanTag("ske ");
break;
}
case 3:{
Local.SetClanTag("skee ");
break;
}
case 4:{
Local.SetClanTag("skeet ");
break;
}
case 5:{
Local.SetClanTag("skeet. ");
break;
}
case 6:{
Local.SetClanTag("skeet.c ");
break;
}
case 7:{
Local.SetClanTag("skeet.cc");
break;
}
case 8:{
Local.SetClanTag("skeet.cc");
break;
}
case 9:{
Local.SetClanTag(" skeet.cc");
break;
}
case 10:{
Local.SetClanTag(" keet.cc");
break;
}
case 11:{
Local.SetClanTag(" eet.cc");
break;
}
case 12:{
Local.SetClanTag(" et.cc");
break;
}
case 13:{
Local.SetClanTag(" t.cc");
break;
}
case 14:{
Local.SetClanTag(" .cc");
break;
}
case 15:{
Local.SetClanTag(" cc");
break;
}
case 16:{
Local.SetClanTag(" c");
break;
}
case 17:{
Local.SetClanTag(" ");
break;
}
}
if (ctag == 17){
ctag = 0;
}else{
ctag = ctag+1;
}
lastTick = currentTick;
}
}
Cheat.RegisterCallback("Draw", "Draw");
 
SenkoTech dev
Пользователь
Статус
Оффлайн
Регистрация
4 Янв 2020
Сообщения
326
Реакции[?]
111
Поинты[?]
5K
UI.AddCheckbox("<Название чекбокса>")
var check = UI.GetValue("<Название чекбокса>")

Всё можешь делать так:
if(check) {
тут уже по-сути что ты хотел сделать при включении чекбокса
}
 
Начинающий
Статус
Оффлайн
Регистрация
16 Ноя 2020
Сообщения
82
Реакции[?]
5
Поинты[?]
0
UI.AddCheckbox("<Название чекбокса>")
var check = UI.GetValue("<Название чекбокса>")

Всё можешь делать так:
if(check) {
тут уже по-сути что ты хотел сделать при включении чекбокса
}
бля не понял тя немного
 
SenkoTech dev
Пользователь
Статус
Оффлайн
Регистрация
4 Янв 2020
Сообщения
326
Реакции[?]
111
Поинты[?]
5K
JavaScript:
UI.AddCheckbox("Test")

var currentTick = 0;
var lastTick = 0;
var special = false
var speed = 22;
var ctag = 0

function draw(){
    var check = UI.GetValue("Test")
    if(check) {
        currentTick = parseInt(Globals.Curtime() * 1000);
        if (currentTick - (10000 / speed) >= lastTick){
            switch ((ctag) % 42){
                case 0:{
                    Local.SetClanTag("s ");
                    break;
                }
                case 1:{
                    Local.SetClanTag("sk ");
                    break;
                }
                case 2:{
                    Local.SetClanTag("ske ");
                    break;
                }
                case 3:{
                    Local.SetClanTag("skee ");
                    break;
                }
                case 4:{
                    Local.SetClanTag("skeet ");
                    break;
                }
                case 5:{
                    Local.SetClanTag("skeet. ");
                    break;
                }
                case 6:{
                    Local.SetClanTag("skeet.c ");
                    break;
                }
                case 7:{
                    Local.SetClanTag("skeet.cc");
                    break;
                }
                case 8:{
                    Local.SetClanTag("skeet.cc");
                    break;
                }
                case 9:{
                    Local.SetClanTag(" skeet.cc");
                    break;
                }
                case 10:{
                    Local.SetClanTag(" keet.cc");
                    break;
                }
                case 11:{
                    Local.SetClanTag(" eet.cc");
                    break;
                }
                case 12:{
                    Local.SetClanTag(" et.cc");
                    break;
                }
                case 13:{
                    Local.SetClanTag(" t.cc");
                    break;
                }
                case 14:{
                    Local.SetClanTag(" .cc");
                    break;
                }
                case 15:{
                    Local.SetClanTag(" cc");
                    break;
                }
                case 16:{
                    Local.SetClanTag(" c");
                    break;
                }
                case 17:{
                    Local.SetClanTag(" ");
                    break;
                }
            }
            if (ctag == 17){
                ctag = 0;
            }else{
                ctag = ctag+1;
            }
        lastTick = currentTick;
        }
    }
}
Cheat.RegisterCallback("Draw", "draw");
 
Начинающий
Статус
Оффлайн
Регистрация
16 Ноя 2020
Сообщения
82
Реакции[?]
5
Поинты[?]
0
JavaScript:
UI.AddCheckbox("Test")

var currentTick = 0;
var lastTick = 0;
var special = false
var speed = 22;
var ctag = 0

function draw(){
    var check = UI.GetValue("Test")
    if(check) {
        currentTick = parseInt(Globals.Curtime() * 1000);
        if (currentTick - (10000 / speed) >= lastTick){
            switch ((ctag) % 42){
                case 0:{
                    Local.SetClanTag("s ");
                    break;
                }
                case 1:{
                    Local.SetClanTag("sk ");
                    break;
                }
                case 2:{
                    Local.SetClanTag("ske ");
                    break;
                }
                case 3:{
                    Local.SetClanTag("skee ");
                    break;
                }
                case 4:{
                    Local.SetClanTag("skeet ");
                    break;
                }
                case 5:{
                    Local.SetClanTag("skeet. ");
                    break;
                }
                case 6:{
                    Local.SetClanTag("skeet.c ");
                    break;
                }
                case 7:{
                    Local.SetClanTag("skeet.cc");
                    break;
                }
                case 8:{
                    Local.SetClanTag("skeet.cc");
                    break;
                }
                case 9:{
                    Local.SetClanTag(" skeet.cc");
                    break;
                }
                case 10:{
                    Local.SetClanTag(" keet.cc");
                    break;
                }
                case 11:{
                    Local.SetClanTag(" eet.cc");
                    break;
                }
                case 12:{
                    Local.SetClanTag(" et.cc");
                    break;
                }
                case 13:{
                    Local.SetClanTag(" t.cc");
                    break;
                }
                case 14:{
                    Local.SetClanTag(" .cc");
                    break;
                }
                case 15:{
                    Local.SetClanTag(" cc");
                    break;
                }
                case 16:{
                    Local.SetClanTag(" c");
                    break;
                }
                case 17:{
                    Local.SetClanTag(" ");
                    break;
                }
            }
            if (ctag == 17){
                ctag = 0;
            }else{
                ctag = ctag+1;
            }
        lastTick = currentTick;
        }
    }
}
Cheat.RegisterCallback("Draw", "draw");
от души а сможешь помочь с ещё 1 жс плз
 
Начинающий
Статус
Оффлайн
Регистрация
16 Ноя 2020
Сообщения
82
Реакции[?]
5
Поинты[?]
0
Вот брат если можешь )

var screen_size = Global.GetScreenSize();
var jsLoaded = false;
var rageTarget=0;
function duplicate(theObject) {
return JSON.parse(JSON.stringify(theObject));
}
function initializeMenuItems() {
UI.AddCheckbox("Show Bullet Tracer");
UI.AddSliderInt("Bullet Tracer Thickness", 2, 10);
UI.AddColorPicker("Bullet Tracer Color");
jsLoaded=true;
}


function setValue(key, value) {
UI.SetValue("Misc", "JAVASCRIPT", "Script items", key, value);
}
function getColor(key) {
return UI.GetColor("Misc", "JAVASCRIPT", "Script items", key);
}
initializeMenuItems();
var logging = false;
var frameCount = 0;
var frameLimit = 60;
function onCreateMove() {
if(!jsLoaded)return;
}
function onDraw() {
if (getFrameCount() >= frameLimit) {
resetFrameCount();
}
UIUpdate();
nextFrame();
}
function onUnload() {
jsLoaded = false;
}
function nextFrame() {
frameCount++;
}
function resetFrameCount() {
frameCount = 0;
}
function getFrameCount() {
return frameCount;
}
function getRandomInteger(min, max) {
return min + Math.ceil(Math.random() * (max - min));
}
Cheat.RegisterCallback("CreateMove", "onCreateMove");
Cheat.RegisterCallback("Draw", "onDraw");
Cheat.RegisterCallback("Unload", "onUnload");
var bullets = [];
function UIUpdate() {
if (UI.GetValue("Misc", "JAVASCRIPT", "Script items","Show Bullet Tracer")) drawBulletTracer();
}
function UI_onBulletImpact() {
if (!UI.GetValue("Misc", "JAVASCRIPT", "Script items","Show Bullet Tracer")) return;
player = Entity.GetEntityFromUserID(Event.GetInt("userid"));
if (Entity.GetLocalPlayer() !== player) return;
if (bullets.length > 20) bullets = [];
eyePos = Entity.GetEyePosition(Entity.GetLocalPlayer());
vector = [Event.GetFloat("x") - eyePos[0], Event.GetFloat("y") - eyePos[1], Event.GetFloat("z") - eyePos[2]];
eyePos[0] += vector[0] * 0.01;
eyePos[1] += vector[1] * 0.01;
eyePos[2] += vector[2] * 0.01;
bullets.push({
"impact": [Event.GetFloat("x"), Event.GetFloat("y"), Event.GetFloat("z")],
"origin": eyePos,
"time": Globals.Curtime()
});
}
function drawBulletTracer() {
if (bullets.length < 1) return;
for (i = 0; i < bullets.length; i++) {
if (bullets != undefined) {
if (bullets["time"] + 2 < Globals.Curtime()) {
delete bullets;
} else {
impact = Render.WorldToScreen(bullets["impact"]);
origin = Render.WorldToScreen(bullets["origin"]);
if (origin != undefined && impact != undefined) {
if (origin[2] == 0 && !UI.IsHotkeyActive("Visual", "WORLD", "View", "Thirdperson")) {
vector = [bullets["impact"][0] - bullets["origin"][0], bullets["impact"][1] - bullets["origin"][1], bullets["impact"][2] - bullets["origin"][2]];
newOrigin = duplicate(bullets["origin"]);
length = getDistance(bullets["impact"], newOrigin) - getDistance(bullets["impact"], Entity.GetEyePosition(Entity.GetLocalPlayer()));
newOrigin[0] += vector[0] * (length / getDistance(bullets["impact"], newOrigin) + 0.05);
newOrigin[1] += vector[1] * (length / getDistance(bullets["impact"], newOrigin) + 0.05);
newOrigin[2] += vector[2] * (length / getDistance(bullets["impact"], newOrigin) + 0.05);
origin = Render.WorldToScreen(newOrigin);
}
if (impact[2] != 0 && origin[1] < screen_size[1] && origin[0] < screen_size[0] && origin[0] > 0) {
Render.Line(impact[0], impact[1], origin[0], origin[1], getColor("Bullet Tracer Color"));
step = Math.floor(getColor("Bullet Tracer Color")[3] / UI.GetValue("Misc", "JAVASCRIPT", "Script items","Bullet Tracer Thickness"));
for (x = 1; x < UI.GetValue("Misc", "JAVASCRIPT", "Script items","Bullet Tracer Thickness"); x++) {
Render.Line(impact[0] + (x - 1), impact[1], origin[0] + x, origin[1], [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
Render.Line(impact[0], impact[1] + (x - 1), origin[0], origin[1] + x, [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
Render.Line(impact[0] - (x - 1), impact[1], origin[0] - x, origin[1], [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
Render.Line(impact[0], impact[1] - (x - 1), origin[0], origin[1] - x, [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
}
}
}
}
}
}
}
function getDistance(A, B) {
return Math.sqrt(Math.pow(A[0] - B[0], 2) + Math.pow(A[1] - B[1], 2) + Math.pow(A[2] - B[2], 2));
}
Cheat.RegisterCallback('bullet_impact', 'UI_onBulletImpact');
 
SenkoTech dev
Пользователь
Статус
Оффлайн
Регистрация
4 Янв 2020
Сообщения
326
Реакции[?]
111
Поинты[?]
5K
Вот брат если можешь )

var screen_size = Global.GetScreenSize();
var jsLoaded = false;
var rageTarget=0;
function duplicate(theObject) {
return JSON.parse(JSON.stringify(theObject));
}
function initializeMenuItems() {
UI.AddCheckbox("Show Bullet Tracer");
UI.AddSliderInt("Bullet Tracer Thickness", 2, 10);
UI.AddColorPicker("Bullet Tracer Color");
jsLoaded=true;
}


function setValue(key, value) {
UI.SetValue("Misc", "JAVASCRIPT", "Script items", key, value);
}
function getColor(key) {
return UI.GetColor("Misc", "JAVASCRIPT", "Script items", key);
}
initializeMenuItems();
var logging = false;
var frameCount = 0;
var frameLimit = 60;
function onCreateMove() {
if(!jsLoaded)return;
}
function onDraw() {
if (getFrameCount() >= frameLimit) {
resetFrameCount();
}
UIUpdate();
nextFrame();
}
function onUnload() {
jsLoaded = false;
}
function nextFrame() {
frameCount++;
}
function resetFrameCount() {
frameCount = 0;
}
function getFrameCount() {
return frameCount;
}
function getRandomInteger(min, max) {
return min + Math.ceil(Math.random() * (max - min));
}
Cheat.RegisterCallback("CreateMove", "onCreateMove");
Cheat.RegisterCallback("Draw", "onDraw");
Cheat.RegisterCallback("Unload", "onUnload");
var bullets = [];
function UIUpdate() {
if (UI.GetValue("Misc", "JAVASCRIPT", "Script items","Show Bullet Tracer")) drawBulletTracer();
}
function UI_onBulletImpact() {
if (!UI.GetValue("Misc", "JAVASCRIPT", "Script items","Show Bullet Tracer")) return;
player = Entity.GetEntityFromUserID(Event.GetInt("userid"));
if (Entity.GetLocalPlayer() !== player) return;
if (bullets.length > 20) bullets = [];
eyePos = Entity.GetEyePosition(Entity.GetLocalPlayer());
vector = [Event.GetFloat("x") - eyePos[0], Event.GetFloat("y") - eyePos[1], Event.GetFloat("z") - eyePos[2]];
eyePos[0] += vector[0] * 0.01;
eyePos[1] += vector[1] * 0.01;
eyePos[2] += vector[2] * 0.01;
bullets.push({
"impact": [Event.GetFloat("x"), Event.GetFloat("y"), Event.GetFloat("z")],
"origin": eyePos,
"time": Globals.Curtime()
});
}
function drawBulletTracer() {
if (bullets.length < 1) return;
for (i = 0; i < bullets.length; i++) {
if (bullets != undefined) {
if (bullets["time"] + 2 < Globals.Curtime()) {
delete bullets;
} else {
impact = Render.WorldToScreen(bullets["impact"]);
origin = Render.WorldToScreen(bullets["origin"]);
if (origin != undefined && impact != undefined) {
if (origin[2] == 0 && !UI.IsHotkeyActive("Visual", "WORLD", "View", "Thirdperson")) {
vector = [bullets["impact"][0] - bullets["origin"][0], bullets["impact"][1] - bullets["origin"][1], bullets["impact"][2] - bullets["origin"][2]];
newOrigin = duplicate(bullets["origin"]);
length = getDistance(bullets["impact"], newOrigin) - getDistance(bullets["impact"], Entity.GetEyePosition(Entity.GetLocalPlayer()));
newOrigin[0] += vector[0] * (length / getDistance(bullets["impact"], newOrigin) + 0.05);
newOrigin[1] += vector[1] * (length / getDistance(bullets["impact"], newOrigin) + 0.05);
newOrigin[2] += vector[2] * (length / getDistance(bullets["impact"], newOrigin) + 0.05);
origin = Render.WorldToScreen(newOrigin);
}
if (impact[2] != 0 && origin[1] < screen_size[1] && origin[0] < screen_size[0] && origin[0] > 0) {
Render.Line(impact[0], impact[1], origin[0], origin[1], getColor("Bullet Tracer Color"));
step = Math.floor(getColor("Bullet Tracer Color")[3] / UI.GetValue("Misc", "JAVASCRIPT", "Script items","Bullet Tracer Thickness"));
for (x = 1; x < UI.GetValue("Misc", "JAVASCRIPT", "Script items","Bullet Tracer Thickness"); x++) {
Render.Line(impact[0] + (x - 1), impact[1], origin[0] + x, origin[1], [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
Render.Line(impact[0], impact[1] + (x - 1), origin[0], origin[1] + x, [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
Render.Line(impact[0] - (x - 1), impact[1], origin[0] - x, origin[1], [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
Render.Line(impact[0], impact[1] - (x - 1), origin[0], origin[1] - x, [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
}
}
}
}
}
}
}
function getDistance(A, B) {
return Math.sqrt(Math.pow(A[0] - B[0], 2) + Math.pow(A[1] - B[1], 2) + Math.pow(A[2] - B[2], 2));
}
Cheat.RegisterCallback('bullet_impact', 'UI_onBulletImpact');
Можно делать через эту штуку?1619106494447.png
А то как я могу это нормально копировать + фиксить space'ы?
 
Начинающий
Статус
Оффлайн
Регистрация
16 Ноя 2020
Сообщения
82
Реакции[?]
5
Поинты[?]
0
Можно делать через эту штуку?Посмотреть вложение 144988
А то как я могу это нормально копировать + фиксить space'ы?
Код:
var screen_size = Global.GetScreenSize();
var jsLoaded = false;
var rageTarget=0;
function duplicate(theObject) {
    return JSON.parse(JSON.stringify(theObject));
}
function initializeMenuItems() {
    UI.AddCheckbox("Show Bullet Tracer");
    UI.AddSliderInt("Bullet Tracer Thickness", 2, 10);
    UI.AddColorPicker("Bullet Tracer Color");
    jsLoaded=true;
}


function setValue(key, value) {
    UI.SetValue("Misc", "JAVASCRIPT", "Script items", key, value);
}
function getColor(key) {
    return UI.GetColor("Misc", "JAVASCRIPT", "Script items", key);
}
initializeMenuItems();
var logging = false;
var frameCount = 0;
var frameLimit = 60;
function onCreateMove() {
    if(!jsLoaded)return;
}
function onDraw() {
    if (getFrameCount() >= frameLimit) {
        resetFrameCount();
    }
    UIUpdate();
    nextFrame();
}
function onUnload() {
    jsLoaded = false;
}
function nextFrame() {
    frameCount++;
}
function resetFrameCount() {
    frameCount = 0;
}
function getFrameCount() {
    return frameCount;
}
function getRandomInteger(min, max) {
    return min + Math.ceil(Math.random() * (max - min));
}
Cheat.RegisterCallback("CreateMove", "onCreateMove");
Cheat.RegisterCallback("Draw", "onDraw");
Cheat.RegisterCallback("Unload", "onUnload");
var bullets = [];
function UIUpdate() {
    if (UI.GetValue("Misc", "JAVASCRIPT", "Script items","Show Bullet Tracer")) drawBulletTracer();
}
function UI_onBulletImpact() {
    if (!UI.GetValue("Misc", "JAVASCRIPT", "Script items","Show Bullet Tracer")) return;
    player = Entity.GetEntityFromUserID(Event.GetInt("userid"));
    if (Entity.GetLocalPlayer() !== player) return;
    if (bullets.length > 20) bullets = [];
    eyePos = Entity.GetEyePosition(Entity.GetLocalPlayer());
    vector = [Event.GetFloat("x") - eyePos[0], Event.GetFloat("y") - eyePos[1], Event.GetFloat("z") - eyePos[2]];
    eyePos[0] += vector[0] * 0.01;
    eyePos[1] += vector[1] * 0.01;
    eyePos[2] += vector[2] * 0.01;
    bullets.push({
        "impact": [Event.GetFloat("x"), Event.GetFloat("y"), Event.GetFloat("z")],
        "origin": eyePos,
        "time": Globals.Curtime()
    });
}
function drawBulletTracer() {
    if (bullets.length < 1) return;
    for (i = 0; i < bullets.length; i++) {
        if (bullets[i] != undefined) {
            if (bullets[i]["time"] + 2 < Globals.Curtime()) {
                delete bullets[i];
            } else {
                impact = Render.WorldToScreen(bullets[i]["impact"]);
                origin = Render.WorldToScreen(bullets[i]["origin"]);
                if (origin != undefined && impact != undefined) {
                    if (origin[2] == 0 && !UI.IsHotkeyActive("Visual", "WORLD", "View", "Thirdperson")) {
                        vector = [bullets[i]["impact"][0] - bullets[i]["origin"][0], bullets[i]["impact"][1] - bullets[i]["origin"][1], bullets[i]["impact"][2] - bullets[i]["origin"][2]];
                        newOrigin = duplicate(bullets[i]["origin"]);
                        length = getDistance(bullets[i]["impact"], newOrigin) - getDistance(bullets[i]["impact"], Entity.GetEyePosition(Entity.GetLocalPlayer()));
                        newOrigin[0] += vector[0] * (length / getDistance(bullets[i]["impact"], newOrigin) + 0.05);
                        newOrigin[1] += vector[1] * (length / getDistance(bullets[i]["impact"], newOrigin) + 0.05);
                        newOrigin[2] += vector[2] * (length / getDistance(bullets[i]["impact"], newOrigin) + 0.05);
                        origin = Render.WorldToScreen(newOrigin);
                    }
                    if (impact[2] != 0 && origin[1] < screen_size[1] && origin[0] < screen_size[0] && origin[0] > 0) {
                        Render.Line(impact[0], impact[1], origin[0], origin[1], getColor("Bullet Tracer Color"));
                        step = Math.floor(getColor("Bullet Tracer Color")[3] / UI.GetValue("Misc", "JAVASCRIPT", "Script items","Bullet Tracer Thickness"));
                        for (x = 1; x < UI.GetValue("Misc", "JAVASCRIPT", "Script items","Bullet Tracer Thickness"); x++) {
                            Render.Line(impact[0] + (x - 1), impact[1], origin[0] + x, origin[1], [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
                            Render.Line(impact[0], impact[1] + (x - 1), origin[0], origin[1] + x, [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
                            Render.Line(impact[0] - (x - 1), impact[1], origin[0] - x, origin[1], [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
                            Render.Line(impact[0], impact[1] - (x - 1), origin[0], origin[1] - x, [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
                        }
                    }
                }
            }
        }
    }
}
function getDistance(A, B) {
    return Math.sqrt(Math.pow(A[0] - B[0], 2) + Math.pow(A[1] - B[1], 2) + Math.pow(A[2] - B[2], 2));
}
Cheat.RegisterCallback('bullet_impact', 'UI_onBulletImpact');
 
SenkoTech dev
Пользователь
Статус
Оффлайн
Регистрация
4 Янв 2020
Сообщения
326
Реакции[?]
111
Поинты[?]
5K
Код:
var screen_size = Global.GetScreenSize();
var jsLoaded = false;
var rageTarget=0;
function duplicate(theObject) {
    return JSON.parse(JSON.stringify(theObject));
}
function initializeMenuItems() {
    UI.AddCheckbox("Show Bullet Tracer");
    UI.AddSliderInt("Bullet Tracer Thickness", 2, 10);
    UI.AddColorPicker("Bullet Tracer Color");
    jsLoaded=true;
}


function setValue(key, value) {
    UI.SetValue("Misc", "JAVASCRIPT", "Script items", key, value);
}
function getColor(key) {
    return UI.GetColor("Misc", "JAVASCRIPT", "Script items", key);
}
initializeMenuItems();
var logging = false;
var frameCount = 0;
var frameLimit = 60;
function onCreateMove() {
    if(!jsLoaded)return;
}
function onDraw() {
    if (getFrameCount() >= frameLimit) {
        resetFrameCount();
    }
    UIUpdate();
    nextFrame();
}
function onUnload() {
    jsLoaded = false;
}
function nextFrame() {
    frameCount++;
}
function resetFrameCount() {
    frameCount = 0;
}
function getFrameCount() {
    return frameCount;
}
function getRandomInteger(min, max) {
    return min + Math.ceil(Math.random() * (max - min));
}
Cheat.RegisterCallback("CreateMove", "onCreateMove");
Cheat.RegisterCallback("Draw", "onDraw");
Cheat.RegisterCallback("Unload", "onUnload");
var bullets = [];
function UIUpdate() {
    if (UI.GetValue("Misc", "JAVASCRIPT", "Script items","Show Bullet Tracer")) drawBulletTracer();
}
function UI_onBulletImpact() {
    if (!UI.GetValue("Misc", "JAVASCRIPT", "Script items","Show Bullet Tracer")) return;
    player = Entity.GetEntityFromUserID(Event.GetInt("userid"));
    if (Entity.GetLocalPlayer() !== player) return;
    if (bullets.length > 20) bullets = [];
    eyePos = Entity.GetEyePosition(Entity.GetLocalPlayer());
    vector = [Event.GetFloat("x") - eyePos[0], Event.GetFloat("y") - eyePos[1], Event.GetFloat("z") - eyePos[2]];
    eyePos[0] += vector[0] * 0.01;
    eyePos[1] += vector[1] * 0.01;
    eyePos[2] += vector[2] * 0.01;
    bullets.push({
        "impact": [Event.GetFloat("x"), Event.GetFloat("y"), Event.GetFloat("z")],
        "origin": eyePos,
        "time": Globals.Curtime()
    });
}
function drawBulletTracer() {
    if (bullets.length < 1) return;
    for (i = 0; i < bullets.length; i++) {
        if (bullets[i] != undefined) {
            if (bullets[i]["time"] + 2 < Globals.Curtime()) {
                delete bullets[i];
            } else {
                impact = Render.WorldToScreen(bullets[i]["impact"]);
                origin = Render.WorldToScreen(bullets[i]["origin"]);
                if (origin != undefined && impact != undefined) {
                    if (origin[2] == 0 && !UI.IsHotkeyActive("Visual", "WORLD", "View", "Thirdperson")) {
                        vector = [bullets[i]["impact"][0] - bullets[i]["origin"][0], bullets[i]["impact"][1] - bullets[i]["origin"][1], bullets[i]["impact"][2] - bullets[i]["origin"][2]];
                        newOrigin = duplicate(bullets[i]["origin"]);
                        length = getDistance(bullets[i]["impact"], newOrigin) - getDistance(bullets[i]["impact"], Entity.GetEyePosition(Entity.GetLocalPlayer()));
                        newOrigin[0] += vector[0] * (length / getDistance(bullets[i]["impact"], newOrigin) + 0.05);
                        newOrigin[1] += vector[1] * (length / getDistance(bullets[i]["impact"], newOrigin) + 0.05);
                        newOrigin[2] += vector[2] * (length / getDistance(bullets[i]["impact"], newOrigin) + 0.05);
                        origin = Render.WorldToScreen(newOrigin);
                    }
                    if (impact[2] != 0 && origin[1] < screen_size[1] && origin[0] < screen_size[0] && origin[0] > 0) {
                        Render.Line(impact[0], impact[1], origin[0], origin[1], getColor("Bullet Tracer Color"));
                        step = Math.floor(getColor("Bullet Tracer Color")[3] / UI.GetValue("Misc", "JAVASCRIPT", "Script items","Bullet Tracer Thickness"));
                        for (x = 1; x < UI.GetValue("Misc", "JAVASCRIPT", "Script items","Bullet Tracer Thickness"); x++) {
                            Render.Line(impact[0] + (x - 1), impact[1], origin[0] + x, origin[1], [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
                            Render.Line(impact[0], impact[1] + (x - 1), origin[0], origin[1] + x, [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
                            Render.Line(impact[0] - (x - 1), impact[1], origin[0] - x, origin[1], [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
                            Render.Line(impact[0], impact[1] - (x - 1), origin[0], origin[1] - x, [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
                        }
                    }
                }
            }
        }
    }
}
function getDistance(A, B) {
    return Math.sqrt(Math.pow(A[0] - B[0], 2) + Math.pow(A[1] - B[1], 2) + Math.pow(A[2] - B[2], 2));
}
Cheat.RegisterCallback('bullet_impact', 'UI_onBulletImpact');
JavaScript:
var screen_size = Global.GetScreenSize();
var jsLoaded = false;
var rageTarget=0;
function duplicate(theObject) {
    return JSON.parse(JSON.stringify(theObject));
}
function initializeMenuItems() {
    UI.AddCheckbox("Bullet tracer menu")
    UI.AddCheckbox("Show Bullet Tracer");
    UI.AddSliderInt("Bullet Tracer Thickness", 2, 10);
    UI.AddColorPicker("Bullet Tracer Color");
    jsLoaded=true;
}

function hide_menu() {
    if(UI.IsMenuOpen()) {
        check_hide = UI.GetValue("Bullet tracer menu")
        UI.SetEnabled("Show Bullet Tracer", check_hide)
        UI.SetEnabled("Bullet Tracer Thickness", check_hide)
        UI.SetEnabled("Bullet Tracer Color", check_hide)
    }
}
Cheat.RegisterCallback("Draw", "hide_menu")

function setValue(key, value) {
    UI.SetValue("Misc", "JAVASCRIPT", "Script items", key, value);
}
function getColor(key) {
    return UI.GetColor("Misc", "JAVASCRIPT", "Script items", key);
}
initializeMenuItems();
var logging = false;
var frameCount = 0;
var frameLimit = 60;
function onCreateMove() {
    if(!jsLoaded)return;
}
function onDraw() {
    if (getFrameCount() >= frameLimit) {
        resetFrameCount();
    }
    UIUpdate();
    nextFrame();
}
function onUnload() {
    jsLoaded = false;
}
function nextFrame() {
    frameCount++;
}
function resetFrameCount() {
    frameCount = 0;
}
function getFrameCount() {
    return frameCount;
}
function getRandomInteger(min, max) {
    return min + Math.ceil(Math.random() * (max - min));
}
Cheat.RegisterCallback("CreateMove", "onCreateMove");
Cheat.RegisterCallback("Draw", "onDraw");
Cheat.RegisterCallback("Unload", "onUnload");
var bullets = [];
function UIUpdate() {
    if (UI.GetValue("Misc", "JAVASCRIPT", "Script items","Show Bullet Tracer")) drawBulletTracer();
}
function UI_onBulletImpact() {
    if (!UI.GetValue("Misc", "JAVASCRIPT", "Script items","Show Bullet Tracer")) return;
    player = Entity.GetEntityFromUserID(Event.GetInt("userid"));
    if (Entity.GetLocalPlayer() !== player) return;
    if (bullets.length > 20) bullets = [];
    eyePos = Entity.GetEyePosition(Entity.GetLocalPlayer());
    vector = [Event.GetFloat("x") - eyePos[0], Event.GetFloat("y") - eyePos[1], Event.GetFloat("z") - eyePos[2]];
    eyePos[0] += vector[0] * 0.01;
    eyePos[1] += vector[1] * 0.01;
    eyePos[2] += vector[2] * 0.01;
    bullets.push({
        "impact": [Event.GetFloat("x"), Event.GetFloat("y"), Event.GetFloat("z")],
        "origin": eyePos,
        "time": Globals.Curtime()
    });
}
function drawBulletTracer() {
    if (bullets.length < 1) return;
    for (i = 0; i < bullets.length; i++) {
        if (bullets[i] != undefined) {
            if (bullets[i]["time"] + 2 < Globals.Curtime()) {
                delete bullets[i];
            } else {
                impact = Render.WorldToScreen(bullets[i]["impact"]);
                origin = Render.WorldToScreen(bullets[i]["origin"]);
                if (origin != undefined && impact != undefined) {
                    if (origin[2] == 0 && !UI.IsHotkeyActive("Visual", "WORLD", "View", "Thirdperson")) {
                        vector = [bullets[i]["impact"][0] - bullets[i]["origin"][0], bullets[i]["impact"][1] - bullets[i]["origin"][1], bullets[i]["impact"][2] - bullets[i]["origin"][2]];
                        newOrigin = duplicate(bullets[i]["origin"]);
                        length = getDistance(bullets[i]["impact"], newOrigin) - getDistance(bullets[i]["impact"], Entity.GetEyePosition(Entity.GetLocalPlayer()));
                        newOrigin[0] += vector[0] * (length / getDistance(bullets[i]["impact"], newOrigin) + 0.05);
                        newOrigin[1] += vector[1] * (length / getDistance(bullets[i]["impact"], newOrigin) + 0.05);
                        newOrigin[2] += vector[2] * (length / getDistance(bullets[i]["impact"], newOrigin) + 0.05);
                        origin = Render.WorldToScreen(newOrigin);
                    }
                    if (impact[2] != 0 && origin[1] < screen_size[1] && origin[0] < screen_size[0] && origin[0] > 0) {
                        Render.Line(impact[0], impact[1], origin[0], origin[1], getColor("Bullet Tracer Color"));
                        step = Math.floor(getColor("Bullet Tracer Color")[3] / UI.GetValue("Misc", "JAVASCRIPT", "Script items","Bullet Tracer Thickness"));
                        for (x = 1; x < UI.GetValue("Misc", "JAVASCRIPT", "Script items","Bullet Tracer Thickness"); x++) {
                            Render.Line(impact[0] + (x - 1), impact[1], origin[0] + x, origin[1], [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
                            Render.Line(impact[0], impact[1] + (x - 1), origin[0], origin[1] + x, [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
                            Render.Line(impact[0] - (x - 1), impact[1], origin[0] - x, origin[1], [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
                            Render.Line(impact[0], impact[1] - (x - 1), origin[0], origin[1] - x, [getColor("Bullet Tracer Color")[0], getColor("Bullet Tracer Color")[1], getColor("Bullet Tracer Color")[2], getColor("Bullet Tracer Color")[3] - (x * step)]);
                        }
                    }
                }
            }
        }
    }
}
function getDistance(A, B) {
    return Math.sqrt(Math.pow(A[0] - B[0], 2) + Math.pow(A[1] - B[1], 2) + Math.pow(A[2] - B[2], 2));
}
Cheat.RegisterCallback('bullet_impact', 'UI_onBulletImpact');
 
Сверху Снизу