Raised This Month: $ Target: $400
 0% 

Another problem with emit_sound


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Pro Patria Finland
Senior Member
Join Date: Apr 2006
Location: BaronPub.com
Old 06-05-2007 , 14:47   Another problem with emit_sound
Reply With Quote #1

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?
__________________
I am not a number. I am Gordon Freeman!
Pro Patria Finland is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode