Guest User

Untitled

a guest
May 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. public jumping_explode ( Entity )
  2. {
  3. if ( Entity < 0 )
  4. return
  5.  
  6. static Float:flOrigin [ 3 ]
  7. pev ( Entity, pev_origin, flOrigin )
  8.  
  9. engfunc ( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flOrigin, 0 )
  10. write_byte ( TE_SPRITE )
  11. engfunc ( EngFunc_WriteCoord, flOrigin [ 0 ] )
  12. engfunc ( EngFunc_WriteCoord, flOrigin [ 1 ] )
  13. engfunc ( EngFunc_WriteCoord, flOrigin [ 2 ] + 45.0 )
  14. write_short ( g_iExplo )
  15. write_byte ( 35 )
  16. write_byte ( 186 )
  17. message_end ( )
  18.  
  19.  
  20. new iOwner = entity_get_edict ( Entity, EV_ENT_owner )
  21.  
  22. emit_sound ( Entity, CHAN_WEAPON, g_SoundBombExplode[random_num(0, sizeof g_SoundBombExplode-1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM )
  23.  
  24. new Float:fDamage;
  25. new Float:flDamageSum = 0.0;
  26.  
  27. for ( new i = 1; i < g_MaxPlayers; i++ )
  28. {
  29. if ( !is_user_alive ( iOwner ))
  30. continue
  31.  
  32. //message_begin( MSG_ONE, gmsgScreenShake, _, i );
  33. //write_short( 3 << 12 );
  34. //write_short( 5 << 12 );
  35. //write_short( 4 << 12 );
  36. //message_end( );
  37.  
  38.  
  39. new Float:flVictimOrigin [ 3 ]
  40. pev ( i, pev_origin, flVictimOrigin )
  41.  
  42. new Float:flDistance = get_distance_f ( flOrigin, flVictimOrigin )
  43.  
  44. if ( flDistance <= RADIUS )
  45. {
  46.  
  47. if (!is_user_alive(i) ) continue
  48. static Float:flSpeed
  49. flSpeed = get_pcvar_float ( cvar_speed )
  50.  
  51. static Float:flNewSpeed
  52. flNewSpeed = flSpeed * ( 1.0 - ( flDistance / RADIUS ) )
  53.  
  54. static Float:flVelocity [ 3 ]
  55. get_speed_vector ( flOrigin, flVictimOrigin, flNewSpeed, flVelocity )
  56.  
  57. set_pev ( i, pev_velocity,flVelocity )
  58. UTIL_ScreenShake( i, UNIT_SECOND*7, UNIT_SECOND*3, UNIT_SECOND*6 )
  59.  
  60. if( zp_get_user_zombie( i ) )
  61. continue;
  62.  
  63. fDamage = floatradius( GRENADE_DAMAGE, RADIUS, flDistance );
  64.  
  65. if( fDamage )
  66. {
  67. if( pev( i, pev_health ) - fDamage ) > 0 )
  68. {
  69. flDamageSum += fDamage
  70. ExecuteHamB( Ham_TakeDamage, i, Entity, iOwner, fDamage, DMG_BULLET | DMG_NEVERGIB );
  71. }
  72. }
  73. }
  74. }
  75.  
  76. client_print( iOwner, print_center, "Total damage %d", floatround( fDamage ) );
  77. engfunc ( EngFunc_RemoveEntity, Entity )
  78. }
Add Comment
Please, Sign In to add comment