搜索
查看: 2550|回复: 6

哪个把下面代码中的手雷弹换成烟雾弹

[复制链接]
发表于 2009-3-31 08:44:07 | 显示全部楼层 |阅读模式 来自 中国–广东–中山
本帖最后由 20576526 于 2009-3-31 08:55 编辑

哪个高手把下面代码中的手雷弹换成烟雾弹代码,因为这个代码只能替换手雷,我不想替换手雷,想把烟雾弹给替换掉,不知道哪个高手解决这个问题?
  1. /* CocaCola HE */

  2. /*
  3.    2006-12-12
  4.    替换雷 mdl 为可乐 mdl,替换碰撞声音,支持掉雷插件及 CZ
  5.    一点缺陷:拔罐声音无法替换
  6. */

  7. /* 安装说明
  8.    复制 models 目录到 cstrike 目录下
  9.    复制 misc 目录到 cstrike/sound 目录下
  10. */


  11. #define PLUGIN  "CocaCola HE"
  12. #define VERSION "0.1.16"
  13. #define AUTHOR  "iG_os"

  14. #include <amxmodx>
  15. #include <fakemeta>


  16. // 替换雷的模型文件
  17. new V_HE_MDL[] = "models/cocacola_he/v_cocacola_he.mdl"
  18. new P_HE_MDL[] = "models/cocacola_he/p_cocacola_he.mdl"
  19. new W_HE_MDL[] = "models/cocacola_he/w_cocacola_he.mdl"

  20. // 替换雷碰撞声音的文件
  21. new BOUNCE_WAV[]  = "misc/cocacola_bounce.wav"

  22. //拔罐声音不属于环境声音,暂时无法替换,需要的话,客户端手动替换即可
  23. //new PINPULL_WAV[] = "misc/cocacola_pinpull.wav"


  24. // 原始模型及声音文件参数,不能更改
  25. new DEFAULT_BOUNCE_WAV[] = "weapons/he_bounce-1.wav"
  26. new DEFAULT_W_HE_MDL[]   = "models/w_hegrenade.mdl"


  27. public plugin_precache()
  28. {
  29.    precache_model(V_HE_MDL)
  30.    precache_model(P_HE_MDL)
  31.    precache_model(W_HE_MDL)
  32.    precache_sound(BOUNCE_WAV)
  33. }


  34. public plugin_init()
  35. {
  36.    register_plugin(PLUGIN,VERSION,AUTHOR)

  37.    register_event("CurWeapon", "CurWeapon_even", "be", "1=1", "2=4")

  38.    register_forward(FM_SetModel, "forward_setmodel")
  39.    register_forward(FM_EmitSound, "forward_emitsound")
  40. }


  41. // 设置手持模型
  42. public CurWeapon_even(id)
  43. {
  44.    if (is_user_alive(id))
  45.    {
  46.       set_pev(id, pev_viewmodel2, V_HE_MDL)
  47.       set_pev(id, pev_weaponmodel2, P_HE_MDL)
  48.    }
  49. }


  50. // 替换 mdl
  51. //L 12/12/2006 - 14:04:32: szMdl=models/w_hegrenade.mdl
  52. public forward_setmodel(const entity, const szMdl[])
  53. {
  54.    if (entity>32 && equal(szMdl, DEFAULT_W_HE_MDL))
  55.    {
  56.       engfunc(EngFunc_SetModel, entity, W_HE_MDL)
  57.       return FMRES_SUPERCEDE
  58.    }

  59.    return FMRES_IGNORED
  60. }


  61. // 替换 wav
  62. //L 12/12/2006 - 14:11:04: szNoise=weapons/he_bounce-1.wav
  63. public forward_emitsound(const entity, const channel, szNoise[], const Float:volume, const Float:attenuation, const fFlags, const pitch)
  64. {
  65.    if (entity>32 && equal(szNoise, DEFAULT_BOUNCE_WAV))
  66.    {
  67.       emit_sound(entity,channel, BOUNCE_WAV, volume, attenuation, fFlags, pitch)
  68.       return FMRES_SUPERCEDE
  69.    }

  70.    return FMRES_IGNORED
  71. }


复制代码

本帖子中包含更多资源

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

×
发表于 2009-3-31 11:54:54 | 显示全部楼层 来自 中国–甘肃–兰州
不会弄,帮你顶了
回复

使用道具 举报

发表于 2009-3-31 17:46:12 | 显示全部楼层 来自 中国–广西–百色–田东县
把w_hegrenade.mdl改成烟雾弹模型就可以...
回复

使用道具 举报

 楼主| 发表于 2009-3-31 18:54:42 | 显示全部楼层 来自 中国–广东–中山
我是过了该成烟雾弹模型,不行,还是该了手雷模型
回复

使用道具 举报

发表于 2009-3-31 19:30:17 | 显示全部楼层 来自 中国–广东–深圳

new DEFAULT_W_HE_MDL[]   = "models/w_hegrenade.mdl"

改成
new DEFAULT_W_HE_MDL[]   = "models/w_smokegrenade.mdl"
回复

使用道具 举报

 楼主| 发表于 2009-3-31 19:56:21 | 显示全部楼层 来自 中国–广东–中山
谢谢Cr@zyTreE
回复

使用道具 举报

发表于 2009-3-31 23:19:17 | 显示全部楼层 来自 中国–山东–淄博
又学了一招!!!!
回复

使用道具 举报

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

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