C++ External get fired shots method

Пользователь
Статус
Оффлайн
Регистрация
6 Апр 2021
Сообщения
281
Реакции[?]
162
Поинты[?]
68K
Пожалуйста, авторизуйтесь для просмотра ссылки.
Код:
//method 1
void evo::legit_t::get_fired_shots() {
    int fired;
    _driver.read( _ent_cache->local.player_pawn.address + 0x1420, fired ); /* read shotsfired from pawn class. */

    static int was_fired = fired; /* store fired value in this int so we can use it later */
    static float fired_shots; /* store fired shots */

    if ( was_fired != fired ) { /* if was_fired differs from fired update the if ,
                                    this run twice, once on shot when fired becomes 1 and after 0.5s after fired becomes 0 */
        fired_shots += 0.5; /* add 0.5 per upd to fired shots, since it update twice it comes to 1 * 0.5 */
        was_fired = fired; /* update was fired so we wont infinitely updating */
    }

    this->fired_shots = (int)fired_shots; /* final, store this to our global fired_shots */
}

// method 2 - this seems to work better
void evo::legit_t::get_fired_shots() {
    uintptr_t clipping, weapon_data;
    _driver.read( _ent_cache->local.player_pawn.address + offsets::weapon_data.clipping_weapon, clipping ); /* weapon clipping adr */
    _driver.read( clipping + offsets::weapon_data.wpn_data_ptr, weapon_data ); /* weapon data adr */

    float sequence_time;
    _driver.read( clipping + offsets::weapon_data.fire_sequence_start, sequence_time ); /* read data for fire_sequence */

    static float burst2 = sequence_time;
    if ( burst2 != sequence_time ) { /* if fire sequence value has updated please run the statement
                                        update_info: new value is being processed on each shot, no values reset or anything,
                                        thats why it is better than m_firedshots in my opinion */
        this->fired_shots += 1; /* add +1 value */
        burst2 = sequence_time; /* update burst 2*/
    }
}
 
Последнее редактирование:
Участник
Статус
Оффлайн
Регистрация
19 Апр 2020
Сообщения
1,099
Реакции[?]
292
Поинты[?]
120K
m_iShotsFired
Пожалуйста, авторизуйтесь для просмотра ссылки.
Код:
//method 1
void evo::legit_t::get_fired_shots() {
    int fired;
    _driver.read( _ent_cache->local.player_pawn.address + 0x1420, fired ); /* read shotsfired from pawn class. */

    static int was_fired = fired; /* store fired value in this int so we can use it later */
    static float fired_shots; /* store fired shots */

    if ( was_fired != fired ) { /* if was_fired differs from fired update the if ,
                                    this run twice, once on shot when fired becomes 1 and after 0.5s after fired becomes 0 */
        fired_shots += 0.5; /* add 0.5 per upd to fired shots, since it update twice it comes to 1 * 0.5 */
        was_fired = fired; /* update was fired so we wont infinitely updating */
    }

    this->fired_shots = (int)fired_shots; /* final, store this to our global fired_shots */
}

// method 2 - this seems to work better
void evo::legit_t::get_fired_shots() {
    uintptr_t clipping, weapon_data;
    _driver.read( _ent_cache->local.player_pawn.address + offsets::weapon_data.clipping_weapon, clipping ); /* weapon clipping adr */
    _driver.read( clipping + offsets::weapon_data.wpn_data_ptr, weapon_data ); /* weapon data adr */

    float sequence_time;
    _driver.read( clipping + offsets::weapon_data.fire_sequence_start, sequence_time ); /* read data for fire_sequence */

    static float burst2 = sequence_time;
    if ( burst2 != sequence_time ) { /* if fire sequence value has updated please run the statement
                                        update_info: new value is being processed on each shot, no values reset or anything,
                                        thats why it is better than m_firedshots in my opinion */
        this->fired_shots += 1; /* add +1 value */
        burst2 = sequence_time; /* update burst 2*/
    }
}
про нетвар забыли?
 
Пользователь
Статус
Оффлайн
Регистрация
6 Апр 2021
Сообщения
281
Реакции[?]
162
Поинты[?]
68K
m_flFireSequenceStartTime
 
Сверху Снизу