Raised This Month: $ Target: $400
 0% 

PlaySound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 09-22-2011 , 13:16   PlaySound
Reply With Quote #1

create a plug-in to play a sound to all players happen to be running the server after say / play

After you do yourself say / play is the sound will play, other players will not play

What do I do?

Quote:
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
register_plugin("PlaySound", "1.0", "PlaySound")
register_clcmd("say /play", "PlaySound")
}

public plugin_precache()
{
precache_sound("misc/sound.wav")
}

public PlaySound(id)
{
client_cmd(id, "speak misc/sound.wav")
}

Last edited by RuRuRu612754; 09-22-2011 at 13:28.
RuRuRu612754 is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 09-22-2011 , 13:22   Re: PlaySound
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
register_plugin("PlaySound""1.0""PlaySound")
register_clcmd("say /play""PlaySound");
}

public 
plugin_precache()
{
precache_sound("misc/sound.wav")
}

public 
PlaySound(id)
{
client_cmd(0"speak misc/sound.wav")

.Dare Devil. is offline
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 09-22-2011 , 13:49   Re: PlaySound
Reply With Quote #3

.DareDevil.
Thanks !!!!!
RuRuRu612754 is offline
modernwarfare
Senior Member
Join Date: Aug 2011
Location: sweden
Old 09-22-2011 , 17:00   Re: PlaySound
Reply With Quote #4

every time you need a thing to everybody like msg or something change id to 0

Code:
client_cmd(id, "speak misc/sound.wav")
to

Code:
client_cmd(0, "speak misc/sound.wav")
__________________
Im supporting/coding XP Mod Plugin
Free Palestine
R.I.P. The 2967 American people that lost their lives 9/11 and R.I.P.
The 48,644 Afghan and 1,690,903 Iraqi people that paid the ultimate price for a crime they did not commit.



modernwarfare is offline
Send a message via MSN to modernwarfare Send a message via Skype™ to modernwarfare
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 09-22-2011 , 22:07   Re: PlaySound
Reply With Quote #5

Quote:
Originally Posted by modernwarfare View Post
every time you need a thing to everybody like msg or something change id to 0

Code:
client_cmd(id, "speak misc/sound.wav")
to

Code:
client_cmd(0, "speak misc/sound.wav")
...
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 09-23-2011 , 01:42   Re: PlaySound
Reply With Quote #6

Thanks to all respondents !
RuRuRu612754 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-23-2011 , 01:58   Re: PlaySound
Reply With Quote #7

Quote:
Originally Posted by modernwarfare View Post
every time you need a thing to everybody like msg or something change id to 0
Won't work in all cases.

Example set_user_health, set_user_rendering, cs_set_user_money etc...
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
modernwarfare
Senior Member
Join Date: Aug 2011
Location: sweden
Old 09-23-2011 , 03:22   Re: PlaySound
Reply With Quote #8

Quote:
Originally Posted by ConnorMcLeod View Post
Won't work in all cases.

Example set_user_health, set_user_rendering, cs_set_user_money etc...

oh yes thx for that
__________________
Im supporting/coding XP Mod Plugin
Free Palestine
R.I.P. The 2967 American people that lost their lives 9/11 and R.I.P.
The 48,644 Afghan and 1,690,903 Iraqi people that paid the ultimate price for a crime they did not commit.



modernwarfare is offline
Send a message via MSN to modernwarfare Send a message via Skype™ to modernwarfare
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:40.


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