airwaves
-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Пожалуйста, авторизуйтесь для просмотра ссылки.
have fun
C++:
void do_precipitation ( int stage ) {
static bool created_rain = false;
static void * rain_networkable = nullptr;
static sdk::c_precipitation_entity * rain_ent = nullptr;
static sdk::valve::client_class_t * precipitation_client_class = nullptr;
const auto & fx_precipitation = CONFIG_GET ( bool , fnv1a ( "fx_precipitation" ) );
if ( !fx_precipitation ) {
sdk::clean_up_entity ( MAX_EDICTS - 1 );
return;
}
if ( !precipitation_client_class )
for ( auto pclass = hack::game::interfaces::client->get_all_classes ( ); pclass && !precipitation_client_class; pclass = pclass->m_next )
if ( pclass->m_class_id == sdk::valve::class_id::cprecipitation )
precipitation_client_class = pclass;
if ( !hack::game::interfaces::engine->is_in_game ( ) || !hack::game::interfaces::engine->is_connected ( ) ) {
/* TODO: move in LevelShutdown hook ~swoopae */
rain_networkable = rain_ent = nullptr;
created_rain = false;
} else {
if ( !created_rain && precipitation_client_class && precipitation_client_class->m_create_func && hack::game::globals::local && stage == 5 ) {
rain_networkable = ( ( void * ( * )( int , int ) )precipitation_client_class->m_create_func )( MAX_EDICTS - 1 , 0 );
if ( rain_networkable ) {
rain_ent = hack::game::interfaces::entity_list->get< sdk::c_precipitation_entity * > ( MAX_EDICTS - 1 );
rain_ent->precipitation_type ( ) = sdk::e_precipitation_types::precipitation_type_snow;
rain_ent->pre_data_update ( 0 );
rain_ent->on_pre_data_change ( 0 );
rain_ent->collision ( ).mins ( ) = c_vector3 ( -MAX_POSITION_FLT , -MAX_POSITION_FLT , -MAX_POSITION_FLT );
rain_ent->collision ( ).maxs ( ) = c_vector3 ( MAX_POSITION_FLT , MAX_POSITION_FLT , MAX_POSITION_FLT );
rain_ent->on_post_data_change ( 0 );
rain_ent->post_data_update ( 0 );
created_rain = true;
}
}
}
}
/* rain */
enum e_precipitation_types : int {
precipitation_type_rain = 0 ,
precipitation_type_snow ,
precipitation_type_ash ,
precipitation_type_snowfall ,
precipitation_type_particlerain ,
precipitation_type_particleash ,
precipitation_type_particlerainstorm ,
precipitation_type_particlesnow ,
num_precipitation_types
};
class c_precipitation_entity : public c_entity {
public:
/* netvars */
netvar_fn ( e_precipitation_types , precipitation_type , "DT_Precipitation->m_nPrecipType" );
};