Raised This Month: $ Target: $400
 0% 

Play sound problem help please.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bilalpro
BANNED
Join Date: Jan 2011
Old 09-24-2011 , 06:37   Play sound problem help please.
Reply With Quote #1

PHP Code:
public plugin_precache()
{
 
precache_sound("misc/bonusxp.wav");
 
}
 
public 
EventDeathMsg()
{
 new 
killer read_data(1);
 new 
victim read_data(2);
 
 if( (
g_first_client <= killer <= g_max_clients) && victim != killer )
 {
  if( 
IsUserAuthorized(killer) )
  {
   
// regular kill
   
new xp get_pcvar_num(cvar_xp_kill);
   
   
   
g_xp[killer] += xp;
   
set_hudmessage(255255255, -1.0, -0.706.04.0);
   
show_hudmessage(killer"+100"MESSAGE_TAGxp);
   
emit_sound(killer"misc/bonusxp.wav");
   
   
Save(killer);
  }
 }
 else if( 
IsUserAuthorized(victim) )
 {
  
// victim died of map causes or killed self
  
new xp get_pcvar_num(cvar_xp_suicide);
  
  
g_xp[victim] -= xp;
  
  
ColorChat(victimGREY"^x04%s^x03 You lost^x04 %i XP^x03 for suicide!"MESSAGE_TAGxp);
  
  
Save(victim);
 }

This is not the full code because the plugin is private, i need help with playing the sound it wont play the error is: argument mismatch 2
bilalpro is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 09-24-2011 , 07:00   Re: Play sound problem help please.
Reply With Quote #2

PHP Code:
emit_sound(killerCHAN_STATIC"misc/bonusxp.wav"VOL_NORMATTN_NORM0PITCH_NORM); 
.Dare Devil. is offline
bilalpro
BANNED
Join Date: Jan 2011
Old 09-24-2011 , 07:19   Re: Play sound problem help please.
Reply With Quote #3

Compiled good, but still doesnt play the sound :S
bilalpro is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 09-24-2011 , 07:30   Re: Play sound problem help please.
Reply With Quote #4

Quote:
Originally Posted by bilalpro View Post
Compiled good, but still doesnt play the sound :S
Mayby sound dont have a correct format.

wav must be a 176 bit rate.

test it, write in your consoole
PHP Code:
spk misc/bonusxp.wav 
or
PHP Code:
spk sound/misc/bonusxp.wav 
if it play then say it
.Dare Devil. is offline
bilalpro
BANNED
Join Date: Jan 2011
Old 09-24-2011 , 07:40   Re: Play sound problem help please.
Reply With Quote #5

it plays, it is 176 bit rate but theres something wrong in the code i dont know what but i hope u got the solution.
bilalpro is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 09-24-2011 , 07:51   Re: Play sound problem help please.
Reply With Quote #6

Try to use this in your code :

PHP Code:
client_cmd(killer"spk misc/bonusxp.wav"
.Dare Devil. is offline
bilalpro
BANNED
Join Date: Jan 2011
Old 09-24-2011 , 07:53   Re: Play sound problem help please.
Reply With Quote #7

Quote:
Originally Posted by .Dare Devil. View Post
Try to use this in your code :

PHP Code:
client_cmd(killer"spk misc/bonusxp.wav"
as precache or emit_sound?
bilalpro is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 09-24-2011 , 07:54   Re: Play sound problem help please.
Reply With Quote #8

Quote:
Originally Posted by bilalpro View Post
as precache or emit_sound?
delete emit_sound and add my client_cmd spk here
.Dare Devil. is offline
bilalpro
BANNED
Join Date: Jan 2011
Old 09-24-2011 , 07:57   Re: Play sound problem help please.
Reply With Quote #9

i've added it still doesn't work i think theres something wrong because it doesnt even download the song on connect. ( i dont got it in my cstrike map either )
bilalpro is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 09-24-2011 , 08:03   Re: Play sound problem help please.
Reply With Quote #10

Quote:
Originally Posted by bilalpro View Post
i've added it still doesn't work i think theres something wrong because it doesnt even download the song on connect. ( i dont got it in my cstrike map either )
mayby file is not there in your server.
I mean that folder where this file must be
.Dare Devil. is offline
Reply



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 19:38.


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