|
发表于 2009-5-18 22:24:02
|
显示全部楼层
来自 中国–广东–广州–白云区
本帖最后由 点通粉丝 于 2009-5-18 22:26 编辑
手雷烟花爆炸效果插件- /*
- 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:
- - Csx
- - Fakemeta
- * Cvars:
- - None
- * Admin Commands:
- - None
- Have a nice day now
- */
- #include <amxmodx>
- #include <amxmisc>
- #include <fakemeta>
- #include <csx>
-
- #define PLUGIN_NAME "New HeNades Effects"
- #define PLUGIN_VERSION "0.1"
- #define PLUGIN_AUTHOR "SAMURAI"
-
- // required sprites for plugin
- new const g_sprites[][] =
- {
- "sprites/fexplo1.spr",
- "sprites/fexplo1.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 CSX 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 != CSW_HEGRENADE)
- 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 called 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
- write_byte(TE_EXPLFLAG_NONE); // flags
- message_end(); // message end
- }
复制代码 1# eason39 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|