|
@@ -12,7 +12,7 @@
|
|
#pragma newdecls required
|
|
#pragma newdecls required
|
|
#include <round_end_music>
|
|
#include <round_end_music>
|
|
|
|
|
|
-#define PLUGIN_VERSION "0.3.0"
|
|
+#define PLUGIN_VERSION "0.4.0"
|
|
public Plugin myinfo = {
|
|
public Plugin myinfo = {
|
|
name = "[CSRD] Round End Music",
|
|
name = "[CSRD] Round End Music",
|
|
author = "nosoop",
|
|
author = "nosoop",
|
|
@@ -24,7 +24,7 @@ public Plugin myinfo = {
|
|
bool g_bQueueLocked = false;
|
|
bool g_bQueueLocked = false;
|
|
ArrayList g_QueuedSongs, g_ActiveSongs, g_PlayedSongs;
|
|
ArrayList g_QueuedSongs, g_ActiveSongs, g_PlayedSongs;
|
|
|
|
|
|
-ConVar g_ConVarMaxActiveSongs, g_ConVarEnabled;
|
|
+ConVar g_ConVarMaxActiveSongs, g_ConVarEnabled, g_ConVarSongDelay;
|
|
|
|
|
|
Handle g_RequestSongForward;
|
|
Handle g_RequestSongForward;
|
|
|
|
|
|
@@ -54,6 +54,9 @@ public void OnPluginStart() {
|
|
true, 1.0, false);
|
|
true, 1.0, false);
|
|
g_ConVarEnabled = CreateConVar("sm_rem_enabled", "1", "Enables Round End Music.", _,
|
|
g_ConVarEnabled = CreateConVar("sm_rem_enabled", "1", "Enables Round End Music.", _,
|
|
true, 0.0, true, 1.0);
|
|
true, 0.0, true, 1.0);
|
|
|
|
+ g_ConVarSongDelay = CreateConVar("sm_rem_song_delay", "4.3",
|
|
|
|
+ "Amount of time after the round end to wait before playing the song.", _,
|
|
|
|
+ true, 0.0);
|
|
|
|
|
|
AutoExecConfig();
|
|
AutoExecConfig();
|
|
}
|
|
}
|
|
@@ -252,7 +255,10 @@ void FireOnREMPlayedPostEvent(MusicEntry song) {
|
|
}
|
|
}
|
|
|
|
|
|
public void OnRoundEnd(Event event, const char[] name, bool dontBroadcast) {
|
|
public void OnRoundEnd(Event event, const char[] name, bool dontBroadcast) {
|
|
- // TODO timer
|
|
+ CreateTimer(g_ConVarSongDelay.FloatValue, RoundEndMusicPlaybackDelay);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+public Action RoundEndMusicPlaybackDelay(Handle timer, any data) {
|
|
PlayRoundEndMusic();
|
|
PlayRoundEndMusic();
|
|
}
|
|
}
|
|
|
|
|