JS-скрипт Spectators list Neverlose v2 [otc3]

Олдфаг
Олдфаг
Статус
Оффлайн
Регистрация
28 Дек 2018
Сообщения
2,622
Реакции
1,455
1610733451867.png

не забудь установить шрифты !
так как в вантапе нельзя гетнуть авы, я заменил их такой иконкой )

JavaScript:
Expand Collapse Copy
const screen_size = Global.GetScreenSize();
var stored = false;
var x_offs = 0;
var y_offs = 0;
UI.AddSliderInt("spectators x", 0, screen_size[0]);
UI.AddSliderInt("spectators y", 0, screen_size[1]);
UI.SetEnabled("Script items", "spectators x", false);
UI.SetEnabled("Script items", "spectators y", false);
const in_bounds = function(vec, x, y, x2, y2) {
    return (vec[0] > x) && (vec[1] > y) && (vec[0] < x2) && (vec[1] < y2)
}
const get_spectators = function() {
    var spectators = [];
    const players = Entity.GetPlayers();
    for (i = 0; i < players.length; i++) {
        const cur = players[i];
        if (Entity.GetProp(cur, "CBasePlayer", "m_hObserverTarget") != "m_hObserverTarget") {
            const obs = Entity.GetProp(cur, "CBasePlayer", "m_hObserverTarget")
            if (obs === Entity.GetLocalPlayer()) {
                const name = Entity.GetName(cur);
                spectators.push(name);
            }
        }
    } return spectators;
}
const spectators = function() {
    const x = UI.GetValue("Script items", "spectators x"),
    y = UI.GetValue("Script items", "spectators y");
    const font = Render.AddFont("Calibri", 13, 600);
    const spects = Render.AddFont("Calibri", 11, 100);
    const icon = Render.AddFont("untitled-font-1", 14, 100);
    const names = get_spectators();
    Render.FilledRect(x, y, 160, 25, [11, 11, 20, 200]);
    Render.StringCustom(x + 5, y + 3, 0, "b", [0, 130, 255, 255], icon);
    Render.StringCustom(x + 30, y + 1, 0, "Spectators", [245, 245, 245, 255], font);
    Render.FilledRect(x, y + 24, 160, 24 + 19 * (names.length - 1), [200, 200, 200, 15]);
    for (i = 0; i < names.length; i++){
        Render.StringCustom(x + 30, y + 26 + 20 * i, 0, names[i], [245, 245, 245, 255], spects);
        Render.StringCustom(x + 6, y + 26 + 20 * i, 0, "d", [200, 200, 200, 255], icon);
    }
    if(UI.IsMenuOpen() && Input.IsKeyPressed(0x1)){
        const mouse_pos = Global.GetCursorPosition();
        if (in_bounds(mouse_pos, x, y, x + 150, y + 30)) {
            if(!stored){
                x_offs = mouse_pos[0] - x;
                y_offs = mouse_pos[1] - y;
                stored = true;
            }
            UI.SetValue("Script items", "spectators x", mouse_pos[0] - x_offs);
            UI.SetValue("Script items", "spectators y", mouse_pos[1] - y_offs);
        }
    } else if(stored) stored = false;
}
Global.RegisterCallback("Draw", "spectators");
 

Вложения

  • font.rar
    font.rar
    1.2 KB · Просмотры: 374
Последнее редактирование:
Посмотреть вложение 125191
не забудь установить шрифты !
так как в вантапе нельзя гетнуть авы, я заменил их такой иконкой )

JavaScript:
Expand Collapse Copy
const screen_size = Global.GetScreenSize();
var stored = false;
var x_offs = 0;
var y_offs = 0;

UI.AddSliderInt("spectators x", 0, screen_size[0]);
UI.AddSliderInt("spectators y", 0, screen_size[1]);
UI.SetEnabled("Script items", "spectators x", false);
UI.SetEnabled("Script items", "spectators y", false);

const in_bounds = function(vec, x, y, x2, y2) {
    return (vec[0] > x) && (vec[1] > y) && (vec[0] < x2) && (vec[1] < y2)
}

const get_spectators = function() {
    var spectators = [];
    const players = Entity.GetPlayers();
    for (i = 0; i < players.length; i++) {
        const cur = players[i];
        if (Entity.GetProp(cur, "CBasePlayer", "m_hObserverTarget") != "m_hObserverTarget") {
            const obs = Entity.GetProp(cur, "CBasePlayer", "m_hObserverTarget")
            if (obs === Entity.GetLocalPlayer()) {
                const name = Entity.GetName(cur);
                spectators.push(name);
            }
        }
    } return spectators; }
   
const spectators = function() {
    const x = UI.GetValue("Script items", "spectators x"),
    y = UI.GetValue("Script items", "spectators y");
    const font = Render.AddFont("circe", 11, 600);
    const spects = Render.AddFont("circe", 10, 100);
    const icon = Render.AddFont("untitled-font-1", 14, 100);
    const names = get_spectators();

    Render.FilledRect(x, y, 160, 25, [11, 11, 20, 200]);
    Render.StringCustom(x + 5, y + 3, 0, "b", [0, 130, 255, 255], icon);
    Render.StringCustom(x + 30, y + 3, 0, "Spectators", [245, 245, 245, 255], font);
    Render.FilledRect(x, y + 24, 160, 24 + 21 * (names.length - 1), [50, 50, 50, 100]);
    for (i = 0; i < names.length; i++){
        Render.StringCustom(x + 30, y + 27 + 20 * i, 0, names[i], [245, 245, 245, 255], spects);
        Render.StringCustom(x + 6, y + 27 + 20 * i, 0, "d", [200, 200, 200, 255], icon);
    }

    if(UI.IsMenuOpen() && Input.IsKeyPressed(0x1)){
        const mouse_pos = Global.GetCursorPosition();
        if (in_bounds(mouse_pos, x, y, x + 150, y + 30)) {
            if(!stored){
                x_offs = mouse_pos[0] - x;
                y_offs = mouse_pos[1] - y;
                stored = true;
            }
            UI.SetValue("Script items", "spectators x", mouse_pos[0] - x_offs);
            UI.SetValue("Script items", "spectators y", mouse_pos[1] - y_offs);
        }
    } else if(stored) stored = false;
}

Global.RegisterCallback("Draw", "spectators");
Прошу тебя, сделай бомб таймер)
1610654733213.png
 
На в4 можно с авами))
 
круто, класс, спс братан
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Посмотреть вложение 125191
не забудь установить шрифты !
так как в вантапе нельзя гетнуть авы, я заменил их такой иконкой )

JavaScript:
Expand Collapse Copy
const screen_size = Global.GetScreenSize();
var stored = false;
var x_offs = 0;
var y_offs = 0;

UI.AddSliderInt("spectators x", 0, screen_size[0]);
UI.AddSliderInt("spectators y", 0, screen_size[1]);
UI.SetEnabled("Script items", "spectators x", false);
UI.SetEnabled("Script items", "spectators y", false);

const in_bounds = function(vec, x, y, x2, y2) {
    return (vec[0] > x) && (vec[1] > y) && (vec[0] < x2) && (vec[1] < y2)
}

const get_spectators = function() {
    var spectators = [];
    const players = Entity.GetPlayers();
    for (i = 0; i < players.length; i++) {
        const cur = players[i];
        if (Entity.GetProp(cur, "CBasePlayer", "m_hObserverTarget") != "m_hObserverTarget") {
            const obs = Entity.GetProp(cur, "CBasePlayer", "m_hObserverTarget")
            if (obs === Entity.GetLocalPlayer()) {
                const name = Entity.GetName(cur);
                spectators.push(name);
            }
        }
    } return spectators; }
   
const spectators = function() {
    const x = UI.GetValue("Script items", "spectators x"),
    y = UI.GetValue("Script items", "spectators y");
    const font = Render.AddFont("circe", 11, 600);
    const spects = Render.AddFont("circe", 10, 100);
    const icon = Render.AddFont("untitled-font-1", 14, 100);
    const names = get_spectators();

    Render.FilledRect(x, y, 160, 25, [11, 11, 20, 200]);
    Render.StringCustom(x + 5, y + 3, 0, "b", [0, 130, 255, 255], icon);
    Render.StringCustom(x + 30, y + 3, 0, "Spectators", [245, 245, 245, 255], font);
    Render.FilledRect(x, y + 24, 160, 24 + 21 * (names.length - 1), [50, 50, 50, 100]);
    for (i = 0; i < names.length; i++){
        Render.StringCustom(x + 30, y + 27 + 20 * i, 0, names[i], [245, 245, 245, 255], spects);
        Render.StringCustom(x + 6, y + 27 + 20 * i, 0, "d", [200, 200, 200, 255], icon);
    }

    if(UI.IsMenuOpen() && Input.IsKeyPressed(0x1)){
        const mouse_pos = Global.GetCursorPosition();
        if (in_bounds(mouse_pos, x, y, x + 150, y + 30)) {
            if(!stored){
                x_offs = mouse_pos[0] - x;
                y_offs = mouse_pos[1] - y;
                stored = true;
            }
            UI.SetValue("Script items", "spectators x", mouse_pos[0] - x_offs);
            UI.SetValue("Script items", "spectators y", mouse_pos[1] - y_offs);
        }
    } else if(stored) stored = false;
}

Global.RegisterCallback("Draw", "spectators");
Вместо Чела, просто замени на стандарт пнг иконку, стима при создание новорегг акка. И все, это даже мб лучше будет)
 
Вместо Чела, просто замени на стандарт пнг иконку, стима при создание новорегг акка. И все, это даже мб лучше будет)
Она черная, + еще придется челам качать пнг картинку и кидать её куда-то, не все даже могут шрифт установить, а тут еще и картинку куда-то кидать, я еще думал вместо таких челиков, сделать таких
1610730518030.png
, но вставил обычных.
Вместо Чела, просто замени на стандарт пнг иконку, стима при создание новорегг акка. И все, это даже мб лучше будет)
1610730557216.png
или вот такую иконку в шрифт впихнуть, но не думаю что будет красиво.
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
2 вариант лучше будет, <3
Я круглое всегда было лучше квадратов. хых
 
Сделай пж на в4)
 
Последнее редактирование:
Нету сабки, да и не очень удобно там делать что-то

Обнова:
- Изменил шрифт
- Подправил " типо блюр ", теперь не такой темный.
Бля было бы круто если бы сделал на в4) я б даже заплатил
 
Нету сабки, да и не очень удобно там делать что-то

Обнова:
- Изменил шрифт
- Подправил " типо блюр ", теперь не такой темный.
сделай бомб таймер, думаю многие будут не против
 
Да легко, но легче купить пиццу, колу, чипсы, еще и останется, тут хоть кайфануть можно, не то что с этой пастой
можешь сделать так, чтобы когда за тобой никто не следит, то спектатор лист пропадал? а то когда он все время на экране, как-то не красиво выглядит, если тебе не сложно конечно.
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
можешь сделать так, чтобы когда за тобой никто не следит, то спектатор лист пропадал? а то когда он все время на экране, как-то не красиво выглядит, если тебе не сложно конечно.
полностью поддерживаю
 
Назад
Сверху Снизу