Raised This Month: $ Target: $400
 0% 

Sounds Not Playing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Copper
Senior Member
Join Date: Feb 2012
Location: California
Old 04-21-2017 , 19:15   Sounds Not Playing
Reply With Quote #1

Code:
#include <amxmodx>

new T_Win[][] =
{
	"stealsounds/twin"
}

new I_Win[][] =
{
	"stealsounds/Iwin"
}

public plugin_init ( )
{
	register_plugin ( "New Steal C4", "1.0", "Copper" );
	register_event( "SendAudio", "eT_win" , "a", "2&%!MRAD_terwin" );
	register_event( "SendAudio", "eCT_win", "a", "2&%!MRAD_ctwin"  );
}

public eT_win(id)
{
	if(is_user_alive(id) && is_user_connected(id) )
	{
		client_cmd(0,"spk ^"%s^"",T_Win[random_num(0,sizeof T_Win - 1)])	
	}
}


public eCT_win(id)
{
	if(is_user_alive(id) && is_user_connected(id) )
	{				
		client_cmd(0,"spk ^"%s^"",I_Win[random_num(0,sizeof I_Win - 1)])		
	}
}

public plugin_precache( )
{
	precache_sound ( "stealsounds/Iwin.wav" );
	precache_sound ( "stealsounds/twin.wav" );
}
Can anyone tell me what I did wrong? I am editing the stealc4 plugin and I want to be able to play a sound after the round is over. I am not going to post the whole plugin because this is the only part that isn't working properly.

Last edited by Copper; 04-21-2017 at 20:22.
Copper is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-21-2017 , 20:12   Re: Sounds Not Playing
Reply With Quote #2

If you post the code, it would be possible.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Copper
Senior Member
Join Date: Feb 2012
Location: California
Old 04-21-2017 , 20:23   Re: Sounds Not Playing
Reply With Quote #3

Updated post.
Copper is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 04-21-2017 , 20:51   Re: Sounds Not Playing
Reply With Quote #4

1. Put .wav sufix at the constants

2.
Code:
public plugin_precache( ) {     precache_sound (T_Win);     precache_sound (I_Win); }

3.There's no ID at T_win and I_Win events, you must loop all players with get_players().
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 04-21-2017 at 20:51.
EFFx is offline
Copper
Senior Member
Join Date: Feb 2012
Location: California
Old 04-21-2017 , 20:59   Re: Sounds Not Playing
Reply With Quote #5

Quote:
Originally Posted by EFFx View Post
1. Put .wav sufix at the constants

2.
Code:
public plugin_precache( ) {     precache_sound (T_Win);     precache_sound (I_Win); }

3.There's no ID at T_win and I_Win events, you must loop all players with get_players().
For 1&2 Weird. I have different sounds playing for other parts of the plugin and I didn't add the .wav suffix and they are working just fine.
3. Oh crap, I forgot to add the id

Last edited by Copper; 04-21-2017 at 21:06.
Copper is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 04-22-2017 , 05:17   Re: Sounds Not Playing
Reply With Quote #6

Firstly, what isn't working? How can we know what's wrong if you just say 'what am I doing wrong' ? Why are you checking both is_user_alive and is_user_connected, is_user_alive already does the connected check.
__________________
edon1337 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 21:18.


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