Вопрос Правильная ли реализация two shot?

Начинающий
Статус
Оффлайн
Регистрация
10 Апр 2022
Сообщения
85
Реакции[?]
8
Поинты[?]
4K
в общем, хотелось бы узнать ваше мнение насчет реализации данной функции, правильно я её сделал или не пойми че высрал

Код:
void misc::TwoShots(adjust_data* record)
{
    scan_data data;
    bool visible = data.visible;
    auto health = record->player->m_iHealth() / 2;
    bool double_tap_enable = double_tap_enabled;

    if (&g_cfg.ragebot.TwoShot)
    {
        if (visible == true && double_tap_enable == true && g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_SCAR20 || WEAPON_G3SG1)
        {
            aim::get().get_minimum_damage(true, health);
        }

        if (visible == false && double_tap_enable == true && g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_SCAR20 || WEAPON_G3SG1)
        {
            aim::get().get_minimum_damage(false, health);
        }
    }
}
 
Последнее редактирование:
Начинающий
Статус
Оффлайн
Регистрация
26 Янв 2019
Сообщения
106
Реакции[?]
8
Поинты[?]
3K
в общем, хотелось бы узнать ваше мнение насчет реализации данной функции, правильно я её сделал или не пойми че высрал

Код:
void misc::TwoShots(adjust_data* record)
{
    scan_data data;
    bool visible = data.visible;
    auto health = record->player->m_iHealth() / 2;
    bool double_tap_enable = double_tap_enabled;

    if (&g_cfg.ragebot.TwoShot)
    {
        if (visible == true && double_tap_enable == true && g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_SCAR20 || WEAPON_G3SG1)
        {
            aim::get().get_minimum_damage(true, health);
        }

        if (visible == false && double_tap_enable == true && g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_SCAR20 || WEAPON_G3SG1)
        {
            aim::get().get_minimum_damage(false, health);
        }
    }
}
Не нужные переменные и не правильные проверки, вот как лучше ты мог реализовать:

TS:
void misc::TwoShots(adjust_data* record)
{
    scan_data data;
    const auto health = record->player->m_iHealth() / 2;

    if (&g_cfg.ragebot.TwoShot && /*Проверка на ДТ*/ && (g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_SCAR20 || g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_G3SG1))
        aim::get().get_minimum_damage(data.visible, health);
}
 
Начинающий
Статус
Оффлайн
Регистрация
10 Апр 2022
Сообщения
85
Реакции[?]
8
Поинты[?]
4K
Не нужные переменные и не правильные проверки, вот как лучше ты мог реализовать:

TS:
void misc::TwoShots(adjust_data* record)
{
    scan_data data;
    const auto health = record->player->m_iHealth() / 2;

    if (&g_cfg.ragebot.TwoShot && /*Проверка на ДТ*/ && (g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_SCAR20 || g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_G3SG1))
        aim::get().get_minimum_damage(data.visible, health);
}
понял, спасибо
 
Начинающий
Статус
Оффлайн
Регистрация
10 Апр 2022
Сообщения
85
Реакции[?]
8
Поинты[?]
4K
Не нужные переменные и не правильные проверки, вот как лучше ты мог реализовать:

TS:
void misc::TwoShots(adjust_data* record)
{
    scan_data data;
    const auto health = record->player->m_iHealth() / 2;

    if (&g_cfg.ragebot.TwoShot && /*Проверка на ДТ*/ && (g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_SCAR20 || g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_G3SG1))
        aim::get().get_minimum_damage(data.visible, health);
}
чтобы проверку на дт сделать все равно придётся ещё переменную создавать, иначе ошибка будет
 
Эксперт
Статус
Оффлайн
Регистрация
30 Дек 2019
Сообщения
1,970
Реакции[?]
958
Поинты[?]
19K
в общем, хотелось бы узнать ваше мнение насчет реализации данной функции, правильно я её сделал или не пойми че высрал

Код:
void misc::TwoShots(adjust_data* record)
{
    scan_data data;
    bool visible = data.visible;
    auto health = record->player->m_iHealth() / 2;
    bool double_tap_enable = double_tap_enabled;

    if (&g_cfg.ragebot.TwoShot)
    {
        if (visible == true && double_tap_enable == true && g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_SCAR20 || WEAPON_G3SG1)
        {
            aim::get().get_minimum_damage(true, health);
        }

        if (visible == false && double_tap_enable == true && g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_SCAR20 || WEAPON_G3SG1)
        {
            aim::get().get_minimum_damage(false, health);
        }
    }
}
зачем делать это в мисках? зачем куча гвоно проверок?
C++:
if ( id == weapon_scar20 or id == weapon_g3sg1 and misc::get().doubletap_enabled ) {
    damage = target->get_health() * 0.5f /* тут можешь дополнительно добавить единиц, чтобы точно дамаг выбить */;
}
 
Начинающий
Статус
Оффлайн
Регистрация
26 Сен 2022
Сообщения
66
Реакции[?]
9
Поинты[?]
0
Unnecessary variables and wrong checks, here's how best you could implement:

TS:
void misc::TwoShots(adjust_data* record)
{
    scan_data data;
    const auto health = record->player->m_iHealth() / 2;

if (&g_cfg.ragebot.TwoShot && /*DT check*/ && (g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_SCAR20 || g_ctx.globals.weapon->m_iItemDefinitionIndex() == WEAPON_G3SG1))
        aim::get().get_minimum_damage(data.visible, health);
}
mr this won't work unless his get min dmg is setup a certain way, this seems to me to be legendware. If its legendware from what I know it returns a bool and wtf are we doing with that bool in this code? Nothing. so what the fuck does this do exactly except call it and do fucking nothing at all. also scan data, I am pretty sure you have to set the data within it. not 100% sure on that tho. A correct implementation is not doing it unless you know what your doing.
 
кто читает тот умрет
Участник
Статус
Оффлайн
Регистрация
29 Июл 2019
Сообщения
693
Реакции[?]
536
Поинты[?]
149K
if(double_tap)
{
if(first_shot && registered)
stored_health after hit = ent.health
else if( second_shot_next_tick)
dmg = stored_health_after_hit
}
else
dmg = menu.damage

monolith reversed :roflanEbalo:
 
ЧВК EB_LAN
Эксперт
Статус
Онлайн
Регистрация
26 Янв 2021
Сообщения
1,548
Реакции[?]
517
Поинты[?]
192K
зачем делать это в мисках? зачем куча гвоно проверок?
C++:
if ( id == weapon_scar20 or id == weapon_g3sg1 and misc::get().doubletap_enabled ) {
    damage = target->get_health() * 0.5f /* тут можешь дополнительно добавить единиц, чтобы точно дамаг выбить */;
}
damage = (g_Local->IsAutosniper() && g_CheatVars->Doubletap) ? (g_Enemy->GetHealth() / 2.f + g_Menu->Ragebot[g_CheatVars->ActiveWeapon].DamageAccuracy / 10.f) : g_Menu->Ragebot[g_CheatVars->ActiveWeapon].MinimumDamage;
 
coder of the year
Участник
Статус
Оффлайн
Регистрация
13 Мар 2019
Сообщения
886
Реакции[?]
266
Поинты[?]
4K
Use the enemy's health and armor to calculate the health of the enemy, most likely you will have to use the logic of autowall (scaledamage)
C++:
if ( (weapon->IsG3SG1() || weapon->IsScar()) && doubletap_enabled ) {
   if ( player->Health() < 50 )
       minimum_damage = 50;
   else
   {
       minimum_damage = (enemy_health / (armor_value + 1) / 2) * 100 // you can also use armor ratio (scaledamage in your autowall and do like        * 0.85)
       // or you can use a formula without complicated calculations
       minimum_damage = enemy_health / 2 // ( or * 0.5 , also you can add some numbers to this value like + 5 or +10 to beat out damage accurately)

   }
}
 
Последнее редактирование:
Забаненный
Статус
Оффлайн
Регистрация
26 Дек 2022
Сообщения
2
Реакции[?]
0
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
damage = (g_Local->IsAutosniper() && g_CheatVars->Doubletap) ? (g_Enemy->GetHealth() / 2.f + g_Menu->Ragebot[g_CheatVars->ActiveWeapon].DamageAccuracy / 10.f) : g_Menu->Ragebot[g_CheatVars->ActiveWeapon].MinimumDamage;
-rep hp are calculated in this game in int value... and if u set to the float value, you will have some problems realted to it.......
 
Сверху Снизу