既然是用森千之手的插件…就直接用那程式的結果說明…
假設你做了一個新的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")
}