DFHServer
05-17-2007, 04:45 AM
I changed it parts to "dodx" instead of "csx"....
and replaced the check if grenade isn't a HeGrenade
if(wid != CSW_HEGRENADE)
with
if(wid != DODW_STICKGRENADE)
that worked for Axis and if we put in
if(wid != DODW_HANDGRENADE)
that worked for Allies, so I modified it with an OR
if(wid != DODW_STICKGRENADE || wid != DODW_HANDGRENADE)
But, the effects work with AXIS, but not Allies
Below is the script...
If you see anything that might need to be changed, let me know..
I have already placed the 13 sprite files in the dod\sprites folder...
and I do see the plugin running
(New HeNades Effec 0.1 SAMURAI new_henade_efx. running )...
So I think it has to do with the iGren variable below:
Also, the last few sprites don't show as it supposed to leave a skeleton sprite behind on the ground.
regards,
DFHServer
================================================== =============
/*
New HeNades Effects
Version 0.1 by SAMURAI
* Plugin details:
- The basic sprite from hegrenade explode was replaced with new 13 sprites
New effects, colors, etc
* Required Modules:
- dodx
- Fakemeta
* Cvars:
- None
* Admin Commands:
- None
Have a nice day now
*/
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <dodx>
#define PLUGIN_NAME "New HeNades Effects"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "SAMURAI"
// required sprites for plugin
new const g_sprites[][] =
{
"sprites/he_efx1.spr",
"sprites/he_efx2.spr",
"sprites/he_efx3.spr",
"sprites/he_efx4.spr",
"sprites/he_efx5.spr",
"sprites/he_efx6.spr",
"sprites/he_efx7.spr",
"sprites/he_efx8.spr",
"sprites/he_efx9.spr",
"sprites/he_efx10.spr",
"sprites/he_efx11.spr",
"sprites/he_efx12.spr",
"sprites/he_efx13.spr"
}
new gSpriteIndex[sizeof g_sprites];
/************************************************** ****************
********************** AMXMODX PLUGIN *****************************
************************************************** ****************/
public plugin_init()
{
// Register the plugin
register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_ AUTHOR);
// Forward Fakemeta Think
register_forward(FM_Think,"fw_think");
}
// plugin_precache forward
public plugin_precache()
{
for(new i = 0; i < sizeof g_sprites; i++)
gSpriteIndex[i] = engfunc(EngFunc_PrecacheModel,g_sprites[i]);
}
/**************************************
grenade_throw DODX Forward //
It's called when an user throw //
a grenade //
**************************************/
public grenade_throw(id,iGren,wid)
{
// check if grenade isn't a HeGrenade
if(wid != DODW_STICKGRENADE || wid != DODW_HANDGRENADE)
return PLUGIN_CONTINUE;
// check if Grenade entity isn't a valid entity
if(!pev_valid(iGren))
return PLUGIN_CONTINUE;
// set a new classname to HeGrenade
set_pev(iGren,pev_classname,"fake_hegren");
// Make it to explode after 1.6 seconds
set_task(1.6,"gre_explode",iGren);
return PLUGIN_CONTINUE;
}
/*****************************************
FM Think Fakemeta Forward //
On this case, help to stop hegrenade //
from original explosion //
***************************************/
public fw_think(ent)
{
if(!pev_valid(ent))
return FMRES_IGNORED;
if(!pev(ent,pev_bInDuck))
return FMRES_IGNORED;
new class[32];
pev(ent,pev_classname,class,31);
if(equali(class,"fake_hegren"))
return FMRES_SUPERCEDE;
return FMRES_IGNORED;
}
/*****************************************
This is calle d when hegrenade is //
explode with new sprites //
***************************************/
public gre_explode(ent)
{
// check if entity isn't valid
if(!pev_valid(ent))
return;
// new variable for origin and get origin of entity
static Float:origin[3];
pev(ent,pev_origin,origin);
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(TE_EXPLOSION); // TE_EXPLOSION
write_coord(floatround(origin[0])); // origin x
write_coord(floatround(origin[1])); // origin y
write_coord(floatround(origin[2])); // origin z
write_short(gSpriteIndex[random(sizeof g_sprites)]); // sprites
write_byte(40); // scale in 0.1's
write_byte(30); // framerate
wr ite_byte(TE_EXPLFLAG_NONE); // flags
message_end(); // message end
}
and replaced the check if grenade isn't a HeGrenade
if(wid != CSW_HEGRENADE)
with
if(wid != DODW_STICKGRENADE)
that worked for Axis and if we put in
if(wid != DODW_HANDGRENADE)
that worked for Allies, so I modified it with an OR
if(wid != DODW_STICKGRENADE || wid != DODW_HANDGRENADE)
But, the effects work with AXIS, but not Allies
Below is the script...
If you see anything that might need to be changed, let me know..
I have already placed the 13 sprite files in the dod\sprites folder...
and I do see the plugin running
(New HeNades Effec 0.1 SAMURAI new_henade_efx. running )...
So I think it has to do with the iGren variable below:
Also, the last few sprites don't show as it supposed to leave a skeleton sprite behind on the ground.
regards,
DFHServer
================================================== =============
/*
New HeNades Effects
Version 0.1 by SAMURAI
* Plugin details:
- The basic sprite from hegrenade explode was replaced with new 13 sprites
New effects, colors, etc
* Required Modules:
- dodx
- Fakemeta
* Cvars:
- None
* Admin Commands:
- None
Have a nice day now
*/
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <dodx>
#define PLUGIN_NAME "New HeNades Effects"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "SAMURAI"
// required sprites for plugin
new const g_sprites[][] =
{
"sprites/he_efx1.spr",
"sprites/he_efx2.spr",
"sprites/he_efx3.spr",
"sprites/he_efx4.spr",
"sprites/he_efx5.spr",
"sprites/he_efx6.spr",
"sprites/he_efx7.spr",
"sprites/he_efx8.spr",
"sprites/he_efx9.spr",
"sprites/he_efx10.spr",
"sprites/he_efx11.spr",
"sprites/he_efx12.spr",
"sprites/he_efx13.spr"
}
new gSpriteIndex[sizeof g_sprites];
/************************************************** ****************
********************** AMXMODX PLUGIN *****************************
************************************************** ****************/
public plugin_init()
{
// Register the plugin
register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_ AUTHOR);
// Forward Fakemeta Think
register_forward(FM_Think,"fw_think");
}
// plugin_precache forward
public plugin_precache()
{
for(new i = 0; i < sizeof g_sprites; i++)
gSpriteIndex[i] = engfunc(EngFunc_PrecacheModel,g_sprites[i]);
}
/**************************************
grenade_throw DODX Forward //
It's called when an user throw //
a grenade //
**************************************/
public grenade_throw(id,iGren,wid)
{
// check if grenade isn't a HeGrenade
if(wid != DODW_STICKGRENADE || wid != DODW_HANDGRENADE)
return PLUGIN_CONTINUE;
// check if Grenade entity isn't a valid entity
if(!pev_valid(iGren))
return PLUGIN_CONTINUE;
// set a new classname to HeGrenade
set_pev(iGren,pev_classname,"fake_hegren");
// Make it to explode after 1.6 seconds
set_task(1.6,"gre_explode",iGren);
return PLUGIN_CONTINUE;
}
/*****************************************
FM Think Fakemeta Forward //
On this case, help to stop hegrenade //
from original explosion //
***************************************/
public fw_think(ent)
{
if(!pev_valid(ent))
return FMRES_IGNORED;
if(!pev(ent,pev_bInDuck))
return FMRES_IGNORED;
new class[32];
pev(ent,pev_classname,class,31);
if(equali(class,"fake_hegren"))
return FMRES_SUPERCEDE;
return FMRES_IGNORED;
}
/*****************************************
This is calle d when hegrenade is //
explode with new sprites //
***************************************/
public gre_explode(ent)
{
// check if entity isn't valid
if(!pev_valid(ent))
return;
// new variable for origin and get origin of entity
static Float:origin[3];
pev(ent,pev_origin,origin);
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(TE_EXPLOSION); // TE_EXPLOSION
write_coord(floatround(origin[0])); // origin x
write_coord(floatround(origin[1])); // origin y
write_coord(floatround(origin[2])); // origin z
write_short(gSpriteIndex[random(sizeof g_sprites)]); // sprites
write_byte(40); // scale in 0.1's
write_byte(30); // framerate
wr ite_byte(TE_EXPLFLAG_NONE); // flags
message_end(); // message end
}