Raised This Month: $ Target: $400
 0% 

Start and Endround Music


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CyberClaw
Junior Member
Join Date: May 2006
Old 05-13-2006 , 19:26   Start and Endround Music
Reply With Quote #1

Hi!
I´ve tried to write a plugin which plays at the end and beginning of each round a short music.

Can some tell me if this should work and can i also use mp3 files to play?

Code:
#include <amxmodx>

public plugin_init() 
{ 
  register_plugin("RoundMusic","0.1","CyberClaw")
  register_event("SendAudio","roundstart","a","2=%!MRAD_GO","2=%!MRAD_MOVEOUT","2=%!MRAD_LETSGO","2=%!MRAD_LOCKNLOAD")
  register_event("SendAudio", "roundend","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
  
}

public roundstart()
{
  new rand = random_num(0,2)

  client_cmd(0,"stopsound")

  switch(rand)
  {
    case 0: client_cmd(0,"spk misc/music1")
    case 1: client_cmd(0,"spk misc/music2")
    case 2: client_cmd(0,"spk misc/music3")
  }

  return PLUGIN_CONTINUE
}

public roundend()
{
  new rand = random_num(0,2)

  client_cmd(0,"stopsound")

  switch(rand)
  {
    case 0: client_cmd(0,"spk misc/music")
    case 1: client_cmd(0,"spk misc/music2")
    case 2: client_cmd(0,"spk misc/music3")
  }

  return PLUGIN_CONTINUE
}

public plugin_precache() 
{
  precache_sound("misc/music2.wav")
  precache_sound("misc/music3.wav")
  precache_sound("misc/music4.wav")
  precache_sound("misc/music.wav")
  precache_sound("misc/music2.wav")
  precache_sound("misc/music3.wav")

  return PLUGIN_CONTINUE
}
CyberClaw is offline
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 05-14-2006 , 21:13  
Reply With Quote #2

If you can use [ small ] tags it would be easier for the eyes to read.
SubStream is offline
c0rdawg
Senior Member
Join Date: Jan 2006
Old 05-14-2006 , 21:18  
Reply With Quote #3

speak(spk) can only do wav files, so no
c0rdawg is offline
Send a message via AIM to c0rdawg Send a message via MSN to c0rdawg
VEN
Veteran Member
Join Date: Jan 2005
Old 05-15-2006 , 05:25  
Reply With Quote #4

For spk command wav extension is optional.
VEN is offline
CyberClaw
Junior Member
Join Date: May 2006
Old 05-15-2006 , 10:07  
Reply With Quote #5

ok i´ve tried ist but it wont work.

isn´t there somewhere a simple plugin which plays mp3s on the start and end of each round without downloading them to the clients/players?
CyberClaw is offline
cccpsmiley
Senior Member
Join Date: Mar 2006
Location: Los Angeles, CA
Old 05-15-2006 , 12:15  
Reply With Quote #6

um not sure if u guys are aware of this but u dont need a plugin for what CyberClaw is trying to do. Just simply go through the enteties of the certain map u wanna change the end round song of with BSPEdit and alternate tho files.

Cheers!
cccpsmiley is offline
Send a message via AIM to cccpsmiley
cccpsmiley
Senior Member
Join Date: Mar 2006
Location: Los Angeles, CA
Old 05-15-2006 , 12:57  
Reply With Quote #7

also i found this

http://forums.alliedmods.net/showthread.php?t=6784 for end round

u might be able to edit it to add the beggining sound
cccpsmiley is offline
Send a message via AIM to cccpsmiley
CyberClaw
Junior Member
Join Date: May 2006
Old 05-15-2006 , 13:11  
Reply With Quote #8

Ok looks nice but!

how can i now play mp3s without downloading the sounds?

i´ve seen something like "mp3 play" but how does it work and where have the files to be stored?

greeds
cyberclaw
CyberClaw is offline
Bend3R
Veteran Member
Join Date: Oct 2004
Location: Sweden (Stockholm)
Old 05-15-2006 , 13:20  
Reply With Quote #9

mp3 play <folder>/<mp3 file name>
Bend3R is offline
cccpsmiley
Senior Member
Join Date: Mar 2006
Location: Los Angeles, CA
Old 05-15-2006 , 13:25  
Reply With Quote #10

um i was never able to do that where ppl dont have to dl it, but if u have a host for dls then u dont have to worry about it taking a long time.
cccpsmiley is offline
Send a message via AIM to cccpsmiley
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:21.


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