Исходник Creating a Trail of Grenades

Модератор раздела «Создание читов CS2»
Забаненный
Забаненный
Статус
Оффлайн
Регистрация
21 Июн 2022
Сообщения
148
Реакции
368
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
5wxqpgQ.gif


class:
Expand Collapse Copy
class c_base_grenade_projectile {
public:
    DWORD* dword0{};
private:
    char gap4[ 168 ];
public:
    c_vec3 m_local_origin{};
private:
    char gapB8[ 10476 ];
public:
    c_glow_object* m_glow_object{};
private:
    char gap29A8[ 96 ];
public:
    c_vec3 m_last_trail_line_pos{};
    float m_next_trail_line_time{};
};

hook:
Expand Collapse Copy
//module: client.dll; sig: 55 8B EC 83 E4 F8 83 EC 68 56 8B F1 8B 4D
void __fastcall hooks::hk_create_grenade_trail( void* ecx, void* edx ) {
    const auto this_pointer = static_cast< c_base_grenade_projectile* >( ecx );
    if ( !ctx::local( ) || !this_pointer )
        return;

    if ( this_pointer->m_next_trail_line_time > i::m_globals->m_current_time )
        return;

    qangle_t grenade_traj_angles;
    c_vec3 temp_orientation = ( this_pointer->m_last_trail_line_pos - this_pointer->m_local_origin );
    math::vector_angles( temp_orientation, grenade_traj_angles );

    static const auto sv_grenade_trajectory_thickness = i::m_cvar->find_var( _( "sv_grenade_trajectory_thickness" ) );
    static const auto sv_grenade_trajectory_dash = i::m_cvar->find_var( _( "sv_grenade_trajectory_dash" ) );
    static const auto sv_grenade_trajectory_time_spectator = i::m_cvar->find_var( _( "sv_grenade_trajectory_time_spectator" ) );

    const auto grenade_traj_thickness = sv_grenade_trajectory_thickness->get_float( );
    const auto grenade_traj_min = c_vec3{ 0.0f, -grenade_traj_thickness, -grenade_traj_thickness };
    const auto grenade_traj_max = c_vec3{ temp_orientation.length( ), grenade_traj_thickness, grenade_traj_thickness };

    const auto team = *reinterpret_cast< int* >( reinterpret_cast< std::uintptr_t >( this_pointer->dword0 ) + 0xF4 );
    
    c_color trace_color;
    trace_color.set_color( team == team_ct ? 114, 155, 221 : 224, 175, 86 );

    if ( sv_grenade_trajectory_dash->get_int( ) && std::fmod( i::m_globals->m_current_time, 0.1f ) < 0.05f ) {
        trace_color[ 0 ] /= 10;
        trace_color[ 1 ] /= 10;
        trace_color[ 2 ] /= 10;
    }

    i::m_glow_manager->add_glow_box( this_pointer->m_local_origin, grenade_traj_angles, grenade_traj_min, grenade_traj_max, trace_color, sv_grenade_trajectory_time_spectator->get_float( ), i::m_globals->m_current_time );
    this_pointer->m_last_trail_line_pos = this_pointer->m_local_origin;
    this_pointer->m_next_trail_line_time = i::m_globals->m_current_time + 0.05f;
}
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
можно "add_glow_box"?
Пожалуйста, авторизуйтесь для просмотра ссылки.
Вообще там есть трабл, что игра тупо виснет при использовании AddGlowBox, потому можно вызывать по сигнатуре ( спасибо uc ).

C++:
Expand Collapse Copy
int AddGlowBox( Vector vecOrigin, QAngle angOrientation, Vector mins, Vector maxs, Color colColor, float flLifetime )
{
    typedef int( __thiscall* fnAddGlowBox )( void* _this, Vector vecOrigin, QAngle angOrientation, Vector mins, Vector maxs, Color colColor, float flLifetime );
    static auto pFunc = U::PatternScan( "client.dll", "55 8B EC 53 56 8D 59" ).As< fnAddGlowBox >( );
    return pFunc( g_pSDK->m_pGlowObjectManager, vecOrigin, angOrientation, mins, maxs, colColor, flLifeTime );
}
 

Похожие темы

Назад
Сверху Снизу