搜索
查看: 24599|回复: 60

[AMXX 带源码] 经点通高手重新改过的一些好插件源码

[复制链接]
发表于 2009-1-9 23:51:13 | 显示全部楼层 |阅读模式 来自 中国–广东–广州–白云区
本帖最后由 点通粉丝 于 2009-1-10 07:34 编辑
  1. /*
  2. sv_customsky <0-2>
  3. 0 : plugin off.
  4. 1 : change sky based on map (edit custom_sky.cfg). (Default)
  5. 2 : change sky based on sv_customskyname cvar.
  6. 3 : change sky based on random sky
  7. sv_customskyname "test_" - use if sv_customsky is set to 2.
  8. backalley,badlands,blue,city1,cliff,cx,de_storm,desert,Des,doom1,DrkG,dusk,forest,green,grnplsnt,morningdew,office,snow,tornsky,TrainYard,tsccity_,snowlake_
  9. #define PLUGIN         "custom sky"
  10. #define VERSION "1.1"
  11. #define AUTHOR         "cheap_suit"
  12. */

  13. #include <amxmodx>
  14. #include <amxmisc>

  15. #define PLUGIN         "SKY"
  16. #define VERSION "1.0"
  17. #define AUTHOR         "CS-FG"

  18. #define max_suffix 6
  19. new g_suffix[max_suffix][3] = { "up", "dn", "ft", "bk", "lf", "rt" }
  20. new skyarray[22][16]={"backalley","badlands","blue","city1","cliff","cx","de_storm","desert","Des","doom1","DrkG","dusk","forest","green","grnplsnt","morningdew","office","snow","tornsky","TrainYard","tsccity_","snowlake_"}
  21. public plugin_precache()
  22. {
  23.         register_plugin(PLUGIN, VERSION, AUTHOR)
  24.         register_cvar(PLUGIN, VERSION, FCVAR_SPONLY|FCVAR_SERVER)
  25.        
  26.         register_cvar("sv_customsky", "3")
  27.         register_cvar("sv_customskyname", "test_")
  28.        
  29.         switch(get_cvar_num("sv_customsky"))
  30.         {
  31.                 case 1:
  32.                 {
  33.                         static configsdir[32]
  34.                         get_configsdir(configsdir, 31)
  35.                        
  36.                         static file[64]
  37.                         formatex(file, 63, "%s/custom_sky.cfg", configsdir)
  38.                        
  39.                         static mapname[32]
  40.                         get_mapname(mapname, 31)
  41.                        
  42.                         if(!file_exists(file))
  43.                         {
  44.                                 write_file(file, "; Custom map sky config")
  45.                                 write_file(file, "; Format: <mapname>  <skyname>")
  46.                         }
  47.        
  48.                         new line = 0, length = 0
  49.                         static text[64], maptext[32], tgatext[32]
  50.                         while(read_file(file, line++, text, 127, length))
  51.                         {
  52.                                 if((text[0] == ';') || !length)
  53.                                         continue
  54.                                                
  55.                                 parse(text, maptext, 31, tgatext, 31)
  56.                                 if(equal(maptext, mapname))
  57.                                 {
  58.                                         precache_sky(tgatext)
  59.                                         break
  60.                                 }
  61.                         }
  62.                 }
  63.                 case 2:
  64.                 {
  65.                         static cvar_skyname[32]
  66.                         get_cvar_string("sv_customskyname", cvar_skyname, 31)
  67.                        
  68.                         if(strlen(cvar_skyname) > 0)
  69.                                 precache_sky(cvar_skyname)
  70.                 }
  71.                 case 3:
  72.                 {
  73.                         static random_skyname[32]
  74.                         //get_cvar_string("sv_customskyname", random_skyname, 31)
  75.                         new randomnum=random_num(0,21)
  76.                         random_skyname=skyarray[randomnum]
  77.                         if(strlen(random_skyname) > 0)
  78.                                 precache_sky(random_skyname)
  79.                 }

  80.         }
  81. }

  82. public precache_sky(const skyname[])
  83. {
  84.         new bool:found = true
  85.         static tgafile[35]
  86.        
  87.         for(new i = 0; i < max_suffix; ++i)
  88.         {
  89.                 formatex(tgafile, 34, "gfx/env/%s%s.tga", skyname, g_suffix[i])
  90.                 if(file_exists(tgafile))
  91.                         precache_generic(tgafile)
  92.                 else
  93.                 {
  94.                         log_amx("Cannot locate file '%s'", tgafile)
  95.                         found = false
  96.                         break
  97.                 }
  98.         }
  99.        
  100.         if(found)
  101.                 set_cvar_string("sv_skyname", skyname)
  102. }
复制代码
CS1.5随机天空插件源码
在新的一年里.我也发一个好东东比.还在和我一样还完CS1.5的朋友一起用吧
在此感谢飞哥
 楼主| 发表于 2009-1-9 23:55:54 | 显示全部楼层 来自 中国–广东–广州–白云区
本帖最后由 点通粉丝 于 2009-1-15 03:18 编辑
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #define PLUGIN "skyblack"
  4. #define VERSION "1.0"
  5. #define AUTHOR "yathsing"
  6. #define SKYNAME "space"

  7. public plugin_init() {
  8. register_plugin(PLUGIN, VERSION, AUTHOR)
  9. server_cmd("sv_skyname %s", SKYNAME)
  10. }
复制代码
原版黑夜天空源码
以后发插件.大冢都用这样的格式发.多好啊.好源码也不会流失


以下网址的作者简直是天才.他写的插件是我的之爱
http://forums.alliedmods.net/search.php?searchid=3320413
回复

使用道具 举报

发表于 2009-1-10 00:55:05 | 显示全部楼层 来自 中国–浙江–杭州–余杭区
:lol白痴。。 你都不说下这是什么插件?
回复

使用道具 举报

 楼主| 发表于 2009-1-10 04:14:42 | 显示全部楼层 来自 中国–广东–广州–白云区
本帖最后由 点通粉丝 于 2009-1-13 12:20 编辑

3# lanmao

/*
                        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/1.spr",
        "sprites/2.spr",
        "sprites/3.spr",
        "sprites/4.spr",
        "sprites/l5.spr",
        "sprites/6.spr",
        "sprites/7.spr",
        "sprites/8.spr",
        "sprites/9.spr",
        "sprites/10.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 = 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[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
}

烟花spr请自行制作
手雷烟花爆炸效果源码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
回复

使用道具 举报

 楼主| 发表于 2009-1-10 04:22:00 | 显示全部楼层 来自 中国–广东–广州–白云区
本帖最后由 点通粉丝 于 2009-1-13 12:25 编辑

#include <amxmodx>

#define PLUGIN "Deathtype Effects"
#define VERSION "1.0"
#define AUTHOR "anakin_cstrike"

#define TEMP_MSG        16
#define TEMP_MSG2        1936

new toggle_plugin,toggle_hs,toggle_kn,toggle_he,g_Smoke,g_Lightning,g_Explode;
public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR);
        register_event("DeathMsg","hook_death","a");
        toggle_plugin = register_cvar("death_effects","1");
        toggle_hs = register_cvar("hs_effect","1");
        toggle_kn = register_cvar("kn_effect","1");
        toggle_he = register_cvar("he_effect","1");
}
public plugin_precache()
{
        precache_sound("ambience/thunder_clap.wav");
        precache_sound("weapons/headshot2.wav");
        precache_sound("weapons/explode3.wav");
        g_Smoke = precache_model("sprites/steam1.spr");
        g_Lightning = precache_model("sprites/lgtning.spr");
        g_Explode = precache_model("sprites/white.spr");
        return PLUGIN_CONTINUE
}
public hook_death()
{
        if(get_pcvar_num(toggle_plugin) != 1) return PLUGIN_CONTINUE;
        if(!read_data(1)) return PLUGIN_CONTINUE;
        new wpn[3],vOrigin[3],coord[3];
        new victim = read_data(2);
        new hs = read_data(3);
        read_data(4,wpn,2);
        get_user_origin(victim,vOrigin);
        vOrigin[2] -= 26
        coord[0] = vOrigin[0] + 150;
        coord[1] = vOrigin[1] + 150;
        coord[2] = vOrigin[2] + 800;
       
        if(hs && wpn[0] != 'k' && wpn[1] != 'r' && get_pcvar_num(toggle_hs) == 1)
        {
                create_explode(vOrigin);
                emit_sound(victim,CHAN_ITEM, "weapons/explode3.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
        }
        if(wpn[0] == 'k' && !hs && get_pcvar_num(toggle_kn) == 1)
        {
                create_thunder(coord,vOrigin);
                emit_sound(victim,CHAN_ITEM, "ambience/thunder_clap.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
        }
        if(wpn[1] == 'r' && !hs && get_pcvar_num(toggle_he) == 1)
        {
                create_blood(vOrigin);
                emit_sound(victim,CHAN_ITEM, "weapons/headshot2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
        }
        return PLUGIN_CONTINUE;
}

create_explode(vec1[3])
{
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY,vec1);
        write_byte(TE_BEAMCYLINDER);
        write_coord(vec1[0]);
        write_coord(vec1[1]);
        write_coord(vec1[2] + TEMP_MSG);
        write_coord(vec1[0]);
        write_coord(vec1[1]);
        write_coord(vec1[2] + TEMP_MSG2);
        write_short(g_Explode);
        write_byte(0);
        write_byte(0);
        write_byte(2);
        write_byte(16);
        write_byte(0);
        write_byte(188);
        write_byte(220);
        write_byte(255);
        write_byte(255);
        write_byte(0);
        message_end();

        message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
        write_byte(TE_EXPLOSION2);
        write_coord(vec1[0]);
        write_coord(vec1[1]);
        write_coord(vec1[2]);
        write_byte(185);
        write_byte(10);
        message_end();
       
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY,vec1);
        write_byte(TE_SMOKE);
        write_coord(vec1[0]);
        write_coord(vec1[1]);
        write_coord(vec1[2]);
        write_short(g_Smoke);
        write_byte(2);  
        write_byte(10);  
        message_end();
}
create_thunder(vec1[3],vec2[3])
{
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
        write_byte(0);
        write_coord(vec1[0]);
        write_coord(vec1[1]);
        write_coord(vec1[2]);
        write_coord(vec2[0]);
        write_coord(vec2[1]);
        write_coord(vec2[2]);
        write_short(g_Lightning);
        write_byte(1);
        write_byte(5);
        write_byte(2);
        write_byte(20);
        write_byte(30);
        write_byte(200);
        write_byte(200);
        write_byte(200);
        write_byte(200);
        write_byte(200);
        message_end();

        message_begin( MSG_PVS, SVC_TEMPENTITY,vec2);
        write_byte(TE_SPARKS);
        write_coord(vec2[0]);
        write_coord(vec2[1]);
        write_coord(vec2[2]);
        message_end();
       
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY,vec2);
        write_byte(TE_SMOKE);
        write_coord(vec2[0]);
        write_coord(vec2[1]);
        write_coord(vec2[2]);
        write_short(g_Smoke);
        write_byte(10);  
        write_byte(10)  
        message_end();
}
create_blood(vec1[3])
{
        message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
        write_byte(TE_LAVASPLASH);
        write_coord(vec1[0]);
        write_coord(vec1[1]);
        write_coord(vec1[2]);
        message_end();
}



用刀杀人有特别效果
Cvars :
death_effects 1 / 0 -启用/禁用(默认1 )

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×

评分

参与人数 1经验 +2 收起 理由
8874323 + 2 血腥了点

查看全部评分

回复

使用道具 举报

 楼主| 发表于 2009-1-10 04:45:49 | 显示全部楼层 来自 中国–广东–广州–白云区
  1. #include <amxmodx>
  2. #include <fakemeta>

  3. #define PLUGIN "Weapon Trail"
  4. #define VERSION "2.0"
  5. #define AUTHOR "anakin_cstrike"

  6. #define MAX_PLAYERS 32
  7. #define OFFSET_ENT_TO_INDEX 43

  8. enum droptype
  9. {
  10.         droptype_manual,
  11.         droptype_ondeath
  12. }
  13. new
  14. toggle,light,vel,g_max_clients,g_max_entities;

  15. new const g_drop[] = "drop";
  16. new const g_wbox_class[] = "weaponbox";
  17. new const g_wbox_model[] = "models/w_weaponbox.mdl";
  18. new const g_wbox_model_prefix[] = "models/w_";
  19. new const g_start_client_index = 1;
  20. new g_command[MAX_PLAYERS + 1][sizeof g_drop + 1];
  21. new g_trail,r,g,b;
  22. public plugin_init()
  23. {
  24.         register_plugin(PLUGIN, VERSION, AUTHOR);
  25.         register_forward(FM_SetModel, "fw_setmodel");
  26.         register_forward(FM_Touch,"fw_touch");
  27.         toggle = register_cvar("weapontrail","1");
  28.         light = register_cvar("weapontrail_light","1");
  29.         vel = register_cvar("weapontrail_vel","1");
  30.         g_max_clients = global_get(glb_maxClients);
  31.         g_max_entities = global_get(glb_maxEntities);
  32. }
  33. public plugin_precache()
  34. g_trail = precache_model("sprites/smoke.spr");
  35. public client_command(id)
  36.         read_argv(0, g_command[id], sizeof g_drop);
  37. public fw_setmodel(ent, const model[])
  38. {
  39.         if(get_pcvar_num(toggle) != 1)
  40.                 return FMRES_IGNORED;
  41.         if(!pev_valid(ent) || !equal(model, g_wbox_model_prefix, sizeof g_wbox_model_prefix - 1) || equal(model, g_wbox_model))
  42.                 return FMRES_IGNORED;       
  43.         new id = pev(ent, pev_owner)
  44.         if(!(g_start_client_index <= id <= g_max_clients))
  45.                 return FMRES_IGNORED;
  46.         static class[32],i;
  47.         pev(ent,pev_classname,class, sizeof class - 1)
  48.         if(!equal(class,g_wbox_class))
  49.                 return FMRES_IGNORED;
  50.         for(i = g_max_clients + 1;i < g_max_entities;++i)
  51.         {
  52.                 if(!pev_valid(i) || ent != pev(i, pev_owner))
  53.                         continue;
  54.                
  55.                 new wid = get_pdata_int(i,OFFSET_ENT_TO_INDEX);
  56.                 if(wid != CSW_C4)
  57.                 {
  58.                         new droptype:drop_type;
  59.                         if(!is_user_alive(id))
  60.                                 drop_type = droptype_ondeath;
  61.                         else if(equal(g_command[id], g_drop))
  62.                                 drop_type = droptype_manual;
  63.                         else
  64.                                 return FMRES_IGNORED;
  65.                         switch(drop_type)
  66.                         {
  67.                                 case droptype_ondeath: {
  68.                                         if(get_user_team(id) == 1){r=255;g=0;b=0;}
  69.                                         else if(get_user_team(id) == 2){r=0;g=0;b=255;}
  70.                                 }
  71.                                 case droptype_manual: {
  72.                                         r = random(255);
  73.                                         g = random(255);
  74.                                         b = random(255);
  75.                                 }
  76.                         }
  77.                         if(get_pcvar_num(vel) == 1)
  78.                         {
  79.                                 new Float:vel[3];
  80.                                 vel[0] = float(random(300));
  81.                                 vel[1] = float(random(300));
  82.                                 vel[2] = float(random(300));
  83.                                 set_pev(ent,pev_velocity,vel);
  84.                         }
  85.                         message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
  86.                         write_byte(TE_BEAMFOLLOW);
  87.                         write_short(ent);
  88.                         write_short(g_trail);
  89.                         write_byte(5);
  90.                         write_byte(5);
  91.                         write_byte(r);
  92.                         write_byte(g);
  93.                         write_byte(b);
  94.                         write_byte(195);
  95.                         message_end();
  96.                 }
  97.         }
  98.         return FMRES_IGNORED;
  99. }
  100. public fw_touch(touched, toucher)
  101. {
  102.         if(get_pcvar_num(toggle) != 1)
  103.                 return FMRES_IGNORED;
  104.         if(get_pcvar_num(light) != 1)
  105.                 return FMRES_IGNORED;
  106.        
  107.         static class[32];
  108.         pev(toucher, pev_classname, class, sizeof class - 1);
  109.        
  110.         if(containi(class, "weapon") != -1 && !touched)
  111.         {
  112.                 new Float:origin[3];
  113.                 pev(toucher, pev_origin, origin);
  114.                        
  115.                 message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
  116.                 write_byte(TE_DLIGHT);
  117.                 write_coord(floatround(origin[0]));
  118.                 write_coord(floatround(origin[1]));
  119.                 write_coord(floatround(origin[2]));
  120.                 write_byte(20);
  121.                 write_byte(r);
  122.                 write_byte(g);
  123.                 write_byte(b);
  124.                 write_byte(5);
  125.                 write_byte(20);
  126.                 message_end();
  127.         }
  128.         return FMRES_IGNORED;
  129. }
复制代码
5# 点通粉丝

掉枪彩色弹道
cvars :

weapontrail 1 / 0 -启用/禁用插件(默认1 )

weapontrail_light 1 / 0 -启用/禁用d iynamic轻(默认1 )

weapontrail_vel 1 / 0 -启用/禁用的变化速度(预设值是1 )
回复

使用道具 举报

 楼主| 发表于 2009-1-10 04:47:52 | 显示全部楼层 来自 中国–广东–广州–白云区
本帖最后由 点通粉丝 于 2009-1-13 11:54 编辑

6# 点通粉丝

你可以bind 左佢 例如:bind F +cheer
之後你禁F 就會在你的頭上顯示笑號

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
回复

使用道具 举报

 楼主| 发表于 2009-1-10 04:52:18 | 显示全部楼层 来自 中国–广东–广州–白云区
  1. 跳墙插件
  2. 要身体帖墙才可以跳


  3. cvars
  4. walljump_str 600“ 300.0 ” -有多大的力量推动你向上。
  5. walljump_num “ 30 ” -在墙上可跳几多下,
  6. walljump_team  0  

  7. #include <amxmodx>
  8. #include <engine>

  9. new bool:caughtJump[33]
  10. new bool:doJump[33]
  11. new Float:jumpVeloc[33][3]
  12. new newButton[33]
  13. new numJumps[33]
  14. new wallteam

  15. //====================================================================================================
  16. static const TITLE[] = "Wall Jump"
  17. static const VERSION[] = "0.6"
  18. static const AUTHOR[] = "OneEyed"
  19. //====================================================================================================

  20. public plugin_init()
  21. {
  22.         register_plugin(TITLE,VERSION,AUTHOR)
  23.        
  24.         register_cvar("walljump_str","300.0")
  25.         register_cvar("walljump_num","3")
  26.         register_cvar("walljump_team", "0")
  27.        
  28.         register_touch("player", "worldspawn", "Touch_World")
  29.         register_touch("player", "func_wall", "Touch_World")
  30.         register_touch("player", "func_breakable", "Touch_World")
  31. }

  32. public client_disconnect(id) {
  33.         caughtJump[id] = false
  34.         doJump[id] = false
  35.         for(new x=0;x<3;x++)
  36.                 jumpVeloc[id][x] = 0.0
  37.         newButton[id] = 0
  38.         numJumps[id] = 0
  39. }

  40. public client_PreThink(id)
  41. {
  42.         wallteam = get_cvar_num("walljump_team")
  43.         new team = get_user_team(id)
  44.         if(is_user_alive(id) && (!wallteam || wallteam == team))
  45.         {
  46.                 newButton[id] = get_user_button(id)
  47.                 new oldButton = get_user_oldbutton(id)
  48.                 new flags = get_entity_flags(id)
  49.                
  50.                 //reset if we are on ground
  51.                 if(caughtJump[id] && (flags & FL_ONGROUND))
  52.                 {
  53.                         numJumps[id] = 0
  54.                         caughtJump[id] = false
  55.                 }
  56.                
  57.                 //begin when we jump
  58.                 if((newButton[id] & IN_JUMP) && (flags & FL_ONGROUND) && !caughtJump[id] && !(oldButton & IN_JUMP) && !numJumps[id])
  59.                 {
  60.                         caughtJump[id] = true
  61.                         entity_get_vector(id,EV_VEC_velocity,jumpVeloc[id])
  62.                         jumpVeloc[id][2] = get_cvar_float("walljump_str")
  63.                 }
  64.         }
  65. }

  66. public client_PostThink(id)
  67. {
  68.         if(is_user_alive(id))
  69.         {
  70.                 //do velocity if we walljumped
  71.                 if(doJump[id])
  72.                 {
  73.                         entity_set_vector(id,EV_VEC_velocity,jumpVeloc[id])
  74.                        
  75.                         doJump[id] = false
  76.                        
  77.                         if(numJumps[id] >= get_cvar_num("walljump_num")) //reset if we ran out of jumps
  78.                         {
  79.                                 numJumps[id] = 0
  80.                                 caughtJump[id] = false
  81.                         }
  82.                 }
  83.         }
  84. }

  85. public Touch_World(id, world)
  86. {
  87.         if(is_user_alive(id))
  88.         {
  89.                 //if we touch wall and have jump pressed, setup for jump
  90.                 if(caughtJump[id] && (newButton[id] & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND))
  91.                 {
  92.                        
  93.                         //reverse velocity
  94.                         for(new x=0;x<2;x++)
  95.                                 jumpVeloc[id][x] *= -1.0
  96.                                
  97.                         numJumps[id]++
  98.                         doJump[id] = true
  99.                 }       
  100.         }
  101. }
复制代码
7# 点通粉丝
回复

使用道具 举报

发表于 2009-1-10 07:11:08 | 显示全部楼层 来自 中国–广东–韶关
娱乐用的吧
     刀杀效果我感兴趣、截张图上来,源码有个表情修改下
回复

使用道具 举报

 楼主| 发表于 2009-1-10 07:23:45 | 显示全部楼层 来自 中国–广东–广州–白云区
本帖最后由 点通粉丝 于 2009-1-13 11:50 编辑
  1. #include <amxmodx>
  2. #include <engine>

  3. #define TE_EXPLOSION 3
  4. #define TE_SMOKE 5
  5. #define TE_IMPLOSION 14
  6. #define TE_BEAMCYLINDER 21

  7. new g_cvar_death_explode
  8. new g_cvar_radius
  9. new g_cvar_damage
  10. new g_sModelIndexFireball
  11. //new g_sModelIndexSmoke
  12. new m_iSpriteTexture
  13. new g_maxplayers

  14. public plugin_init()
  15. {
  16. register_plugin("Death Explode Damage","1.0","X-man")
  17. register_event("DeathMsg","death","a")
  18. g_cvar_death_explode = register_cvar("death_explode", "1")
  19. g_cvar_radius = register_cvar("explosion_radius", "0")
  20. g_cvar_damage = register_cvar("explosion_damage", "0")
  21. g_maxplayers = get_maxplayers()
  22. }

  23. public plugin_precache()
  24. {
  25. m_iSpriteTexture = precache_model( "sprites/shockwave.spr")
  26. g_sModelIndexFireball = precache_model("sprites/bluejet1.spr")
  27. //g_sModelIndexSmoke = precache_model("sprites/bluejet1.spr")
  28. precache_sound("warcraft3/MiniSpiritPissed1a.wav")
  29. }

  30. public death()
  31. {
  32. if(!get_pcvar_num(g_cvar_death_explode))
  33.   return PLUGIN_CONTINUE

  34. new id = read_data(2)
  35. new origin[3]
  36. get_user_origin(id, origin)
  37. explode(origin,10,9)
  38. emit_sound(id,CHAN_STATIC, "warcraft3/MiniSpiritPissed1a.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)

  39. set_task(0.5, "blastcircles", id)
  40. return PLUGIN_CONTINUE
  41. }

  42. public explode(vec1[3],scale,offset)
  43. {
  44. message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
  45. write_byte( 3 )
  46. write_coord(vec1[0])
  47. write_coord(vec1[1])
  48. write_coord(vec1[2]+offset)
  49. write_short( g_sModelIndexFireball )
  50. write_byte( scale ) // byte (scale in 0.1's) 188
  51. write_byte( 8 ) // byte (framerate)
  52. write_byte( 0 ) // byte flags
  53. message_end()
  54. }

  55. public blastcircles(id)
  56. {
  57. new origin[3]
  58. get_user_origin(id, origin)
  59. new blast_cir = get_pcvar_num(g_cvar_radius)

  60. // blast circles
  61. message_begin(MSG_PAS, SVC_TEMPENTITY, origin)
  62. write_byte(TE_BEAMCYLINDER)
  63. write_coord(origin[0])
  64. write_coord(origin[1])
  65. write_coord(origin[2] - 16)
  66. write_coord(origin[0])
  67. write_coord(origin[1])
  68. write_coord(origin[2] - 16 + blast_cir)
  69. write_short(m_iSpriteTexture)
  70. write_byte(0) // startframe
  71. write_byte(0) // framerate
  72. write_byte(0) // life
  73. write_byte(0) // width
  74. write_byte(0) // noise
  75. write_byte(188)
  76. write_byte(120)
  77. write_byte(155)
  78. write_byte(255) //brightness
  79. write_byte(0) // speed
  80. message_end()

  81. message_begin(MSG_PAS, SVC_TEMPENTITY, origin)
  82. write_byte(TE_BEAMCYLINDER)
  83. write_coord(origin[0])
  84. write_coord(origin[1])
  85. write_coord(origin[2] - 16)
  86. write_coord(origin[0])
  87. write_coord(origin[1])
  88. write_coord(origin[2] - 16 + blast_cir / 2)
  89. write_short(m_iSpriteTexture)
  90. write_byte(0) // startframe
  91. write_byte(0) // framerate
  92. write_byte(0) // life
  93. write_byte(0) // width
  94. write_byte(0) // noise
  95. write_byte(188)
  96. write_byte(120)
  97. write_byte(155)
  98. write_byte(155) //brightness
  99. write_byte(0) // speed
  100. message_end()

  101. // lots of smoke
  102. //message_begin(MSG_PVS, SVC_TEMPENTITY, origin)
  103. //write_byte(TE_SMOKE)
  104. //write_coord(origin[0] + random_num(-100, 100))
  105. //write_coord(origin[1] + random_num(-100, 100))
  106. //write_coord(origin[2] + random_num(-50, 50))
  107. //write_short(g_sModelIndexSmoke)
  108. //write_byte(60) // scale * 10
  109. //write_byte(10) // framerate
  110. //message_end()

  111. set_task(0.5, "bum", id)
  112. }

  113. public bum(id)
  114. {
  115. new team = get_user_team(id)
  116. new radius = get_pcvar_num(g_cvar_radius)
  117. new damage = get_pcvar_num(g_cvar_damage)
  118. new dist
  119. new origin[3], origin1[3]
  120. get_user_origin(id,origin)

  121. for(new i = 1; i <= g_maxplayers; i++)
  122. {
  123.   if(is_user_alive(i) && get_user_team(i) != team)
  124.   {
  125.    get_user_origin(i, origin1)
  126.    dist = get_distance(origin, origin1)
  127.    if(dist < radius)
  128.    {
  129.     fakedamage(i, "Explosion", float(damage - damage * dist / radius), 0)
  130.    }
  131.   }
  132. }
  133. }  


  134. CS1.5-1.6通用死后头上出现绿色烟雾
复制代码
本人只对娱乐插件感兴趣..甘都比你估中..哈哈..不错..不错
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表