Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Plugin] New HE Granade Effect
#1
[Image: OYIFmcv.png]
Kit plugin e qita tash masi qe jan festat e fundvitit edhe mu pershtat diqka me fishekzjarre

[Image: orQLgii.png]
- Emri: New HE Granade Effect
- Verzioni: V1.3
- Autori: aNNak1N
- Editori: Dinnii

- SMA File [spoiler]===========================================================================================================================*/

#include < amxmodx >
#include < fakemeta >
#include < fakemeta_util >
#include < hamsandwich >

#define PLUGIN "New HE Grenade Effects"
#define VERSION "1.3"
#define AUTHOR "aNNak1N"
#define EDITOR "Dinnii"

new const g_szFireGib[ ] = "sprites/firegib.spr";
new const g_szExplosionFire[ ] = "sprites/fireexplosion.spr";
new const g_szFireWorks[ ] = "sprites/fireworks_sprite2.spr";
new const g_szFireWorks2[ ] = "sprites/fireworks_sprite1.spr";

new FwFireGib, FwExplosionFire, FwTrail, FwExplode;
new g_iCvarChangeMode;

//constantele pentru stock
const m_fBombStatus = 96;
const m_usEvent = 114;

const fBombPlanted = 1 << 8;
const fExploEvent = 1 << 0;
const fSmokeEvent = 1 << 1;

public plugin_init( ) {

register_plugin( PLUGIN, VERSION, AUTHOR );

register_forward( FM_SetModel, "fw_SetWmodel", 1 );

RegisterHam( Ham_Think, "grenade", "ham_grenade_think", 0 );

g_iCvarChangeMode = register_cvar( "he_change_mode", "1" );
}

public plugin_precache( ) {

FwFireGib = precache_model( g_szFireGib );
FwExplosionFire = precache_model( g_szExplosionFire );
FwTrail = precache_model( g_szFireWorks );
FwExplode = precache_model( g_szFireWorks2 );
}

public fw_SetWmodel( ent, model[ ] ) {

if( !fm_is_ent_grenade( ent ) )
return FMRES_IGNORED;

set_pev( ent, pev_bInDuck, 1 );
return FMRES_IGNORED;
}

bool: fm_is_ent_grenade( entity ) {

new classname[ 9 ];
pev( entity, pev_classname, classname, 8 );

if( !equal( classname, "grenade" ) )
return false;

new bits = get_pdata_int( entity, 114 );
if( bits & ( 1<<0 ) )
return true;

return false;
}

public ham_grenade_think( ent ) {

if( !pev( ent, pev_bInDuck ) )
return FMRES_IGNORED;

new Float:dmgtime;
pev( ent, pev_dmgtime, dmgtime );

if( dmgtime > get_gametime( ) )
return FMRES_IGNORED;

HEGrenadeFwEffects( ent );
return FMRES_OVERRIDE;
}

public HEGrenadeFwEffects( entity ) {

if( grenade_type( entity ) == CSW_HEGRENADE ) //daca entitatea este grenada HE, atunci arata efectele
{
switch( get_pcvar_num( g_iCvarChangeMode ) ) {

case 0: {

new Float:fOrigin[ 3 ];
pev( entity, pev_origin, fOrigin );

// Medium ring
engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, fOrigin, 0 );
write_byte( TE_BEAMCYLINDER );
engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] );
engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] );
engfunc( EngFunc_WriteCoord, fOrigin[ 2 ] );
engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] );
engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] );
engfunc( EngFunc_WriteCoord, fOrigin[ 2 ] + 470.0 ); // z axis + radius
write_short( FwExplosionFire );
write_byte( 0 ); // startframe
write_byte( 0 ); // framerate
write_byte( 4 ); // life
write_byte( 60 ); // width
write_byte( 0 ); // noise
write_byte( 255 ); // red
write_byte( 127 ); // green
write_byte( 80 ); // blue
write_byte( 200 ); // brightness
write_byte( 0 ); // speed
message_end( );

// Largest ring
engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, fOrigin, 0 );
write_byte( TE_BEAMCYLINDER );
engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] );
engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] );
engfunc( EngFunc_WriteCoord, fOrigin[ 2 ] );
engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] );
engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] );
engfunc( EngFunc_WriteCoord, fOrigin[ 2 ] + 555.0 ); // z axis
write_short( FwExplosionFire );
write_byte( 0 ); // startframe
write_byte( 0 ); // framerate
write_byte( 4 ); // life
write_byte( 60 ); // width
write_byte( 0 ); // noise
write_byte( 255 ); // red
write_byte( 127 ); // green
write_byte( 80 ); // blue
write_byte( 200 ); // brightness
write_byte( 0 ); // speed
message_end( );

// Luz Dinamica
engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, fOrigin, 0 )
write_byte( TE_DLIGHT ) // TE id
engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] ) // x
engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] ) // y
engfunc( EngFunc_WriteCoord, fOrigin[ 2 ] ) // z
write_byte( 50 ); // radio
write_byte( 255 ); // red
write_byte( 127 ); // green
write_byte( 80 ); // blue
write_byte( 30 ); // vida en 0.1, 30 = 3 segundos
write_byte( 30 ); // velocidad de decaimiento
message_end( );

engfunc( EngFunc_MessageBegin, MSG_BROADCAST, SVC_TEMPENTITY, fOrigin, 0);
write_byte( TE_EXPLOSION );
engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] ); // x axis
engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] ); // y axis
engfunc( EngFunc_WriteCoord, fOrigin[ 2 ] + 75 ); // z axis
write_short( FwExplosionFire );
write_byte( 17 );
write_byte( 15 );
write_byte( TE_EXPLFLAG_NOSOUND );
message_end( );

engfunc( EngFunc_MessageBegin, MSG_BROADCAST,SVC_TEMPENTITY, fOrigin, 0 );
write_byte( TE_SPRITETRAIL ); // TE ID
engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] ); // x axis
engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] ); // y axis
engfunc( EngFunc_WriteCoord, fOrigin[ 2 ] + 40 ); // z axis
engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] ); // x axis
engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] ); // y axis
engfunc( EngFunc_WriteCoord, fOrigin[ 2 ] ); // z axis
write_short( FwFireGib ); // Sprite Index
write_byte( 30 ); // Count
write_byte( 10 ); // Life
write_byte( 2 ); // Scale
write_byte( 50 ); // Velocity Along Vector
write_byte( 10 ); // Rendomness of Velocity
message_end( );
}

case 1: {

new Float:fOrigin[ 3 ];
pev( entity, pev_origin, fOrigin );

engfunc( EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, fOrigin, 0 );
write_byte( TE_WORLDDECAL );
engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] );
engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] );
engfunc( EngFunc_WriteCoord, fOrigin[ 2 ] );
write_byte( engfunc( EngFunc_DecalIndex,"{scorch3" ) );
message_end( );

message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( TE_EXPLOSION );
engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] );
engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] );
engfunc( EngFunc_WriteCoord, fOrigin[ 2 ] + 60.0 );
write_short( FwTrail );
write_byte( 10 );
write_byte( 15 );
write_byte( 0 );
message_end( );

message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( TE_SPRITE );
engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] + random_float( -5.0, 5.0 ) );
engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] + random_float( -5.0, 5.0 ) );
engfunc( EngFunc_WriteCoord, fOrigin[ 2 ] + 200.0 );
write_short( FwExplode );
write_byte( 15 );
write_byte( 200 );
message_end( );
}
}
}
}

//stocul de verificare a grenazilor
stock grenade_type( const index, const checkClassName = 0 ) {

static classname[ 9 ];

if( checkClassName ) {

pev( index, pev_classname, classname, 8 )
if ( !equal( classname, "grenade") ) {

return 0;
}
}

if( get_pdata_int( index, m_fBombStatus ) & fBombPlanted ) {

return 0;
}

static bits; bits = get_pdata_int( index, m_usEvent );

if( bits & fExploEvent ) {

return CSW_HEGRENADE;
}

else if( !bits ) {

return CSW_FLASHBANG;
}

else if( bits & fSmokeEvent ) {

return CSW_SMOKEGRENADE;
}

return 0;
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/[/spoiler]

[Image: WwyMGHI.png]
- 1 new_he_effects.sma kët file, e fut atë në addons / amxmodx / scripting / këtu
- 2 new_he_effects.amxx kët file, e fut atë në addons / amxmodx / plugins / këtu
- 3 Emrin e files e shkruani brenda tek addons / amxmodx / configs / plugins.ini këtu
- 4 Folderin sprites e dergoni tek /cstrike/

[Image: YamMKgu.png]
[Image: kU0o3hb.jpg]
[Image: moCty1N.jpg]
[Image: I6QNtFr.jpg]
[Image: 7tZ9xAG.jpg]
[Image: JyEtTp8.jpg]

[Image: dzysCv0.png]
#SHKARKO
Reply }}}}
Thanks given by:
Thanks given by:
Thanks given by:
#2
Shum i fort pluginsi brw
Reply }}}}
Thanks given by:
Thanks given by:
Thanks given by:
#3
albinihosting Wrote:Shum i fort pluginsi brw
Faleminderit Big Grin
Reply }}}}
Thanks given by:
Thanks given by:
Thanks given by:
#4
Shum i fort e qitna nsrw
ama nfurien po e bojke ni bug se po mujka mu perdor si sg granad :3
[Image: b_560_95_1.png]
[Image: b_560_95_1.png]
Reply }}}}
Thanks given by:
Thanks given by:
Thanks given by:
#5
Shume plugin i lezetshem, flm Smile
[Image: 7WzHQW.png]
Reply }}}}
Thanks given by:
Thanks given by:
Thanks given by:
#6
ArgjentAl Wrote:Shum i fort e qitna nsrw
ama nfurien po e bojke ni bug se po mujka mu perdor si sg granad :3
Nqs te bon Bug tek plugins.ini ne e shkrun new_he_effects.amxx debug Big Grin
Reply }}}}
Thanks given by:
Thanks given by:
Thanks given by:
#7
Eduart96 Wrote:Shume plugin i lezetshem, flm Smile
Faleminderit Big Grin
Reply }}}}
Thanks given by:
Thanks given by:
Thanks given by:
#8
Bravo GJ Big Grin koka shum i mir, amo shum pom pelqen qe e paske qit filen .SMA Wink
Reply }}}}
Thanks given by:
Thanks given by:
Thanks given by:
#9
BABA.AL Wrote:Bravo GJ Big Grin koka shum i mir, amo shum pom pelqen qe e paske qit filen .SMA Wink
Faleminderit Big Grin Filen SMA e qita per me pas mundesi me editu tjert ndonje gje tjeter te nevojshme Smile
Reply }}}}
Thanks given by:
Thanks given by:
Thanks given by:


Forum Jump:


Users browsing this thread: 1 Guest(s)