哪个把下面代码中的手雷弹换成烟雾弹
本帖最后由 20576526 于 2009-3-31 08:55 编辑哪个高手把下面代码中的手雷弹换成烟雾弹代码,因为这个代码只能替换手雷,我不想替换手雷,想把烟雾弹给替换掉,不知道哪个高手解决这个问题?/* CocaCola HE */
/*
2006-12-12
替换雷 mdl 为可乐 mdl,替换碰撞声音,支持掉雷插件及 CZ
一点缺陷:拔罐声音无法替换
*/
/* 安装说明
复制 models 目录到 cstrike 目录下
复制 misc 目录到 cstrike/sound 目录下
*/
#define PLUGIN"CocaCola HE"
#define VERSION "0.1.16"
#define AUTHOR"iG_os"
#include <amxmodx>
#include <fakemeta>
// 替换雷的模型文件
new V_HE_MDL[] = "models/cocacola_he/v_cocacola_he.mdl"
new P_HE_MDL[] = "models/cocacola_he/p_cocacola_he.mdl"
new W_HE_MDL[] = "models/cocacola_he/w_cocacola_he.mdl"
// 替换雷碰撞声音的文件
new BOUNCE_WAV[]= "misc/cocacola_bounce.wav"
//拔罐声音不属于环境声音,暂时无法替换,需要的话,客户端手动替换即可
//new PINPULL_WAV[] = "misc/cocacola_pinpull.wav"
// 原始模型及声音文件参数,不能更改
new DEFAULT_BOUNCE_WAV[] = "weapons/he_bounce-1.wav"
new DEFAULT_W_HE_MDL[] = "models/w_hegrenade.mdl"
public plugin_precache()
{
precache_model(V_HE_MDL)
precache_model(P_HE_MDL)
precache_model(W_HE_MDL)
precache_sound(BOUNCE_WAV)
}
public plugin_init()
{
register_plugin(PLUGIN,VERSION,AUTHOR)
register_event("CurWeapon", "CurWeapon_even", "be", "1=1", "2=4")
register_forward(FM_SetModel, "forward_setmodel")
register_forward(FM_EmitSound, "forward_emitsound")
}
// 设置手持模型
public CurWeapon_even(id)
{
if (is_user_alive(id))
{
set_pev(id, pev_viewmodel2, V_HE_MDL)
set_pev(id, pev_weaponmodel2, P_HE_MDL)
}
}
// 替换 mdl
//L 12/12/2006 - 14:04:32: szMdl=models/w_hegrenade.mdl
public forward_setmodel(const entity, const szMdl[])
{
if (entity>32 && equal(szMdl, DEFAULT_W_HE_MDL))
{
engfunc(EngFunc_SetModel, entity, W_HE_MDL)
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}
// 替换 wav
//L 12/12/2006 - 14:11:04: szNoise=weapons/he_bounce-1.wav
public forward_emitsound(const entity, const channel, szNoise[], const Float:volume, const Float:attenuation, const fFlags, const pitch)
{
if (entity>32 && equal(szNoise, DEFAULT_BOUNCE_WAV))
{
emit_sound(entity,channel, BOUNCE_WAV, volume, attenuation, fFlags, pitch)
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}
不会弄,帮你顶了 把w_hegrenade.mdl改成烟雾弹模型就可以... 我是过了该成烟雾弹模型,不行,还是该了手雷模型 改
new DEFAULT_W_HE_MDL[] = "models/w_hegrenade.mdl"
改成
new DEFAULT_W_HE_MDL[] = "models/w_smokegrenade.mdl" 谢谢Cr@zyTreE 又学了一招!!!!
页:
[1]