Adventx

Furien Knife Blood Effects

Nov 1st, 2014
448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.63 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include < amxmodx >
  4. #include < amxmisc >
  5. #include < cstrike >
  6. #include < fakemeta >
  7.  
  8. new const PLUGIN[ ] = "Furien: Knife Blood Effects";
  9. new const VERSION[ ] = "1.0";
  10.  
  11. new g_exploSpr;
  12.  
  13. public plugin_precache( )
  14. {
  15.     // Precache Sprite ID
  16.     g_exploSpr = engfunc( EngFunc_PrecacheModel, "sprites/shockwave.spr" )
  17. }
  18.  
  19. public plugin_init( )
  20. {
  21.     register_plugin( PLUGIN, VERSION, "Adventx" )
  22.    
  23.     register_event( "DeathMsg", "event_deathmsg", "a" )
  24.     register_cvar( "knifeblood_version", VERSION, FCVAR_SERVER|FCVAR_SPONLY )
  25. }
  26.  
  27. public event_deathmsg( )
  28. {
  29.     new iAttacker = read_data( 1 )
  30.     new iVictim = read_data( 2 )
  31.    
  32.     if( iAttacker == iVictim )
  33.         return;
  34.    
  35.     if( cs_get_user_team( iAttacker ) == CS_TEAM_T && get_user_weapon( iAttacker ) == CSW_KNIFE )
  36.     {
  37.         static Float:fOrigin[ 3 ]
  38.         pev( iVictim, pev_origin, fOrigin )
  39.        
  40.         UTIL_CreateBlood( fOrigin )
  41.     }
  42. }
  43.  
  44. stock UTIL_CreateBlood( const Float:fOrigin[3] )
  45. {
  46.     // Smallest ring
  47.     engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, fOrigin, 0 )
  48.     write_byte( TE_BEAMCYLINDER )               // TE id
  49.     engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] )     // x
  50.     engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] )     // y
  51.     engfunc( EngFunc_WriteCoord, fOrigin[ 2 ] )     // z
  52.     engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] )     // x axis
  53.     engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] )     // y axis
  54.     engfunc( EngFunc_WriteCoord, fOrigin[ 2 ]+385.0 )   // z axis
  55.     write_short( g_exploSpr )   // sprite
  56.     write_byte( 0 )         // startframe
  57.     write_byte( 0 )         // framerate
  58.     write_byte( 4 )         // life
  59.     write_byte( 60 )        // width
  60.     write_byte( 0 )         // noise
  61.     write_byte( random( 256 ))  // red
  62.     write_byte( random( 256 ))  // green
  63.     write_byte( random( 256 ))  // blue
  64.     write_byte( 200 )       // brightness
  65.     write_byte( 0 )         // speed
  66.     message_end( )
  67.    
  68.     // Medium ring
  69.     engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, fOrigin, 0 )
  70.     write_byte( TE_BEAMCYLINDER )               // TE id
  71.     engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] )     // x
  72.     engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] )     // y
  73.     engfunc( EngFunc_WriteCoord, fOrigin[ 2 ] )     // z
  74.     engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] )     // x axis
  75.     engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] )     // y axis
  76.     engfunc( EngFunc_WriteCoord, fOrigin[ 2 ]+470.0 )   // z axis
  77.     write_short( g_exploSpr )   // sprite
  78.     write_byte( 0 )         // startframe
  79.     write_byte( 0 )         // framerate
  80.     write_byte( 4 )         // life
  81.     write_byte( 60 )        // width
  82.     write_byte( 0 )         // noise
  83.     write_byte( random( 256 ))  // red
  84.     write_byte( random( 256 ))  // green
  85.     write_byte( random( 256 ))  // blue
  86.     write_byte( 200 )       // brightness
  87.     write_byte( 0 )         // speed
  88.     message_end( )
  89.    
  90.     // Largest ring
  91.     engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, fOrigin, 0 )
  92.     write_byte( TE_BEAMCYLINDER )               // TE id
  93.     engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] )     // x
  94.     engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] )     // y
  95.     engfunc( EngFunc_WriteCoord, fOrigin[ 2 ] )     // z
  96.     engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] )     // x axis
  97.     engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] )     // y axis
  98.     engfunc( EngFunc_WriteCoord, fOrigin[ 2 ]+555.0 )   // z axis
  99.     write_short( g_exploSpr )   // sprite
  100.     write_byte( 0 )         // startframe
  101.     write_byte( 0 )         // framerate
  102.     write_byte( 4 )         // life
  103.     write_byte( 60 )        // width
  104.     write_byte( 0 )         // noise
  105.     write_byte( random( 256 ))  // red
  106.     write_byte( random( 256 ))  // green
  107.     write_byte( random( 256 ))  // blue
  108.     write_byte( 200 )       // brightness
  109.     write_byte( 0 )         // speed
  110.     message_end( )
  111. }
  112.  
  113. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  114. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
  115. */
Advertisement
Add Comment
Please, Sign In to add comment