Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include < amxmodx >
- #include < fakemeta >
- #define TASK_EXPLODE(%1) ( 799 + %1 )
- #define UNTASK_EXPLODE(%1) ( %1 - 799)
- #define TASK_UNFREEZE(%1) ( 899 + %1 )
- #define UNTASK_UNFREEZE(%1) ( %1 - 899 )
- new bool: g_bFreezed[ 33 ], g_iBeaconSprite;
- enum _:FrostSounds
- {
- Explode,
- Hit,
- Unfreeze
- }
- new const szFrostSoundsPath[ FrostSounds ][ ] = {
- "warcraft3/frostnova.wav",
- "warcraft3/impalehit.wav",
- "warcraft3/impalelaunch1.wav"
- }
- new const plugin_info[ 3 ][ ] = {
- "Hit And Run Frost Nades",
- "v0.1",
- "+ColdWar"
- }
- public plugin_precache( )
- {
- for( new i = 0 ; i < FrostSounds ; i ++ )
- precache_sound( szFrostSoundsPath[ i ] );
- g_iBeaconSprite = precache_model( "sprites/shockwave.spr" );
- }
- public plugin_init()
- {
- register_plugin( plugin_info[ 0 ] , plugin_info[ 1 ] , plugin_info[ 2 ] )
- register_forward( FM_SetModel, "Fwd_SetModel_Pre" );
- }
- public Fwd_SetModel_Pre( iEnt, const Model[] )
- {
- new iOwner = pev( iEnt, pev_owner );
- if( !pev_valid( iEnt ) || !equal( Model, "models/w_smokegrenade.mdl" ) || !is_user_connected( iOwner ) )
- return;
- set_pev( iEnt, pev_nextthink, get_gametime( ) + 5.0 );
- set_task( 1.5, "fnExplodeNade", TASK_EXPLODE( iEnt ) );
- }
- public fnExplodeNade( Task_ID )
- {
- new iEnt = UNTASK_EXPLODE( Task_ID );
- if( !pev_valid( iEnt ) )
- return;
- new iOwner = pev( iEnt, pev_owner ), Float: g_flOrigin[ 3 ], g_iOrigin[ 3 ], Float: g_flPlayerOrigin[ 3 ];
- pev( iEnt, pev_origin, g_flOrigin );
- g_iOrigin[ 0 ] = floatround( g_flOrigin[ 0 ] );
- g_iOrigin[ 1 ] = floatround( g_flOrigin[ 1 ] );
- g_iOrigin[ 2 ] = floatround( g_flOrigin[ 2 ] );
- CmdExplodeBeacon( g_iOrigin )
- engfunc( EngFunc_EmitSound, iEnt, CHAN_WEAPON, szFrostSoundsPath[ Explode ], 1.0, ATTN_NORM, 0, PITCH_NORM );
- for( new i = 1 ; i < get_maxplayers( ) ; i ++ )
- {
- if( !is_user_connected( i ) || !is_user_alive( i ) || i == iOwner || g_bFreezed[ i ] )
- continue;
- pev( i, pev_origin, g_flPlayerOrigin );
- if( get_distance_f( g_flPlayerOrigin, g_flOrigin ) > 240.0 )
- continue;
- g_bFreezed[ i ] = true;
- set_task( 2.5, "Fwd_Unfreeze", TASK_UNFREEZE( i ) );
- new Float: g_flGlowColor[ 3 ];
- g_flGlowColor[ 0 ] = 0.0;
- g_flGlowColor[ 1 ] = 80.0;
- g_flGlowColor[ 2 ] = 200.0;
- set_pev( i, pev_renderfx, kRenderFxGlowShell );
- set_pev( i, pev_rendercolor, g_flGlowColor );
- set_pev( i, pev_rendermode, kRenderNormal );
- set_pev( i, pev_renderamt, 80.0 );
- set_pev( i, pev_flags, pev( i, pev_flags ) | FL_FROZEN );
- engfunc( EngFunc_EmitSound, i, CHAN_WEAPON, szFrostSoundsPath[ Hit ], 1.0, ATTN_NORM, 0, PITCH_NORM)
- message_begin( MSG_ONE, get_user_msgid("ScreenFade"), _, i);
- write_short( ~0 );
- write_short( ~0 );
- write_short( 0x0004 );
- write_byte( 100 );
- write_byte( 200 );
- write_byte( 255 );
- write_byte( 100 );
- message_end( );
- set_pev( i, pev_flags, pev( i, pev_flags ) | FL_FROZEN );
- }
- engfunc( EngFunc_RemoveEntity , iEnt )
- }
- public Fwd_Unfreeze( Task_ID )
- {
- new client = UNTASK_UNFREEZE( Task_ID );
- new Float: g_flGlowColor[ 3 ];
- g_flGlowColor[ 0 ] = 250.0;
- g_flGlowColor[ 1 ] = 250.0;
- g_flGlowColor[ 2 ] = 250.0;
- set_pev( client, pev_renderfx, kRenderFxNone );
- set_pev( client, pev_rendercolor, g_flGlowColor );
- set_pev( client, pev_rendermode, kRenderNormal );
- set_pev( client, pev_renderamt, 16.0 );
- message_begin( MSG_ONE, get_user_msgid("ScreenFade"), _, client);
- write_short( 0 );
- write_short( 0 );
- write_short( 0 );
- write_byte( 0 );
- write_byte( 0 );
- write_byte( 0 );
- write_byte( 0 );
- message_end( );
- g_bFreezed[ client ] = false;
- set_pev( client, pev_flags, pev( client, pev_flags ) & ~FL_FROZEN );
- engfunc( EngFunc_EmitSound, client, CHAN_WEAPON, szFrostSoundsPath[ Unfreeze ], 1.0, ATTN_NORM, 0, PITCH_NORM)
- }
- public CmdExplodeBeacon( const g_iOrigin[3] )
- {
- message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
- write_byte( TE_BEAMCYLINDER );
- write_coord( g_iOrigin[0] );
- write_coord( g_iOrigin[1] );
- write_coord( g_iOrigin[2] );
- write_coord( g_iOrigin[0] );
- write_coord( g_iOrigin[1] );
- write_coord( g_iOrigin[2] + 240);
- write_short( g_iBeaconSprite );
- write_byte( 0 );
- write_byte( 0 );
- write_byte( 8 );
- write_byte( 60 );
- write_byte( 0 );
- write_byte( 40 );
- write_byte( 100 );
- write_byte( 200 );
- write_byte( 200 );
- write_byte( 3 );
- message_end();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement