AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D/Any?] Map (round) Start Music Player (infinite tracks) (https://forums.alliedmods.net/showthread.php?t=315145)

Dragokas 03-24-2019 14:26

[L4D/Any?] Map (round) Start Music Player (infinite tracks)
 
5 Attachment(s)
Description:
This plugin is intended to play one random music on each new map start (the same one music will be played on round re-start).
Only one song will be downloaded to client each map start, so it will reduce client connection delay.
In this way, you can install infinite number of music tracks on your server without sacrificing connection speed (compared to: if you would download all files at once).

Plugin will display menu to clients on each round start (can be disabled by "l4d_music_mapstart_showmenu" ConVar):
- greetings and congratulation lines (see translation file)
- 5. Stop music
- 6. Play music again
- 7. Settings

Settings menu:
- 1. Volume
- 2. Next track (in debug mode)
- 2. Don't show this menu on map start
- 3. Don't play music on next map
Commands:
sm_music - open music menu
sm_music <arg> - play specific music by id, where arg should be 0 .. to max or -1 to play next index (Use together with #DEBUG 1 mode only!)
sm_music_update - populate music list from config (use, if you replaced config file without server/plugin restart).
Settings (ConVars):
l4d_music_mapstart_enable - Enable plugin (1 - On / 0 - Off)
l4d_music_mapstart_delay (default - 17) - Delay (in sec.) between player join and playing the music
l4d_music_mapstart_showmenu - Show !music menu on round start? (1 - Yes, 0 - No)

Music preparation & Optimization & Installation & Testing
Spoiler


Known bugs:
- sometimes "PlayAgain" button is not working. You need to press it several times.
- some default game sounds interrupt music sound on map start, so you need to set large enough value for "l4d_music_mapstart_delay" ConVar (like > 10, by default == 17) (Walkaround is unknown)
TODO:

Add cookie for saving individual client's preferences for:
- Volume level
- Show this menu on start
- Play music on start
Credits:
- Lux - for some suggestions on sound channel
Donate
Donates are very appreciated and welcomed for further inspiration, make me happy, and make next updates came out more often:
- Patreon (Paypal)
- BitCoin
- Ю.Money

AirAndAir 03-29-2019 01:35

Re: [L4D/Any?] Round Start Music Player (infinite tracks)
 
//SourceMod Batch Compiler
// by the SourceMod Dev Team


//// l4d_MusicMapStart.sp
// C:\L4D2 Versus\left4dead2\addons\sourcemod\scripting\ l4d_MusicMapStart.sp(58 ) : warning 207: unknown #pragma
// C:\L4D2 Versus\left4dead2\addons\sourcemod\scripting\ l4d_MusicMapStart.sp(58 ) : error 038: extra characters on line
// C:\L4D2 Versus\left4dead2\addons\sourcemod\scripting\ l4d_MusicMapStart.sp(63) : error 001: expected token: ";", but found "-identifier-"
// C:\L4D2 Versus\left4dead2\addons\sourcemod\scripting\ l4d_MusicMapStart.sp(83) : error 010: invalid function or declaration
// C:\L4D2 Versus\left4dead2\addons\sourcemod\scripting\ l4d_MusicMapStart.sp(88 ) : error 010: invalid function or declaration
// C:\L4D2 Versus\left4dead2\addons\sourcemod\scripting\ l4d_MusicMapStart.sp(90) : error 010: invalid function or declaration
// C:\L4D2 Versus\left4dead2\addons\sourcemod\scripting\ l4d_MusicMapStart.sp(92) : error 010: invalid function or declaration
// C:\L4D2 Versus\left4dead2\addons\sourcemod\scripting\ l4d_MusicMapStart.sp(94) : error 010: invalid function or declaration
// C:\L4D2 Versus\left4dead2\addons\sourcemod\scripting\ l4d_MusicMapStart.sp(96) : error 010: invalid function or declaration
// C:\L4D2 Versus\left4dead2\addons\sourcemod\scripting\ l4d_MusicMapStart.sp(98 ) : error 010: invalid function or declaration
// C:\L4D2 Versus\left4dead2\addons\sourcemod\scripting\ l4d_MusicMapStart.sp(102) : error 010: invalid function or declaration
// C:\L4D2 Versus\left4dead2\addons\sourcemod\scripting\ l4d_MusicMapStart.sp(104) : error 001: expected token: ";", but found "-identifier-"
// C:\L4D2 Versus\left4dead2\addons\sourcemod\scripting\ l4d_MusicMapStart.sp(120) : error 021: symbol already defined: "void"
// C:\L4D2 Versus\left4dead2\addons\sourcemod\scripting\ l4d_MusicMapStart.sp(138 ) : error 017: undefined symbol "convar"
// C:\L4D2 Versus\left4dead2\addons\sourcemod\scripting\ l4d_MusicMapStart.sp(138 ) : error 029: invalid expression, assumed zero
// C:\L4D2 Versus\left4dead2\addons\sourcemod\scripting\ l4d_MusicMapStart.sp(138 ) : fatal error 127: too many error messages on one line
//
// Compilation aborted.
// 15 Errors.
//
// Compilation Time: 0.72 sec
// ----------------------------------------

Can U Fix it?Thx.

Dragokas 03-29-2019 02:02

Re: [L4D/Any?] Round Start Music Player (infinite tracks)
 
It is sourcemod problem, not mine.

Use: https://spider.limetech.io

HarryPotter 06-15-2019 06:19

Re: [L4D/Any?] Round Start Music Player (infinite tracks)
 
wow, it really works!!!!!!!!!!!!!!!!!!
wonderful, perfect and nice!!!!!!!!!!!!!!!!!!

I thought this would never be possible in left 4 dead 1
It makes server more fun
Thanks for your great work really :D

HarryPotter 06-15-2019 08:53

Re: [L4D/Any?] Round Start Music Player (infinite tracks)
 
I tested in left4dead, all fine
But when I tested in left4dead2, I found there are few different details.
1.rewrite create_list.bat
Spoiler

2.ConVars in your cfg/server.cfg should be:
-If you are l4d1
sm_cvar sv_allowdownload "1"
sm_cvar sv_downloadurl "http://your-content-server.com/game/left4dead/"
-If you are l4d2
sm_cvar sv_allowdownload "1"
sm_cvar sv_downloadurl "http://your-content-server.com/game/left4dead2"

3.client downloads two mp3 files once when joining the server
I believe l4d2 server calls OnMapStart() twice
so I modify below and it works
PHP Code:

public void OnPluginStart()
{
 .
 .
 .
 .
  if(
g_Engine == Engine_Left4Dead)
        
OnMapStart();



Dragokas 06-15-2019 15:10

Re: [L4D/Any?] Round Start Music Player (infinite tracks)
 
Thanks for fixes, I'll return to this plugin some time later.

zomexf 07-10-2019 05:02

Re: [L4D/Any?] Round Start Music Player (infinite tracks)
 
Quote:

Originally Posted by Dragokas (Post 2655623)
Thanks for fixes, I'll return to this plugin some time later.

Errors:
l4d_MusicMapStart.smx (Round start music): Error detected in plugin startup (see error logs)
[SM] Exception reported: Cannot open config file "addons\sourcemod\data\music_mapstart.txt "!
[SM] Blaming: l4d_MusicMapStart.smx

Dragokas 07-10-2019 13:53

Re: [L4D/Any?] Round Start Music Player (infinite tracks)
 
Quote:

[SM] Exception reported: Cannot open config file "addons\sourcemod\data\music_mapstart.txt "!
Error is clearly said you didn't put this file on the server at the specified place.

Dragokas 07-11-2019 12:39

Re: [L4D/Any?] Round Start Music Player (infinite tracks)
 
No, because:

Quote:

Preparation the list
Download and unpack archive from the 1st post.
Copy MP3 files to sound/valentine folder.
Run (double-click) sound/valentine/create_list.bat file.
music_mapstart.txt will be created automatically.

zomexf 07-11-2019 13:49

Re: [L4D/Any?] Round Start Music Player (infinite tracks)
 
Thank you for your help:)


All times are GMT -4. The time now is 00:05.

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