Raised This Month: $ Target: $400
 0% 

playing a wav


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SuperDuper
Member
Join Date: May 2006
Location: na
Old 05-24-2006 , 20:58   playing a wav
Reply With Quote #1

Is there a way to make a plugin so at the end of each round it plays a short wav.?
__________________
[Team.Profit] Profit' <LDR>. Our server owns!

CS:CZ or DIE
SuperDuper is offline
Send a message via AIM to SuperDuper Send a message via MSN to SuperDuper Send a message via Yahoo to SuperDuper
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-24-2006 , 21:17  
Reply With Quote #2

The first thing you want to do is register the event.

Code:
register_event("SendAudio", "fnRoundEnd","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")

Next, you want to precache the sound

Code:
new g_szSound[] = "sound.wav" public plugin_precache()        precache_sound(g_szSound)

Next, you want to play it on the event.

Code:
public fnRoundEnd()        client_cmd(0,"spk %s",g_szSound)

So you have something like this:

Code:
#include <amxmodx> #include <amxmisc> new g_szSound[] = "sound.wav" public plugin_init() {     register_plugin("Endround Sound","1.0","Hawk552")         register_event("SendAudio", "fnRoundEnd","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw") } public plugin_precache()     precache_sound(g_szSound) public fnRoundEnd()     client_cmd(0,"spk %s",g_szSound)
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
SuperDuper
Member
Join Date: May 2006
Location: na
Old 05-24-2006 , 21:33  
Reply With Quote #3

so what order would i put those commands in?

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #define PLUGIN "GoodGame" #define VERSION "1.0" #define AUTHOR "SuperDuper" public plugin_init() {     register_plugin("goodgame", "1.0", "SuperDuper")     register_concmd("amx_justin" , "goodgame" , ADMIN_LEVEL_A); } // The .wav file------------------------------------------------------       public plugin_precache() {     precache_sound("desktop/music/gg.wav") }

heh im getting better
__________________
[Team.Profit] Profit' <LDR>. Our server owns!

CS:CZ or DIE
SuperDuper is offline
Send a message via AIM to SuperDuper Send a message via MSN to SuperDuper Send a message via Yahoo to SuperDuper
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-24-2006 , 21:35  
Reply With Quote #4

I don't think it really matters...
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
SuperDuper
Member
Join Date: May 2006
Location: na
Old 05-24-2006 , 21:38  
Reply With Quote #5

so how does this look?

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #define PLUGIN "GoodGame" #define VERSION "1.0" #define AUTHOR "SuperDuper"     public plugin_init()     {     register_plugin("goodgame", "1.0", "SuperDuper")     register_concmd("amx_justin" , "goodgame" , ADMIN_LEVEL_A);     }     // The .wav file------------------------------------------------------           public plugin_precache()     {     precache_sound("desktop/music/gg.wav")     }     new g_szSound[] = "sound.wav"     public plugin_init()     {     register_plugin("Endround Sound","1.0","Hawk552")           register_event("SendAudio", "fnRoundEnd","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")     }         public plugin_precache()     precache_sound(g_szSound)     public fnRoundEnd()     client_cmd(0,"spk %s",g_szSound)         public plugin_precache()     {     precache_sound("desktop/music/gg.wav")     }
__________________
[Team.Profit] Profit' <LDR>. Our server owns!

CS:CZ or DIE
SuperDuper is offline
Send a message via AIM to SuperDuper Send a message via MSN to SuperDuper Send a message via Yahoo to SuperDuper
SuperDuper
Member
Join Date: May 2006
Location: na
Old 05-24-2006 , 21:41  
Reply With Quote #6

wait no more like this?

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #define PLUGIN "GoodGame" #define VERSION "1.0" #define AUTHOR "SuperDuper"     // The .wav file------------------------------------------------------           public plugin_precache()     {     precache_sound("desktop/music/gg.wav")     }     new g_szSound[] = "sound.wav"     public plugin_init()     {     register_plugin("Endround Sound","1.0","Hawk552")           register_event("SendAudio", "fnRoundEnd","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")     }         public plugin_precache()     precache_sound(g_szSound)     public fnRoundEnd()     client_cmd(0,"spk %s",g_szSound)         public plugin_precache()     {     precache_sound("desktop/music/gg.wav")     }
__________________
[Team.Profit] Profit' <LDR>. Our server owns!

CS:CZ or DIE
SuperDuper is offline
Send a message via AIM to SuperDuper Send a message via MSN to SuperDuper Send a message via Yahoo to SuperDuper
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-24-2006 , 21:47  
Reply With Quote #7

You have 2 precache_sound's, and you never use g_szSound to its full potential.

Please, if you ever want me to help you again, do not indent like that.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
allenwr
Veteran Member
Join Date: Jan 2006
Location: The place where the karm
Old 05-24-2006 , 21:51  
Reply With Quote #8

errgggg

You need to define it more i think
Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "New Plugin" #define VERSION "1.0" #define AUTHOR "Author" new g_szSound[] = "sound.wav" public fnRoundEnd() {     client_cmd(0,"spk %s",g_szSound) } public plugin_precache() {     precache_sound("misc/sound.wav")         return PLUGIN_CONTINUE } public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("SendAudio", "fnRoundEnd","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw") }

i think that works.
__________________
Don't ever place an order with Vee Servers. This is why.
allenwr is offline
Send a message via ICQ to allenwr Send a message via Yahoo to allenwr
SuperDuper
Member
Join Date: May 2006
Location: na
Old 05-24-2006 , 21:52  
Reply With Quote #9

Lol, sry bout the indenting, il stop doing that.

hows this then?

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #define PLUGIN "GoodGame" #define VERSION "1.0" #define AUTHOR "SuperDuper" // The .wav file------------------------------------------------------       public plugin_precache() { precache_sound("desktop/music/gg.wav") } new g_szSound[] = "sound.wav" public plugin_init() { register_plugin("Endround_GoodGame","1.0","SuperDuper")       register_event("SendAudio", "fnRoundEnd","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw") }     public fnRoundEnd() client_cmd(0,"spk %s",g_szSound)
__________________
[Team.Profit] Profit' <LDR>. Our server owns!

CS:CZ or DIE
SuperDuper is offline
Send a message via AIM to SuperDuper Send a message via MSN to SuperDuper Send a message via Yahoo to SuperDuper
allenwr
Veteran Member
Join Date: Jan 2006
Location: The place where the karm
Old 05-24-2006 , 21:52  
Reply With Quote #10

Quote:
Originally Posted by Hawk552
You have 2 precache_sound's, and you never use g_szSound to its full potential.

Please, if you ever want me to help you again, do not indent like that.
be nice, he is a coding newbie like me.
__________________
Don't ever place an order with Vee Servers. This is why.
allenwr is offline
Send a message via ICQ to allenwr Send a message via Yahoo to allenwr
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 16:30.


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