LittleKu 发表于 2010-6-6 16:08:37

一个小插件!

本帖最后由 kk阿朗 于 2010-6-24 18:29 编辑

插件介绍:
当恐怖分子安装C4后,会在以C4为中心的点向外散发类似于光环的东西,详情请看图片吧!


Edited:修正了一个BUG !!!!

所需模块:

#include <engine>
#include <csx>
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fakemeta>
#include <csx>

#define PLUGIN "c4 Blast"
#define VERSION "0.2"
#define AUTHOR "K.K.Lv"

new gSpriteCircle;

new gC4Timer;

new Float:fOrigin[ 3 ];

new iOrigin[ 3 ];

public plugin_init() {
    register_plugin( PLUGIN, VERSION, AUTHOR );

    register_logevent( "RoundEnd", 2, "1=Round_End" );
}
public plugin_precache() {
    gSpriteCircle = precache_model( "sprites/shockwave.spr" );
}
public bomb_planted( planter ) {
    gC4Timer = get_cvar_num( "mp_c4timer" );

    set_task( 1.0, "bomb_blast", 1987);
    set_task( 1.0, "dist_time", 1990, "", 0, "b" );
}
public bomb_blast() {
    new c4 = -1;
    while ( ( c4 = engfunc( EngFunc_FindEntityByString, c4, "classname", "grenade" ) ) ) {
      if ( get_pdata_int( c4, 96 ) & ( 1<<8 ) ) {
            create_blast_circle( c4 );
      }
    }
    static Float:task_time
    if ( gC4Timer > 13 ) task_time = 1.0;
    else if ( gC4Timer > 7 )task_time = 0.5;
    else task_time = 0.3;
    set_task( task_time, "bomb_blast", 1987 );
}
public dist_time() {
    --gC4Timer;
}
public RoundEnd() {
    remove_task( 1987 );
    remove_task( 1990 );

    /*new c4 = -1;
    while ( ( c4 = find_ent_by_model( c4, "grenade", "models/w_c4.mdl" ) ) ) {
   remove_entity( c4 );
    }*/
}
stock create_blast_circle( ent ) {
    pev( ent, pev_origin, fOrigin );
    FVecIVec( fOrigin, iOrigin );

    static r, g, b;
    if ( gC4Timer > 13 ) {r = 255; g = 255; b = 255;}
    else if ( gC4Timer > 7 ){r = 125; g = 125; b = 0;}
    else {r = 250; g = 10; b = 0;}

    message_begin( MSG_BROADCAST, SVC_TEMPENTITY, iOrigin );
    write_byte( TE_BEAMCYLINDER );
    write_coord( iOrigin[ 0 ] );
    write_coord( iOrigin[ 1 ] );
    write_coord( iOrigin[ 2 ] );
    write_coord( iOrigin[ 0 ] );
    write_coord( iOrigin[ 1 ] );
    write_coord( iOrigin[ 2 ] + 125 ) ;
    write_short( gSpriteCircle );
    write_byte( 0 );
    write_byte( 1 );
    write_byte( 6 );
    write_byte( 8 );
    write_byte( 1 );
    write_byte( r );
    write_byte( g );
    write_byte( b );
    write_byte( 128 );
    write_byte( 5 );
    message_end();

    if ( gC4Timer > 7 ) {
      message_begin( MSG_BROADCAST, SVC_TEMPENTITY, iOrigin );
      write_byte( TE_BEAMCYLINDER );
      write_coord( iOrigin[ 0 ] );
      write_coord( iOrigin[ 1 ] );
      write_coord( iOrigin[ 2 ] );
       write_coord( iOrigin[ 0 ] );
      write_coord( iOrigin[ 1 ] );
      write_coord( iOrigin[ 2 ] + 270 ) ;
      write_short( gSpriteCircle );
      write_byte( 0 );
      write_byte( 1 );
      write_byte( 6 );
      write_byte( 8 );
      write_byte( 1 );
      write_byte( r );
      write_byte( g );
      write_byte( b );
      write_byte( 128 );
      write_byte( 5 );
      message_end();
    }
}此插件不需任何命令与参数!在单机CS1.6,AMXX1.8.1 测试过!

20576526 发表于 2010-6-6 17:57:00

顶呀,辛苦了楼主

jinshumin 发表于 2010-6-6 20:12:50

不错哦 进来支持下

xiao69 发表于 2010-6-7 13:21:03

不错哦,收藏了!

wenwen 发表于 2010-6-7 13:58:52

我玩1.5请问需要来下载吗!

hang6028 发表于 2010-6-7 15:37:37

有创意的都得顶起 :loveliness:

yesterday 发表于 2010-6-14 12:03:51

很有创意,支持原创~!

七星 发表于 2010-6-14 12:34:42

不错,留个记号

593727013 发表于 2010-6-16 14:40:41

创意无边 精彩无限
LZ的插件很有价值哈 收藏了
嗯 就起名叫C4-Aura吧

311890 发表于 2010-6-16 15:15:30

死亡光环~~~~
页: [1] 2
查看完整版本: 一个小插件!