eason39 发表于 2009-5-17 22:15:59

求一个手雷爆炸效果插件

在网上找到好多手雷效果的spr文件,但找了论坛没有类似这样的插件,麻烦那位能提供下?

点通粉丝 发表于 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;


/******************************************************************
********************** 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 = engfunc(EngFunc_PrecacheModel,g_sprites);
               
}

/**************************************
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;
        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;
        pev(ent,pev_origin,origin);
   
       
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
        write_byte(TE_EXPLOSION); // TE_EXPLOSION
        write_coord(floatround(origin)); // origin x
        write_coord(floatround(origin)); // origin y
        write_coord(floatround(origin)); // origin z
        write_short(gSpriteIndex); // 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

eason39 发表于 2009-5-20 12:43:06

谢谢!!

千喜哥 发表于 2009-5-20 19:01:22

点通粉丝 真地道!!
发就来原码!!
支持!!!

renruntan 发表于 2010-12-21 15:05:20

顶上去 好东西

renruntan 发表于 2010-12-21 15:07:04

编译不了啊??

cs9527 发表于 2010-12-22 02:43:50



这个爆炸效果怎么样?

cs9527 发表于 2010-12-22 02:44:42

114772348 发表于 2010-12-25 09:38:28

9527的更经典,附件呢?

lyw8614505 发表于 2011-9-14 13:57:50

找这东西很久了,想不到是很久以前的
页: [1] 2
查看完整版本: 求一个手雷爆炸效果插件