Raised This Month: $ Target: $400
 0% 

Start and Endround Music


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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