Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public jumping_explode ( Entity )
- {
- if ( Entity < 0 )
- return
- static Float:flOrigin [ 3 ]
- pev ( Entity, pev_origin, flOrigin )
- engfunc ( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flOrigin, 0 )
- write_byte ( TE_SPRITE )
- engfunc ( EngFunc_WriteCoord, flOrigin [ 0 ] )
- engfunc ( EngFunc_WriteCoord, flOrigin [ 1 ] )
- engfunc ( EngFunc_WriteCoord, flOrigin [ 2 ] + 45.0 )
- write_short ( g_iExplo )
- write_byte ( 35 )
- write_byte ( 186 )
- message_end ( )
- new iOwner = entity_get_edict ( Entity, EV_ENT_owner )
- emit_sound ( Entity, CHAN_WEAPON, g_SoundBombExplode[random_num(0, sizeof g_SoundBombExplode-1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM )
- new Float:fDamage;
- new Float:flDamageSum = 0.0;
- for ( new i = 1; i < g_MaxPlayers; i++ )
- {
- if ( !is_user_alive ( iOwner ))
- continue
- //message_begin( MSG_ONE, gmsgScreenShake, _, i );
- //write_short( 3 << 12 );
- //write_short( 5 << 12 );
- //write_short( 4 << 12 );
- //message_end( );
- new Float:flVictimOrigin [ 3 ]
- pev ( i, pev_origin, flVictimOrigin )
- new Float:flDistance = get_distance_f ( flOrigin, flVictimOrigin )
- if ( flDistance <= RADIUS )
- {
- if (!is_user_alive(i) ) continue
- static Float:flSpeed
- flSpeed = get_pcvar_float ( cvar_speed )
- static Float:flNewSpeed
- flNewSpeed = flSpeed * ( 1.0 - ( flDistance / RADIUS ) )
- static Float:flVelocity [ 3 ]
- get_speed_vector ( flOrigin, flVictimOrigin, flNewSpeed, flVelocity )
- set_pev ( i, pev_velocity,flVelocity )
- UTIL_ScreenShake( i, UNIT_SECOND*7, UNIT_SECOND*3, UNIT_SECOND*6 )
- if( zp_get_user_zombie( i ) )
- continue;
- fDamage = floatradius( GRENADE_DAMAGE, RADIUS, flDistance );
- if( fDamage )
- {
- if( pev( i, pev_health ) - fDamage ) > 0 )
- {
- flDamageSum += fDamage
- ExecuteHamB( Ham_TakeDamage, i, Entity, iOwner, fDamage, DMG_BULLET | DMG_NEVERGIB );
- }
- }
- }
- }
- client_print( iOwner, print_center, "Total damage %d", floatround( fDamage ) );
- engfunc ( EngFunc_RemoveEntity, Entity )
- }
Add Comment
Please, Sign In to add comment