Code:
public CBaseEntity_EmitSound(this, iChannel, const szSample[], Float:flVol, Float:flAttn, bitsFlags, iPitch)
{
if (!is_user_connected(this))
return FMRES_IGNORED;
if (!equali(szSample[8], "knife_", 6))
return FMRES_IGNORED;
new iKnifeId = g_rgiKnife[this][KNIFE_CURRENT];
if (g_rgKnives[iKnifeId][KNIFE_SOUND] == -1)
return FMRES_IGNORED;
new iSoundId, szSound[64];
if (equali(szSample[14], "deploy", 6))
iSoundId = SND_KNIFE_DEPLOY;
else if (equali(szSample[14], "deploy1", 7))
iSoundId = SND_KNIFE_DEPLOY1;
else if (equali(szSample[14], "hit1", 4))
iSoundId = SND_KNIFE_HIT1;
else if (equali(szSample[14], "hit2", 4))
iSoundId = SND_KNIFE_HIT2;
else if (equali(szSample[14], "hit3", 4))
iSoundId = SND_KNIFE_HIT3;
else if (equali(szSample[14], "hit4", 4))
iSoundId = SND_KNIFE_HIT4;
else if (equali(szSample[14], "hitwall1", 8))
iSoundId = SND_KNIFE_WALL1;
else if (equali(szSample[14], "hitwall2", 8))
iSoundId = SND_KNIFE_WALL2;
else if (equali(szSample[14], "slash1", 6))
iSoundId = SND_KNIFE_SLASH1;
else if (equali(szSample[14], "slash2", 6))
iSoundId = SND_KNIFE_SLASH2;
else if (equali(szSample[14], "stab", 4))
iSoundId = SND_KNIFE_STAB;
formatex(szSound, charsmax(szSound), "weapons/%s.wav", g_szKnivesSounds[g_rgKnives[iKnifeId][KNIFE_SOUND]][iSoundId])
emit_sound(this, iChannel, szSound, flVol, flAttn, bitsFlags, iPitch);
return FMRES_SUPERCEDE;
}