Raised This Month: $ Target: $400
 0% 

emit_sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yan1255
Senior Member
Join Date: Jul 2011
Old 11-06-2015 , 21:17   emit_sound
Reply With Quote #1

I am trying to emit a sound from a player and I just can't seem to be making it work..
I have no Idea why... so I was wondering if someone could help me fix my code or make me a new one where this will work...
I have attached the .wav file and the .mp3 file (the .mp3 file is the originals I just converted the file to wav via some website)

This is my code
Code:
#include < amxmodx >

public plugin_init()
{
	register_plugin( "Plugin", "1.0", "Rejack" );
	
	register_clcmd( "say /emit", "cmdEmit" );
}

public plugin_precache()
{
	precache_sound( "slash_hit_emit.wav" );
}

public cmdEmit( const client )
{
	emit_sound( client, CHAN_AUTO, "slash_hit_emit.wav", 1.0, ATTN_NORM, 0, PITCH_NORM )
	
	client_print( client, print_chat, "emitted sound." );
}
Attached Files
File Type: zip sounds.zip (107.9 KB, 50 views)
__________________
yan1255 is offline
Chihuahuax
Senior Member
Join Date: Oct 2014
Location: Malaysia
Old 11-07-2015 , 00:48   Re: emit_sound
Reply With Quote #2

Quote:
Originally Posted by simanovich View Post
If it doesn't play in-game but plays normally outgame (like Windows Media Player), then the files are out of the engine's limit so the engine cann't read them.

For example, a MP3 file with 320 bit rate cann't be played in game because the engine doesn't support above 192 (I think) bit rate.
Click Me!
Chihuahuax is offline
Send a message via Skype™ to Chihuahuax
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 11-07-2015 , 07:12   Re: emit_sound
Reply With Quote #3

The problem is the code and your sound, try:

Code:
#include < amxmodx > public plugin_init() {     register_plugin( "Plugin", "1.0", "Rejack" );         register_clcmd( "say /emit", "cmdEmit" );     register_clcmd( "say_team /emit", "cmdEmit" ); } public plugin_precache() {     precache_sound( "slash_hit_emit.wav" ); } public cmdEmit( const client ) {     client_cmd( client, "spk sound/slash_hit_emit.wav" );         client_print( client, print_chat, "emitted sound." ); }
Attached Files
File Type: zip new sound.zip (10.1 KB, 44 views)
__________________








CrazY. is offline
yan1255
Senior Member
Join Date: Jul 2011
Old 11-07-2015 , 07:20   Re: emit_sound
Reply With Quote #4

Quote:
Originally Posted by Chihuahuax View Post
I knew there was a problem with the files themselves thank you for helping me!

Quote:
Originally Posted by CrazY. View Post
The problem is the code and your sound, try:

Code:
#include < amxmodx > public plugin_init() {     register_plugin( "Plugin", "1.0", "Rejack" );         register_clcmd( "say /emit", "cmdEmit" );     register_clcmd( "say_team /emit", "cmdEmit" ); } public plugin_precache() {     precache_sound( "slash_hit_emit.wav" ); } public cmdEmit( const client ) {     client_cmd( client, "spk sound/slash_hit_emit.wav" );         client_print( client, print_chat, "emitted sound." ); }
Actually I don't think client_cmd will do the trick here because I could have used it myself but the sound need to come from a certain player to those who are near him thats why I used emit_sound...
Totaly works now btw
__________________

Last edited by yan1255; 11-07-2015 at 07:21.
yan1255 is offline
Chihuahuax
Senior Member
Join Date: Oct 2014
Location: Malaysia
Old 11-07-2015 , 10:35   Re: emit_sound
Reply With Quote #5

Quote:
Originally Posted by CrazY. View Post
The problem is the code and your sound, try:

Code:
#include < amxmodx > public plugin_init() {     register_plugin( "Plugin", "1.0", "Rejack" );         register_clcmd( "say /emit", "cmdEmit" );     register_clcmd( "say_team /emit", "cmdEmit" ); } public plugin_precache() {     precache_sound( "slash_hit_emit.wav" ); } public cmdEmit( const client ) {     client_cmd( client, "spk sound/slash_hit_emit.wav" );         client_print( client, print_chat, "emitted sound." ); }
Valve has blocked client_cmd
Chihuahuax is offline
Send a message via Skype™ to Chihuahuax
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 11-07-2015 , 12:34   Re: emit_sound
Reply With Quote #6

Quote:
Originally Posted by yan1255
Actually I don't think client_cmd will do the trick here because I could have used it myself but the sound need to come from a certain player to those who are near him thats why I used emit_sound...
Totaly works now btw
Glad to know I helped

Quote:
Originally Posted by Chihuahuax
Valve has blocked client_cmd
I tested this method and worked without problems.
__________________








CrazY. is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 11-07-2015 , 12:42   Re: emit_sound
Reply With Quote #7

Quote:
Originally Posted by Chihuahuax View Post
Valve has blocked client_cmd
No they didn't.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd 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 18:45.


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