AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Roundsound (or mp3 play issue) (https://forums.alliedmods.net/showthread.php?t=241383)

Maverick69 06-02-2014 15:48

Roundsound (or mp3 play issue)
 
I need to add a round sound plugin to server. I've modyfied a simple plugin, but something is not right. After about 15-20 minutes there is no more music :(. Time is measured for single player, not since server restart (round lasts 10 minutes). After that time any player can't even play music from its own console (when you type "mp3 play sound/misc/*.mp3" - nothing happens). When you restart cs everything is back to normal, only for 15-20 minutes :). Plugin gives no errors and works correctly for every player that joins the server.

Code:

#include <amxmodx>

new  const sounds[][] =  {"sound/misc/201406/1.mp3","sound/misc/201406/2.mp3","sound/misc/201406/3.mp3","sound/misc/201406/4.mp3","sound/misc/201406/5.mp3","sound/misc/201406/6.mp3","sound/misc/201406/7.mp3","sound/misc/201406/8.mp3","sound/misc/201406/9.mp3","sound/misc/201406/10.mp3"}
new z
public plugin_init()
{
  z=random_num(0,9)
  register_plugin("RoundSoundy","1","Sal")
  register_event("SendAudio", "sound", "a", "2&%!MRAD_ctwin")
  register_event("SendAudio", "sound", "a", "2&%!MRAD_terwin")
  register_event("SendAudio", "sound", "a", "2&%!MRAD_rounddraw")
}

public plugin_precache()
{
  new i
  for(i = 0; i < sizeof sounds; i++)
  precache_generic(sounds[i])
}

public sound()
{
  client_cmd(0, "mp3 play %s", sounds[z] )
  if (z>=9)
  {
  z=0
  }
  else
  {
  z=z+1
  }
}

Any idea why it happens?

PS Thanks to Sal for oryginal plugin.


All times are GMT -4. The time now is 09:43.

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