Raised This Month: $ Target: $400
 0% 

Death Effects


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 12-20-2015 , 02:30   Re: Death Effects
Reply With Quote #2

Please, attach a .sma file when posting a code.

This should work:

Code:
#include <amxmodx> #include <fakemeta> #define PLUGIN "New Plugin" #define VERSION "1.0" #define MAX_FLARES  10 new const g_szFlares[ MAX_FLARES ][ ] = {     "sprites/flares/flare1.spr",     "sprites/flares/flare2.spr",     "sprites/flares/flare3.spr",     "sprites/flares/flare4.spr",     "sprites/flares/flare5.spr",     "sprites/flares/flare6.spr",     "sprites/flares/flare7.spr",     "sprites/flares/flare8.spr",     "sprites/flares/flare9.spr",     "sprites/flares/flare10.spr" } new g_iFlares[ MAX_FLARES ]; public plugin_precache( ) {     for( new i = 0; i < MAX_FLARES; i++ )         g_iFlares[ i ] = precache_model( g_szFlares[ i ] ); } public plugin_init( ) {     register_plugin(PLUGIN, VERSION, "Askhanar" );     register_event(  "DeathMsg",  "EventDeathMsg",  "a"  ); } public EventDeathMsg(  ) {           new iKiller  = read_data(  1  );     new iVictim  = read_data(  2  );         if( iVictim  !=  iKiller )     {         new Float:fOrigin[ 3 ], iOrigin[ 3 ];         pev( iVictim, pev_origin, fOrigin );         FVecIVec( fOrigin, iOrigin );                 UTIL_CreateFlares( iOrigin, g_iFlares[ random( MAX_FLARES ) ], random_num( 30, 50 ), random_num( 10, 15 ), random_num( 5, 8 ) );     } } stock UTIL_CreateFlares( const iOrigin[ 3 ], const iSpriteID, const iCount, const iLife, const iScale ) {     message_begin( MSG_BROADCAST,SVC_TEMPENTITY );     write_byte( TE_SPRITETRAIL );     write_coord( iOrigin[ 0 ] );                // start position (X)     write_coord( iOrigin[ 1 ] );                // start position (Y)     write_coord( iOrigin[ 2 ] );                // start position (Z)     write_coord( iOrigin[ 0 ] );                // end position (X)     write_coord( iOrigin[ 1 ] );                // end position (Y)     write_coord( iOrigin[ 2 ] + random_num( 40, 50 ) ); // end position (Z)     write_short( iSpriteID );               // sprite index     write_byte( iCount );                   // numarul de bule     write_byte( iLife );                    // life in 0.1's     write_byte( iScale );                   // scale in 0.1's     write_byte( random_num( 200, 200 ) );               // velocity along vector in 10's     write_byte( random_num( 10, 15 ) );             // randomness of velocity in 10's     message_end( ); }
Attached Files
File Type: sma Get Plugin or Get Source (death_effects.sma - 541 views - 2.1 KB)

Last edited by addons_zz; 12-20-2015 at 02:33. Reason: spelling fixes
addons_zz is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode