搜索
查看: 5213|回复: 15

[AMXX 带源码] 暴走插件!

[复制链接]
发表于 2009-4-28 17:00:44 | 显示全部楼层 |阅读模式 来自 中国–湖北–黄石
本帖最后由 8874323 于 2009-4-28 18:23 编辑
  1. #include <amxmodx>
  2. #include <fakemeta>
  3. #include <zombieplague>
  4. #include <fun>
  5. #define fm_get_user_button(%1) pev(%1, pev_button)

  6. new const g_sound_pressure[] = "zombie_plague/zombi_pressure.wav"    //声音文件路径
  7. new zmkillcount[33]                                                  //用于存储感染人数的变酿
  8. new onrage[33]                             //此数组每元素用于表示一玩家是否在狂暴状态,0否,1斿
  9. new cvar_spendhp, cvar_rageduration, cvar_xspeed   //3个变量分别用于狂暴耗血量,狂暴维持时间,狂暴时速度倍数

  10. public plugin_precache()
  11. {
  12. precache_sound(g_sound_pressure)
  13. return PLUGIN_CONTINUE
  14. }




  15. public plugin_init()
  16. {
  17. register_plugin("[ZP]Zombie-Rage", "1.0", "ding ding")
  18. cvar_spendhp = register_cvar("zp_rage_spendhp", "1000")       //耗费500血
  19. cvar_rageduration = register_cvar("zp_rageduration", "10")     //持续12祿
  20. cvar_xspeed = register_cvar("zp_xspeed", "3.5")               //狂暴速度为原本速度瘿.5便
  21. register_forward(FM_PlayerPreThink, "fw_playerprethink")
  22. register_event("RoundTime", "roundstart", "bc")
  23. register_event("SendAudio", "roundstart", "a", "1=0")
  24. }

  25. public roundstart()          //每开新一局将感染数清零,消除上一局狂暴状徿
  26. {
  27. for ( new i = 0; i < 33; i++ )
  28. {
  29. if( onrage == 1 )
  30. endrage(i)
  31. zmkillcount = 0
  32. }
  33. return PLUGIN_HANDLED
  34. }

  35. public zp_user_infected_post(id, infector)
  36. {
  37. if (zp_get_user_zombie(infector))
  38. zmkillcount[infector] += 1               //玩家每感染一人,他的感染计数刿
  39. return PLUGIN_CONTINUE
  40. }

  41. public fw_playerprethink(id)
  42. {
  43. if (onrage[id] ==1)               //如果玩家是狂暴状徿
  44. {                                       
  45. set_user_maxspeed(id, (pev(id, pev_maxspeed) * 1.0 * get_pcvar_num(cvar_xspeed)))  //就把速度变为2.5便
  46. return FMRES_HANDLED
  47. }
  48. else if (!is_user_alive(id))
  49. return FMRES_IGNORED
  50. else if (!zp_get_user_zombie(id))
  51. return FMRES_IGNORED
  52. else
  53. {
  54. new button = fm_get_user_button(id)                           //获得玩家按键
  55. if (button & IN_USE && (zmkillcount[id] >= 3) && pev(id, pev_health) > get_pcvar_num(cvar_spendhp) )
  56. {  // 如果玩家按下E钿,并且玩家感染了超过3个人类,并且玩家的生命足够开启一次狂昿
  57. onrage[id] = 1           //该玩家狂暴状态设䶿(开启)
  58. engfunc(EngFunc_EmitSound, id, CHAN_VOICE, g_sound_pressure, 1.0, ATTN_NORM, 0, PITCH_NORM) //播放狂暴声音
  59. set_pev(id, pev_health, (pev(id, pev_health)*1.0 - get_pcvar_num(cvar_spendhp))) //生命消羿
  60. set_task(get_pcvar_num(cvar_rageduration)*1.0, "endrage", id)     //设置一个任务,在狂暴时间结束后执行
  61. return FMRES_HANDLED
  62. }
  63. }
  64. return FMRES_IGNORED
  65. }

  66. public endrage(id)              //此一函数用于在狂暴时间结束后把玩家狂暴状态设置为0(关闭)
  67. {
  68. onrage[id] = 0
  69. return PLUGIN_HANDLED
  70. }
复制代码
发表于 2009-4-28 19:12:45 | 显示全部楼层 来自 中国–山西–晋城
狂暴和无敌差不多吧..就是自身会掉血.如果有无敌了就不需要了吧
回复

使用道具 举报

发表于 2009-4-28 21:20:45 | 显示全部楼层 来自 中国–广西–玉林
谁去试验了?试验过的和我们说说
回复

使用道具 举报

发表于 2009-4-29 08:09:29 | 显示全部楼层 来自 中国–辽宁–本溪
怎么编译?
回复

使用道具 举报

发表于 2009-4-29 20:41:33 | 显示全部楼层 来自 中国–广西–柳州
转自 modchina 的插件。独孤后人的作品。
目的是模仿CSOL里僵尸暴走的效果。
回复

使用道具 举报

发表于 2009-4-29 21:52:47 | 显示全部楼层 来自 中国–湖北–武汉
什么意思?
回复

使用道具 举报

发表于 2009-4-29 23:17:00 | 显示全部楼层 来自 中国–广东–广州–白云区
1.76c.......测试通过....谢谢啦..LZ
回复

使用道具 举报

发表于 2009-4-30 00:08:28 | 显示全部楼层 来自 中国–广东–茂名
测式通过。。不错支持一下
回复

使用道具 举报

 楼主| 发表于 2009-5-1 17:22:42 | 显示全部楼层 来自 中国–湖北–黄石
谁在1。8。1下测试过?
回复

使用道具 举报

发表于 2009-5-1 18:42:51 | 显示全部楼层 来自 中国–天津–天津
支持一下!!!谢谢!
回复

使用道具 举报

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

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