JS-скрипт [weave] Hit Marker

Эксперт
Статус
Оффлайн
Регистрация
10 Фев 2021
Сообщения
1,740
Реакции[?]
559
Поинты[?]
2K
пиздец апи говно я ебал
JavaScript:
/*
    author: Mikhailkrylow,
    stay Home, stay YouGame.biz, netvoine
*/
// api shit
// api pisal sin govna
// mb govnokod mne poxui
var colors = {
    head: [0,0,255,255],
    body: [255,255,255,255],
}
// api isue tak chto vot default color^^^
// pizdec blyad [x,y,z]
// x = blue,y = green,z = red kakogo xua
var hits = []
function lerp(a, b, c) {
    return a+(b-a)*c
}
function print(arg) {
    //prikol api ukazano cheat.log_custom a ono undefined
    cheat.log(arg.toString());
}
function on_damage() {
    var attacker = entity.get_player_for_user_id(current_event.get_int('attacker'));
    var attacked = entity.get_player_for_user_id(current_event.get_int('userid'));
    var damage = current_event.get_int('dmg_health');
    var hitgroup = current_event.get_int('hitgroup');
    var color = colors.body
    if(hitgroup == 1) color = colors.head;
    if (attacker == entity.get_local_player() && attacker != attacked) {
        for (var i = 0; i < hits.length; i++) {
            if(hits[i].ent == attacked){
                hits[i].damage += damage
                hits[i].alpha = 25550
                hits[i].color = color
                hits[i].offset = 0
                return;
            }
        }
        var pos = entity.get_origin(attacked) // a hui a ne get_hitbox_pos
        pos[2] += 64
        hits.push(
            {
                ent: attacked,
                position: pos,
                alpha: 25550,
                damage: damage,
                color: color,
                offset: 0
            }
        );
    }
}

register_callback('player_hurt', on_damage)

function on_render() {
    for (var i = 0; i < hits.length; i++) {
        hits[i].alpha = Math.floor(lerp(hits[i].alpha,0,2*global_vars.frametime()))
        var position = render.world_to_screen(hits[i].position)
        hits[i].color[3] = Math.min(255,hits[i].alpha)
        hits[i].offset += 50*global_vars.frametime()
        if(hits[i].alpha > 0){
            render.text(
                [
                    position[0]+1,
                    position[1]+1-hits[i].offset,
                ],
                [0,0,0,Math.min(255,hits[i].alpha)],
                10,
                0,
                '-' + hits[i].damage
            )
            render.text(
                [
                    position[0],
                    position[1]-hits[i].offset,
                ],
                hits[i].color,
                10,
                0,
                '-' + hits[i].damage
            )
        }else{
            hits.shift()
        }
    }
}
register_callback('render', on_render)
Пожалуйста, авторизуйтесь для просмотра ссылки.
Пожалуйста, авторизуйтесь для просмотра ссылки.
 
PrimordialAgent
Пользователь
Статус
Оффлайн
Регистрация
4 Ноя 2020
Сообщения
236
Реакции[?]
97
Поинты[?]
1K
пиздец апи говно я ебал
JavaScript:
/*
    author: Mikhailkrylow,
    stay Home, stay YouGame.biz, netvoine
*/
// api shit
// api pisal sin govna
// mb govnokod mne poxui
var colors = {
    head: [0,0,255,255],
    body: [255,255,255,255],
}
// api isue tak chto vot default color^^^
// pizdec blyad [x,y,z]
// x = blue,y = green,z = red kakogo xua
var hits = []
function lerp(a, b, c) {
    return a+(b-a)*c
}
function print(arg) {
    //prikol api ukazano cheat.log_custom a ono undefined
    cheat.log(arg.toString());
}
function on_damage() {
    var attacker = entity.get_player_for_user_id(current_event.get_int('attacker'));
    var attacked = entity.get_player_for_user_id(current_event.get_int('userid'));
    var damage = current_event.get_int('dmg_health');
    var hitgroup = current_event.get_int('hitgroup');
    var color = colors.body
    if(hitgroup == 1) color = colors.head;
    if (attacker == entity.get_local_player() && attacker != attacked) {
        for (var i = 0; i < hits.length; i++) {
            if(hits[i].ent == attacked){
                hits[i].damage += damage
                hits[i].alpha = 25550
                hits[i].color = color
                hits[i].offset = 0
                return;
            }
        }
        var pos = entity.get_origin(attacked) // a hui a ne get_hitbox_pos
        pos[2] += 64
        hits.push(
            {
                ent: attacked,
                position: pos,
                alpha: 25550,
                damage: damage,
                color: color,
                offset: 0
            }
        );
    }
}

register_callback('player_hurt', on_damage)

function on_render() {
    for (var i = 0; i < hits.length; i++) {
        hits[i].alpha = Math.floor(lerp(hits[i].alpha,0,2*global_vars.frametime()))
        var position = render.world_to_screen(hits[i].position)
        hits[i].color[3] = Math.min(255,hits[i].alpha)
        hits[i].offset += 50*global_vars.frametime()
        if(hits[i].alpha > 0){
            render.text(
                [
                    position[0]+1,
                    position[1]+1-hits[i].offset,
                ],
                [0,0,0,Math.min(255,hits[i].alpha)],
                10,
                0,
                '-' + hits[i].damage
            )
            render.text(
                [
                    position[0],
                    position[1]-hits[i].offset,
                ],
                hits[i].color,
                10,
                0,
                '-' + hits[i].damage
            )
        }else{
            hits.shift()
        }
    }
}
register_callback('render', on_render)
Пожалуйста, авторизуйтесь для просмотра ссылки.
Пожалуйста, авторизуйтесь для просмотра ссылки.
Красиво, только это уже не хит, а дамаг маркер
 
Забаненный
Статус
Оффлайн
Регистрация
6 Сен 2021
Сообщения
94
Реакции[?]
22
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Начинающий
Статус
Оффлайн
Регистрация
8 Май 2017
Сообщения
265
Реакции[?]
22
Поинты[?]
0
сделай рандомайз позиций дамаг маркера и вообще пушечка будет
 
PrimordialAgent
Пользователь
Статус
Оффлайн
Регистрация
4 Ноя 2020
Сообщения
236
Реакции[?]
97
Поинты[?]
1K
так тоже самое же не
Хитмаркер, как было сказано выше, является каким-либо крестиком на месте попадания/по центру экрана (если ты играл в раст - при попадании ты мог видеть такой типо крестик, это и есть хитмаркер)
 
Пользователь
Статус
Оффлайн
Регистрация
20 Май 2020
Сообщения
392
Реакции[?]
48
Поинты[?]
4K
пиздец апи говно я ебал
JavaScript:
/*
    author: Mikhailkrylow,
    stay Home, stay YouGame.biz, netvoine
*/
// api shit
// api pisal sin govna
// mb govnokod mne poxui
var colors = {
    head: [0,0,255,255],
    body: [255,255,255,255],
}
// api isue tak chto vot default color^^^
// pizdec blyad [x,y,z]
// x = blue,y = green,z = red kakogo xua
var hits = []
function lerp(a, b, c) {
    return a+(b-a)*c
}
function print(arg) {
    //prikol api ukazano cheat.log_custom a ono undefined
    cheat.log(arg.toString());
}
function on_damage() {
    var attacker = entity.get_player_for_user_id(current_event.get_int('attacker'));
    var attacked = entity.get_player_for_user_id(current_event.get_int('userid'));
    var damage = current_event.get_int('dmg_health');
    var hitgroup = current_event.get_int('hitgroup');
    var color = colors.body
    if(hitgroup == 1) color = colors.head;
    if (attacker == entity.get_local_player() && attacker != attacked) {
        for (var i = 0; i < hits.length; i++) {
            if(hits[i].ent == attacked){
                hits[i].damage += damage
                hits[i].alpha = 25550
                hits[i].color = color
                hits[i].offset = 0
                return;
            }
        }
        var pos = entity.get_origin(attacked) // a hui a ne get_hitbox_pos
        pos[2] += 64
        hits.push(
            {
                ent: attacked,
                position: pos,
                alpha: 25550,
                damage: damage,
                color: color,
                offset: 0
            }
        );
    }
}

register_callback('player_hurt', on_damage)

function on_render() {
    for (var i = 0; i < hits.length; i++) {
        hits[i].alpha = Math.floor(lerp(hits[i].alpha,0,2*global_vars.frametime()))
        var position = render.world_to_screen(hits[i].position)
        hits[i].color[3] = Math.min(255,hits[i].alpha)
        hits[i].offset += 50*global_vars.frametime()
        if(hits[i].alpha > 0){
            render.text(
                [
                    position[0]+1,
                    position[1]+1-hits[i].offset,
                ],
                [0,0,0,Math.min(255,hits[i].alpha)],
                10,
                0,
                '-' + hits[i].damage
            )
            render.text(
                [
                    position[0],
                    position[1]-hits[i].offset,
                ],
                hits[i].color,
                10,
                0,
                '-' + hits[i].damage
            )
        }else{
            hits.shift()
        }
    }
}
register_callback('render', on_render)
Пожалуйста, авторизуйтесь для просмотра ссылки.
Пожалуйста, авторизуйтесь для просмотра ссылки.
попробуй сделай дамаг маркер динамичный (ну типо появляется плавно и исчезает, а у тебя тупо без анимаций появляется, идет вверх и пропадает :/) было бы очень красиво, тупо энэльчик, тупа скиит.цэцэ
 
Сверху Снизу