I am using two different "knife" models in Freemanmod. Crowbar for the Gordons and the pipewrench for the Shephards. So obviously I need two different sounds too. So this is how I am doing it:
Code:
public fw_emitsound(id,channel,sample[],Float:volume,Float:attenuation,fFlags,pitch) {
if (cs_get_user_team(id) == CS_TEAM_T) {
if(equal(sample,"weapons/knife_slash1.wav")) {
emit_sound(id,channel,"cbar_miss1.wav",volume,attenuation,fFlags,pitch);
return FMRES_SUPERCEDE;
}
}
else if (cs_get_user_team(id)== CS_TEAM_CT) {
if(equal(sample,"weapons/knife_slash1.wav")) {
emit_sound(id,channel,"pwrench_miss2.wav",volume,attenuation,fFlags,pitch);
return FMRES_SUPERCEDE;
}
}
return FMRES_IGNORED;
}
So anyhows the plugin for this part works exactly how I want it to work (I tested it with Potti). When the Gordon hits a wall with his crowbar, I hear the crowbar sound and when the Shephard hits the wall with his pipewrench, I hear the pipewrench sound. Still, my console gets filled with "native error" on the line with "cs_get_user_team" and it also says "player out of range."
Any suggestions how to fix this / do it differently?
__________________