Senior Member
|
07-29-2016
, 12:14
Re: [REQ] Admin Explode
|
#11
|
Hello. So i used this plugin for few months now, it works great, killing people etc very nice. But i would like to change the blast effect:
I want to have the same effect than the video (the explosion effect with a earthquake touch):
At the moment i have this, a kind of rainbow shockwave:
I want an explosion effect like this:
The video:
https://www.youtube.com/watch?v=IPR4uHiqYSM#t=0m17s
I don't know how to script a plugin i'm sorry. Even if I replace the "shockwave.spr" by "explosion.spr" it does not work, because something need to be changed about the amplitude i think.
I'm using arnall's plugin (see page 1):
PHP Code:
#include < amxmodx > #include < amxmisc >
#include < engine >
#include < fun >
#pragma semicolon 1
new gCvarEnabled; new gCvarRadius; new gCvarDamage; new gCvarFragBonus; //new gCvarMoneyBonus;
new gCylinderSprite; new gMaxPlayers; new gMessageDeathMsg;
new Trie:gTrieHandleInflictorToIgnore;
new const InflictorToIgnore[ ][ ] = { "world", "worldspawn", "trigger_hurt", "door_rotating", "door", "rotating", "env_explosion" };
new const gExplodeSound[ ] = "weapons/rocketfire1.wav";
public plugin_init( ) { register_plugin( "Admin Explode", "1.0.1", "tuty" ); register_concmd ( "explode","autoexplode",ADMIN_LEVEL_B,"auto_explode",-1);
register_event( "DeathMsg", "Hook_DeathMessage", "a" ); gCvarEnabled = register_cvar( "ae_enabled", "1" ); gCvarRadius = register_cvar( "ae_radius", "500" ); gCvarDamage = register_cvar( "ae_damage", "1000.0" ); gCvarFragBonus = register_cvar( "ae_frags", "1" ); gMaxPlayers = get_maxplayers(); gMessageDeathMsg = get_user_msgid( "DeathMsg" );
gTrieHandleInflictorToIgnore = TrieCreate( );
for( new i = 0; i < sizeof InflictorToIgnore; i++ ) { TrieSetCell( gTrieHandleInflictorToIgnore, InflictorToIgnore[ i ], i ); } }
public plugin_precache( ) { gCylinderSprite = precache_model( "sprites/shockwave.spr" ); precache_sound( gExplodeSound ); } public autoexplode (id) { new iOrigin[ 3 ]; get_user_origin( id, iOrigin ); new iRadius = get_pcvar_num( gCvarRadius ); UTIL_CreateBeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 255 ), random( 255 ), random( 255 ), 255, 0 ); UTIL_CreateBeamCylinder( iOrigin, 320, gCylinderSprite, 0, 0, 6, 16, 0, random( 255 ), random( 255 ), random( 255 ), 255, 0 ); UTIL_CreateBeamCylinder( iOrigin, iRadius, gCylinderSprite, 0, 0, 6, 16, 0, random( 255 ), random( 255 ), random( 255 ), 255, 0 ); UTIL_Blast_ExplodeDamage( id, get_pcvar_float( gCvarDamage ), float( iRadius ) ); emit_sound( id, CHAN_BODY, gExplodeSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM ); }
//return PLUGIN_CONTINUE;
public Hook_DeathMessage( ) { if( get_pcvar_num( gCvarEnabled ) != 1 ) { return PLUGIN_CONTINUE; }
new iKiller = read_data( 1 ); new iVictim = read_data( 2 ); new szWeapon[ 30 ]; read_data( 4, szWeapon, charsmax( szWeapon ) ); if( iVictim == iKiller ) { return PLUGIN_CONTINUE; } if( TrieKeyExists( gTrieHandleInflictorToIgnore, szWeapon ) ) { return PLUGIN_CONTINUE; }
if( is_user_admin( iVictim ) ) { new iOrigin[ 3 ]; get_user_origin( iVictim, iOrigin ); new iRadius = get_pcvar_num( gCvarRadius ); UTIL_CreateBeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 255 ), random( 255 ), random( 255 ), 255, 0 ); UTIL_CreateBeamCylinder( iOrigin, 320, gCylinderSprite, 0, 0, 6, 16, 0, random( 255 ), random( 255 ), random( 255 ), 255, 0 ); UTIL_CreateBeamCylinder( iOrigin, iRadius, gCylinderSprite, 0, 0, 6, 16, 0, random( 255 ), random( 255 ), random( 255 ), 255, 0 ); UTIL_Blast_ExplodeDamage( iVictim, get_pcvar_float( gCvarDamage ), float( iRadius ) ); emit_sound( iVictim, CHAN_BODY, gExplodeSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM ); }
return PLUGIN_CONTINUE; }
stock UTIL_Blast_ExplodeDamage( entid, Float:damage, Float:range ) { new Float:flOrigin1[ 3 ]; entity_get_vector( entid, EV_VEC_origin, flOrigin1 );
new Float:flDistance; new Float:flTmpDmg; new Float:flOrigin2[ 3 ];
for( new i = 1; i <= gMaxPlayers; i++ ) { if( is_user_alive( i ) && get_user_team( entid ) != get_user_team( i ) ) { entity_get_vector( i, EV_VEC_origin, flOrigin2 ); flDistance = get_distance_f( flOrigin1, flOrigin2 ); static const szWeaponName[] = "Admin Blast Explosion"; if( flDistance <= range ) { flTmpDmg = damage - ( damage / range ) * flDistance; fakedamage( i, szWeaponName, flTmpDmg, DMG_BLAST ); message_begin( MSG_BROADCAST, gMessageDeathMsg ); write_byte( entid ); write_byte( i ); write_byte( 0 ); write_string( szWeaponName ); message_end(); } } }
set_user_frags( entid, get_user_frags( entid ) + get_pcvar_num( gCvarFragBonus ) ); }
stock UTIL_CreateBeamCylinder( origin[ 3 ], addrad, sprite, startfrate, framerate, life, width, amplitude, red, green, blue, brightness, speed ) { message_begin( MSG_PVS, SVC_TEMPENTITY, origin ); write_byte( TE_BEAMCYLINDER ); write_coord( origin[ 0 ] ); write_coord( origin[ 1 ] ); write_coord( origin[ 2 ] ); write_coord( origin[ 0 ] ); write_coord( origin[ 1 ] ); write_coord( origin[ 2 ] + addrad ); write_short( sprite ); write_byte( startfrate ); write_byte( framerate ); write_byte(life ); write_byte( width ); write_byte( amplitude ); write_byte( red ); write_byte( green ); write_byte( blue ); write_byte( brightness ); write_byte( speed ); message_end(); }
However the radius and killing people script is working. It's just about the explosion effect. Can someone help me ?
I can pay 5€ with paypal if you make the same effect.
Last edited by Joce93; 08-01-2016 at 04:46.
|
|