AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Start and Endround Music (https://forums.alliedmods.net/showthread.php?t=28391)

CyberClaw 05-13-2006 19:26

Start and Endround Music
 
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
}


SubStream 05-14-2006 21:13

If you can use [ small ] tags it would be easier for the eyes to read.

c0rdawg 05-14-2006 21:18

speak(spk) can only do wav files, so no

VEN 05-15-2006 05:25

For spk command wav extension is optional.

CyberClaw 05-15-2006 10:07

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?

cccpsmiley 05-15-2006 12:15

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 05-15-2006 12:57

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

CyberClaw 05-15-2006 13:11

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

Bend3R 05-15-2006 13:20

mp3 play <folder>/<mp3 file name>

cccpsmiley 05-15-2006 13:25

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.


All times are GMT -4. The time now is 16:21.

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