• Я зарабатываю 100 000 RUB / месяц на этом сайте!

    А знаешь как? Я всего-лишь публикую (создаю темы), а админ мне платит. Трачу деньги на мороженое, робуксы и сервера в Minecraft. А ещё на паль из Китая. 

    Хочешь так же? Пиши и узнавай условия: https://t.me/alex_redact
    Реклама: https://t.me/yougame_official

Вопрос Дт не регает на сервере

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
13 Окт 2022
Сообщения
30
Реакции
0
C++:
Expand Collapse Copy
void c_rage_bot::double_tap(c_user_cmd* cmd, c_base_player_weapon* weapon) {
    if (!cmd || !weapon)
        return;

    double offset_tick = 0.0;
    float next_primary_attack = weapon->m_next_primary_attack();
    static int shot_count{};
    static int old_shot_count{ };
    double integral;
    double fractional = modf(next_primary_attack, &integral);


    double wat_offset_fractional = modf(weapon->m_next_primary_attack(), &offset_tick);

    double temp = fractional + wat_offset_fractional;
    int shoot_tick = static_cast<int>(integral) + static_cast<int>(offset_tick);


    if (temp >= 0.0) {
        if (temp >= 1.0)
            ++shoot_tick;
    }
    else {
        --shoot_tick;
    }

    bool is_even_shot = shot_count % 2;

    if (cmd->pb.attack1_start_history_index() > -1)
        shot_count++;

    for (int i = 0; i < cmd->pb.input_history_size(); ++i) {
        auto* input_entry = cmd->get_input_entry(i);
        if (!input_entry)
            continue;

        input_entry->set_player_tick_count(is_even_shot ? shoot_tick - 1 : 0);
        input_entry->set_player_tick_fraction(0.0f);
    }

    cmd->pb.set_attack1_start_history_index(-1);
    old_shot_count = shot_count;
    std::cout << (old_shot_count) << std::endl;
    std::cout << (shot_count) << std::endl;
}
Двойной выстрел происходит, но сервер не регает и откатывает патрон
 
C++:
Expand Collapse Copy
void c_rage_bot::double_tap(c_user_cmd* cmd, c_base_player_weapon* weapon) {
    if (!cmd || !weapon)
        return;

    double offset_tick = 0.0;
    float next_primary_attack = weapon->m_next_primary_attack();
    static int shot_count{};
    static int old_shot_count{ };
    double integral;
    double fractional = modf(next_primary_attack, &integral);


    double wat_offset_fractional = modf(weapon->m_next_primary_attack(), &offset_tick);

    double temp = fractional + wat_offset_fractional;
    int shoot_tick = static_cast<int>(integral) + static_cast<int>(offset_tick);


    if (temp >= 0.0) {
        if (temp >= 1.0)
            ++shoot_tick;
    }
    else {
        --shoot_tick;
    }

    bool is_even_shot = shot_count % 2;

    if (cmd->pb.attack1_start_history_index() > -1)
        shot_count++;

    for (int i = 0; i < cmd->pb.input_history_size(); ++i) {
        auto* input_entry = cmd->get_input_entry(i);
        if (!input_entry)
            continue;

        input_entry->set_player_tick_count(is_even_shot ? shoot_tick - 1 : 0);
        input_entry->set_player_tick_fraction(0.0f);
    }

    cmd->pb.set_attack1_start_history_index(-1);
    old_shot_count = shot_count;
    std::cout << (old_shot_count) << std::endl;
    std::cout << (shot_count) << std::endl;
}
Двойной выстрел происходит, но сервер не регает и откатывает патрон
а ты не думал, что это не из за дт? Если у тебя фикса автофайра нету, то это из за автофайра
 
Скорее всего из-за автофаера, но вопрос остается открытым. Думаю как перекинуть слитый дт сюда
 
Назад
Сверху Снизу