既然是用森千之手的插件…就直接用那程式的结果说明…
假设你做了一个新的AWP…在SMA里面找 fw_武器名称_PriAttack:
复制程式
public fw_awp_PriAttack(weapon)
{
if (!pev_valid(weapon))
return HAM_IGNORED;
static owner
owner = pev(weapon, pev_owner)
if (has_AWP[owner])
{
if (cs_get_weapon_ammo(weapon) > 0)
{
user_shoot[owner] = true
engfunc(EngFunc_EmitSound, owner, CHAN_AUTO, "weapons/awp1.wav", VOL_NORM, ATTN_NONE, 0, PITCH_NORM) // 插入这行
}
}
return HAM_IGNORED;
}
记得 precache 一下你要发出的武器声音:
复制程式
public plugin_precache()
{
precache_model(AWP_V_Model)
precache_model(AWP_P_Model)
precache_model(AWP_W_Model)
precache_sound("weapons/awp1.wav") // 插入这行
g_beamSpr = precache_model("sprites/zbeam4.spr")
}