AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   PlaySound (https://forums.alliedmods.net/showthread.php?t=167967)

RuRuRu612754 09-22-2011 13:16

PlaySound
 
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")
}

.Dare Devil. 09-22-2011 13:22

Re: PlaySound
 
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")



RuRuRu612754 09-22-2011 13:49

Re: PlaySound
 
.DareDevil.
Thanks !!!!!

modernwarfare 09-22-2011 17:00

Re: PlaySound
 
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")

JoKeR LauGh 09-22-2011 22:07

Re: PlaySound
 
Quote:

Originally Posted by modernwarfare (Post 1561044)
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")

...

RuRuRu612754 09-23-2011 01:42

Re: PlaySound
 
Thanks to all respondents !

ConnorMcLeod 09-23-2011 01:58

Re: PlaySound
 
Quote:

Originally Posted by modernwarfare (Post 1561044)
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...

modernwarfare 09-23-2011 03:22

Re: PlaySound
 
Quote:

Originally Posted by ConnorMcLeod (Post 1561258)
Won't work in all cases.

Example set_user_health, set_user_rendering, cs_set_user_money etc...


oh yes thx for that :)


All times are GMT -4. The time now is 19:40.

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