Вопрос Как сделать чтобы checkbox вызывал функцию?

Участник
Статус
Оффлайн
Регистрация
29 Дек 2018
Сообщения
1,416
Реакции[?]
158
Поинты[?]
1K
есть джс.

Код:
UI.AddCheckbox( "PCinfo" );
function HSVtoRGB(h, s, v){
}

function getCustomValue(xy) {
  var value = UI.GetValue("MISC", "JAVASCRIPT", "Script items", xy);
return value;}
var position = {
  x1: 0,
  y1: 0
}

function watermark()
{
  
    var colors = HSVtoRGB(Global.Realtime() * UI.GetValue("MISC", "JAVASCRIPT", "Script Items", "Watermark Gradient Speed"), 1, 1);
  
    const ping = Math.floor(Global.Latency() * 1000 / 1.5 );
    const fps = Math.floor( 1 / Global.Frametime() );
      
  
    x1 = getCustomValue("Watermark x");
    y1 = getCustomValue("Watermark y"); 
    var today = new Date();
    var hours1 = today.getHours();
    var minutes1 = today.getMinutes();
    var seconds1 = today.getSeconds();
    var hours = hours1 <= 9 ? "0" + today.getHours() + ":" : today.getHours() + ":";
    var minutes = minutes1 <= 9 ? "0" + today.getMinutes() + ":" : today.getMinutes() + ":";
    var seconds = seconds1 <= 9 ? "0" + today.getSeconds() : today.getSeconds()    ;

  

    var tickrate = Global.Tickrate()
    //Render.FilledRect( x1 + 45, y1 + 2, 260, 55 , [ 30, 30, 30, 150 ] ); // background
    //Render.Rect( x1 + 45, y1 + 2, 260, 55, [ 30, 30, 30, 255 ] );
    //Render.FilledRect( x1 + 50, y1 + 7, 250, 45, [ 30, 30, 30, 255 ] ); // background1
    Render.String( x1 + 122, y1 + 37, 0, "TCK   ", [ 120, 120, 120, 255 ], 3 ); //TCK
    Render.String( x1 + 127, y1 + 37, 0, "          " + tickrate, [ 255, 255, 255, 220 ], 3 ); // TCK1
    Render.Rect( x1 + 120, y1 + 35, 23, 13, [ 120, 120, 120, 255] ); // TCK2
    Render.Rect( x1 + 170, y1 + 35, 6, 13, [ 120, 120, 120, 255] ) ;// ping
    Render.Rect( x1 + 177, y1 + 38, 6, 10, [ 120, 120, 120, 255] ); // ping1
    Render.Rect( x1 + 184, y1 + 41, 6, 7, [ 120, 120, 120, 255] ); // ping2
    Render.Circle( x1 + 237, y1 + 41, 6, [ 120, 120, 120, 255 ] ) ;// clock
    Render.Line( x1 + 237, y1 + 42, x1 + 237, y1 + 36, [ 120, 120, 120, 255 ] ); // clock1
    Render.Line( x1 + 237, y1 + 42, x1 + 243, y1 + 42, [ 120, 120, 120, 255 ] ); // clock2
    Render.String( x1 + 192, y1 + 37, 0, " " + ping + "ms", [ 255, 255, 255, 200 ], 3 );
    Render.Rect( x1 + 65, y1 + 35, 21, 13, [ 120, 120, 120, 255] ); // fps1
    Render.String( x1 + 67, y1 + 37, 0, "FPS   " , [ 120, 120, 120, 255 ], 3 );
    Render.String( x1 + 72, y1 + 37, 0, "           " + fps , [ 255, 255, 255, 220 ], 3 );
    Render.String( x1 + 247, y1 + 37, 0, " " + hours + minutes + seconds, [ 255, 255, 255, 220 ], 3 );

  
}

function main()
{
        var screensize = Global.GetScreenSize();
        UI.AddSliderInt("Watermark x", 0, screensize[0]);
        UI.AddSliderInt("Watermark y", 0, screensize[1]);
}
main()

Global.RegisterCallback("Draw", "watermark");
UI.SetValue("MISC", "JAVASCRIPT", "Script Items", "Watermark Gradient Speed", 0.1);
нужно сделать так чтобы чекбокс вызывал этот ватермарк помогите кто сможет)
 
Эксперт
Статус
Оффлайн
Регистрация
19 Дек 2018
Сообщения
2,957
Реакции[?]
491
Поинты[?]
1K
JavaScript:
function Main()
{
    Global.RegisterCallback("Draw", "HUD_REDRAW");
    Global.RegisterCallback("player_hurt", "EVENT_PLAYER_HURT");
    Global.RegisterCallback("CreateMove", "pushY");
    UI.AddCheckbox('Quake Damage Numbers');
    UI.AddColorPicker("DMG Color");
    UI.AddCheckbox("Premade Settings");
}
есть джс.

Код:
UI.AddCheckbox( "PCinfo" );
function HSVtoRGB(h, s, v){
}

function getCustomValue(xy) {
  var value = UI.GetValue("MISC", "JAVASCRIPT", "Script items", xy);
return value;}
var position = {
  x1: 0,
  y1: 0
}

function watermark()
{

    var colors = HSVtoRGB(Global.Realtime() * UI.GetValue("MISC", "JAVASCRIPT", "Script Items", "Watermark Gradient Speed"), 1, 1);

    const ping = Math.floor(Global.Latency() * 1000 / 1.5 );
    const fps = Math.floor( 1 / Global.Frametime() );
   

    x1 = getCustomValue("Watermark x");
    y1 = getCustomValue("Watermark y");
    var today = new Date();
    var hours1 = today.getHours();
    var minutes1 = today.getMinutes();
    var seconds1 = today.getSeconds();
    var hours = hours1 <= 9 ? "0" + today.getHours() + ":" : today.getHours() + ":";
    var minutes = minutes1 <= 9 ? "0" + today.getMinutes() + ":" : today.getMinutes() + ":";
    var seconds = seconds1 <= 9 ? "0" + today.getSeconds() : today.getSeconds()    ;



    var tickrate = Global.Tickrate()
    //Render.FilledRect( x1 + 45, y1 + 2, 260, 55 , [ 30, 30, 30, 150 ] ); // background
    //Render.Rect( x1 + 45, y1 + 2, 260, 55, [ 30, 30, 30, 255 ] );
    //Render.FilledRect( x1 + 50, y1 + 7, 250, 45, [ 30, 30, 30, 255 ] ); // background1
    Render.String( x1 + 122, y1 + 37, 0, "TCK   ", [ 120, 120, 120, 255 ], 3 ); //TCK
    Render.String( x1 + 127, y1 + 37, 0, "          " + tickrate, [ 255, 255, 255, 220 ], 3 ); // TCK1
    Render.Rect( x1 + 120, y1 + 35, 23, 13, [ 120, 120, 120, 255] ); // TCK2
    Render.Rect( x1 + 170, y1 + 35, 6, 13, [ 120, 120, 120, 255] ) ;// ping
    Render.Rect( x1 + 177, y1 + 38, 6, 10, [ 120, 120, 120, 255] ); // ping1
    Render.Rect( x1 + 184, y1 + 41, 6, 7, [ 120, 120, 120, 255] ); // ping2
    Render.Circle( x1 + 237, y1 + 41, 6, [ 120, 120, 120, 255 ] ) ;// clock
    Render.Line( x1 + 237, y1 + 42, x1 + 237, y1 + 36, [ 120, 120, 120, 255 ] ); // clock1
    Render.Line( x1 + 237, y1 + 42, x1 + 243, y1 + 42, [ 120, 120, 120, 255 ] ); // clock2
    Render.String( x1 + 192, y1 + 37, 0, " " + ping + "ms", [ 255, 255, 255, 200 ], 3 );
    Render.Rect( x1 + 65, y1 + 35, 21, 13, [ 120, 120, 120, 255] ); // fps1
    Render.String( x1 + 67, y1 + 37, 0, "FPS   " , [ 120, 120, 120, 255 ], 3 );
    Render.String( x1 + 72, y1 + 37, 0, "           " + fps , [ 255, 255, 255, 220 ], 3 );
    Render.String( x1 + 247, y1 + 37, 0, " " + hours + minutes + seconds, [ 255, 255, 255, 220 ], 3 );


}

function main()
{
        var screensize = Global.GetScreenSize();
        UI.AddSliderInt("Watermark x", 0, screensize[0]);
        UI.AddSliderInt("Watermark y", 0, screensize[1]);
}
main()

Global.RegisterCallback("Draw", "watermark");
UI.SetValue("MISC", "JAVASCRIPT", "Script Items", "Watermark Gradient Speed", 0.1);
нужно сделать так чтобы чекбокс вызывал этот ватермарк помогите кто сможет)
Поймёшь думаю
 
Участник
Статус
Оффлайн
Регистрация
29 Дек 2018
Сообщения
1,416
Реакции[?]
158
Поинты[?]
1K
Та и вот
function Main()
{
Global.RegisterCallback("Draw", "HUD_REDRAW");
Global.RegisterCallback("player_hurt", "EVENT_PLAYER_HURT");
Global.RegisterCallback("CreateMove", "pushY");
UI.AddCheckbox('Quake Damage Numbers');
UI.AddColorPicker("DMG Color");
UI.AddCheckbox("Premade Settings");
}
надеюсь из этого куска кода поймёшь
ахуеть а можешь это релизовать в моей джс чтобы, я хотябы примерно понял?
 
Эксперт
Статус
Оффлайн
Регистрация
19 Дек 2018
Сообщения
2,957
Реакции[?]
491
Поинты[?]
1K
function main()
{
var screensize = Global.GetScreenSize();
UI.AddSliderInt("Watermark x", 0, screensize[0]);
UI.AddSliderInt("Watermark y", 0, screensize[1]);
UI.AddCheckbox( 'Pcinfo' );
}
Ну мб я дебил но вть переделка
 
Последнее редактирование:
Участник
Статус
Оффлайн
Регистрация
29 Дек 2018
Сообщения
1,416
Реакции[?]
158
Поинты[?]
1K
Пользователь
Статус
Оффлайн
Регистрация
25 Сен 2017
Сообщения
216
Реакции[?]
50
Поинты[?]
0
есть джс.

Код:
UI.AddCheckbox( "PCinfo" );
function HSVtoRGB(h, s, v){
}

function getCustomValue(xy) {
  var value = UI.GetValue("MISC", "JAVASCRIPT", "Script items", xy);
return value;}
var position = {
  x1: 0,
  y1: 0
}

function watermark()
{
 
    var colors = HSVtoRGB(Global.Realtime() * UI.GetValue("MISC", "JAVASCRIPT", "Script Items", "Watermark Gradient Speed"), 1, 1);
 
    const ping = Math.floor(Global.Latency() * 1000 / 1.5 );
    const fps = Math.floor( 1 / Global.Frametime() );
     
 
    x1 = getCustomValue("Watermark x");
    y1 = getCustomValue("Watermark y");
    var today = new Date();
    var hours1 = today.getHours();
    var minutes1 = today.getMinutes();
    var seconds1 = today.getSeconds();
    var hours = hours1 <= 9 ? "0" + today.getHours() + ":" : today.getHours() + ":";
    var minutes = minutes1 <= 9 ? "0" + today.getMinutes() + ":" : today.getMinutes() + ":";
    var seconds = seconds1 <= 9 ? "0" + today.getSeconds() : today.getSeconds()    ;

 

    var tickrate = Global.Tickrate()
    //Render.FilledRect( x1 + 45, y1 + 2, 260, 55 , [ 30, 30, 30, 150 ] ); // background
    //Render.Rect( x1 + 45, y1 + 2, 260, 55, [ 30, 30, 30, 255 ] );
    //Render.FilledRect( x1 + 50, y1 + 7, 250, 45, [ 30, 30, 30, 255 ] ); // background1
    Render.String( x1 + 122, y1 + 37, 0, "TCK   ", [ 120, 120, 120, 255 ], 3 ); //TCK
    Render.String( x1 + 127, y1 + 37, 0, "          " + tickrate, [ 255, 255, 255, 220 ], 3 ); // TCK1
    Render.Rect( x1 + 120, y1 + 35, 23, 13, [ 120, 120, 120, 255] ); // TCK2
    Render.Rect( x1 + 170, y1 + 35, 6, 13, [ 120, 120, 120, 255] ) ;// ping
    Render.Rect( x1 + 177, y1 + 38, 6, 10, [ 120, 120, 120, 255] ); // ping1
    Render.Rect( x1 + 184, y1 + 41, 6, 7, [ 120, 120, 120, 255] ); // ping2
    Render.Circle( x1 + 237, y1 + 41, 6, [ 120, 120, 120, 255 ] ) ;// clock
    Render.Line( x1 + 237, y1 + 42, x1 + 237, y1 + 36, [ 120, 120, 120, 255 ] ); // clock1
    Render.Line( x1 + 237, y1 + 42, x1 + 243, y1 + 42, [ 120, 120, 120, 255 ] ); // clock2
    Render.String( x1 + 192, y1 + 37, 0, " " + ping + "ms", [ 255, 255, 255, 200 ], 3 );
    Render.Rect( x1 + 65, y1 + 35, 21, 13, [ 120, 120, 120, 255] ); // fps1
    Render.String( x1 + 67, y1 + 37, 0, "FPS   " , [ 120, 120, 120, 255 ], 3 );
    Render.String( x1 + 72, y1 + 37, 0, "           " + fps , [ 255, 255, 255, 220 ], 3 );
    Render.String( x1 + 247, y1 + 37, 0, " " + hours + minutes + seconds, [ 255, 255, 255, 220 ], 3 );

 
}

function main()
{
        var screensize = Global.GetScreenSize();
        UI.AddSliderInt("Watermark x", 0, screensize[0]);
        UI.AddSliderInt("Watermark y", 0, screensize[1]);
}
main()

Global.RegisterCallback("Draw", "watermark");
UI.SetValue("MISC", "JAVASCRIPT", "Script Items", "Watermark Gradient Speed", 0.1);
нужно сделать так чтобы чекбокс вызывал этот ватермарк помогите кто сможет)
JavaScript:
UI.AddCheckbox( "PCinfo" );
function HSVtoRGB(h, s, v){
}

function getCustomValue(xy) {
  var value = UI.GetValue("MISC", "JAVASCRIPT", "Script items", xy);
return value;}
var position = {
  x1: 0,
  y1: 0
}

function watermark()
{
    if (UI.GetValue("MISC", "JAVASCRIPT", "Script items", "PCinfo"))
    {
        var colors = HSVtoRGB(Global.Realtime() * UI.GetValue("MISC", "JAVASCRIPT", "Script Items", "Watermark Gradient Speed"), 1, 1);
    
        const ping = Math.floor(Global.Latency() * 1000 / 1.5 );
        const fps = Math.floor( 1 / Global.Frametime() );
        
    
        x1 = getCustomValue("Watermark x");
        y1 = getCustomValue("Watermark y");
        var today = new Date();
        var hours1 = today.getHours();
        var minutes1 = today.getMinutes();
        var seconds1 = today.getSeconds();
        var hours = hours1 <= 9 ? "0" + today.getHours() + ":" : today.getHours() + ":";
        var minutes = minutes1 <= 9 ? "0" + today.getMinutes() + ":" : today.getMinutes() + ":";
        var seconds = seconds1 <= 9 ? "0" + today.getSeconds() : today.getSeconds()    ;

    

        var tickrate = Global.Tickrate()
        //Render.FilledRect( x1 + 45, y1 + 2, 260, 55 , [ 30, 30, 30, 150 ] ); // background
        //Render.Rect( x1 + 45, y1 + 2, 260, 55, [ 30, 30, 30, 255 ] );
        //Render.FilledRect( x1 + 50, y1 + 7, 250, 45, [ 30, 30, 30, 255 ] ); // background1
        Render.String( x1 + 122, y1 + 37, 0, "TCK   ", [ 120, 120, 120, 255 ], 3 ); //TCK
        Render.String( x1 + 127, y1 + 37, 0, "          " + tickrate, [ 255, 255, 255, 220 ], 3 ); // TCK1
        Render.Rect( x1 + 120, y1 + 35, 23, 13, [ 120, 120, 120, 255] ); // TCK2
        Render.Rect( x1 + 170, y1 + 35, 6, 13, [ 120, 120, 120, 255] ) ;// ping
        Render.Rect( x1 + 177, y1 + 38, 6, 10, [ 120, 120, 120, 255] ); // ping1
        Render.Rect( x1 + 184, y1 + 41, 6, 7, [ 120, 120, 120, 255] ); // ping2
        Render.Circle( x1 + 237, y1 + 41, 6, [ 120, 120, 120, 255 ] ) ;// clock
        Render.Line( x1 + 237, y1 + 42, x1 + 237, y1 + 36, [ 120, 120, 120, 255 ] ); // clock1
        Render.Line( x1 + 237, y1 + 42, x1 + 243, y1 + 42, [ 120, 120, 120, 255 ] ); // clock2
        Render.String( x1 + 192, y1 + 37, 0, " " + ping + "ms", [ 255, 255, 255, 200 ], 3 );
        Render.Rect( x1 + 65, y1 + 35, 21, 13, [ 120, 120, 120, 255] ); // fps1
        Render.String( x1 + 67, y1 + 37, 0, "FPS   " , [ 120, 120, 120, 255 ], 3 );
        Render.String( x1 + 72, y1 + 37, 0, "           " + fps , [ 255, 255, 255, 220 ], 3 );
        Render.String( x1 + 247, y1 + 37, 0, " " + hours + minutes + seconds, [ 255, 255, 255, 220 ], 3 );
    }
}

function main()
{
        var screensize = Global.GetScreenSize();
        UI.AddSliderInt("Watermark x", 0, screensize[0]);
        UI.AddSliderInt("Watermark y", 0, screensize[1]);
}
main()

Global.RegisterCallback("Draw", "watermark");
UI.SetValue("MISC", "JAVASCRIPT", "Script Items", "Watermark Gradient Speed", 0.1);
 
Пользователь
Статус
Оффлайн
Регистрация
25 Сен 2017
Сообщения
216
Реакции[?]
50
Поинты[?]
0
есть джс.

Код:
UI.AddCheckbox( "PCinfo" );
function HSVtoRGB(h, s, v){
}

function getCustomValue(xy) {
  var value = UI.GetValue("MISC", "JAVASCRIPT", "Script items", xy);
return value;}
var position = {
  x1: 0,
  y1: 0
}

function watermark()
{
 
    var colors = HSVtoRGB(Global.Realtime() * UI.GetValue("MISC", "JAVASCRIPT", "Script Items", "Watermark Gradient Speed"), 1, 1);
 
    const ping = Math.floor(Global.Latency() * 1000 / 1.5 );
    const fps = Math.floor( 1 / Global.Frametime() );
     
 
    x1 = getCustomValue("Watermark x");
    y1 = getCustomValue("Watermark y");
    var today = new Date();
    var hours1 = today.getHours();
    var minutes1 = today.getMinutes();
    var seconds1 = today.getSeconds();
    var hours = hours1 <= 9 ? "0" + today.getHours() + ":" : today.getHours() + ":";
    var minutes = minutes1 <= 9 ? "0" + today.getMinutes() + ":" : today.getMinutes() + ":";
    var seconds = seconds1 <= 9 ? "0" + today.getSeconds() : today.getSeconds()    ;

 

    var tickrate = Global.Tickrate()
    //Render.FilledRect( x1 + 45, y1 + 2, 260, 55 , [ 30, 30, 30, 150 ] ); // background
    //Render.Rect( x1 + 45, y1 + 2, 260, 55, [ 30, 30, 30, 255 ] );
    //Render.FilledRect( x1 + 50, y1 + 7, 250, 45, [ 30, 30, 30, 255 ] ); // background1
    Render.String( x1 + 122, y1 + 37, 0, "TCK   ", [ 120, 120, 120, 255 ], 3 ); //TCK
    Render.String( x1 + 127, y1 + 37, 0, "          " + tickrate, [ 255, 255, 255, 220 ], 3 ); // TCK1
    Render.Rect( x1 + 120, y1 + 35, 23, 13, [ 120, 120, 120, 255] ); // TCK2
    Render.Rect( x1 + 170, y1 + 35, 6, 13, [ 120, 120, 120, 255] ) ;// ping
    Render.Rect( x1 + 177, y1 + 38, 6, 10, [ 120, 120, 120, 255] ); // ping1
    Render.Rect( x1 + 184, y1 + 41, 6, 7, [ 120, 120, 120, 255] ); // ping2
    Render.Circle( x1 + 237, y1 + 41, 6, [ 120, 120, 120, 255 ] ) ;// clock
    Render.Line( x1 + 237, y1 + 42, x1 + 237, y1 + 36, [ 120, 120, 120, 255 ] ); // clock1
    Render.Line( x1 + 237, y1 + 42, x1 + 243, y1 + 42, [ 120, 120, 120, 255 ] ); // clock2
    Render.String( x1 + 192, y1 + 37, 0, " " + ping + "ms", [ 255, 255, 255, 200 ], 3 );
    Render.Rect( x1 + 65, y1 + 35, 21, 13, [ 120, 120, 120, 255] ); // fps1
    Render.String( x1 + 67, y1 + 37, 0, "FPS   " , [ 120, 120, 120, 255 ], 3 );
    Render.String( x1 + 72, y1 + 37, 0, "           " + fps , [ 255, 255, 255, 220 ], 3 );
    Render.String( x1 + 247, y1 + 37, 0, " " + hours + minutes + seconds, [ 255, 255, 255, 220 ], 3 );

 
}

function main()
{
        var screensize = Global.GetScreenSize();
        UI.AddSliderInt("Watermark x", 0, screensize[0]);
        UI.AddSliderInt("Watermark y", 0, screensize[1]);
}
main()

Global.RegisterCallback("Draw", "watermark");
UI.SetValue("MISC", "JAVASCRIPT", "Script Items", "Watermark Gradient Speed", 0.1);
нужно сделать так чтобы чекбокс вызывал этот ватермарк помогите кто сможет)
чекбокс не вызывает функцию, в функции нужно проверять чекбокс на активность
 
Участник
Статус
Оффлайн
Регистрация
29 Дек 2018
Сообщения
1,416
Реакции[?]
158
Поинты[?]
1K
Сверху Снизу