v.8.4.0 - full audiosystem rewrite again
8th time rewriting it... + Make audio manager be an array - one entry for each possible client. + Added global audio manager for setting everyone's music at once and ticking all audio managers that are set to tick. This does not apply to clients who are experiencing "an event". + Made audio managers check if their clients are valid - if not, stop the manager immediately. + Use g_indexBGM for setting global bgm indexes. + Automatically set and update music for each client that joins the server + Automatically set and update music for each client when the game mode changes + Made /song command immediately reflect the current playing song + Changed how instant stopping works, unnecessary but yknow, tests??? + Added a timer to delay music startup on plugin reload - Removed old timer system used for playing music to new clients in favor of event based system.
This commit is contained in:
@@ -111,11 +111,11 @@ public int MenuHandlerFartsysAss(Menu menu, MenuAction action, int client, int i
|
||||
public Action Command_GetCurrentSong(int client, int args) {
|
||||
char buffer[16];
|
||||
char tbuffer[16];
|
||||
int sPos = RoundToFloor(AudioManager.engineSecondsAdjusted() - AudioManager.timeSeconds);
|
||||
int tPos = RoundToFloor(AudioManager.loopSeconds);
|
||||
int sPos = RoundToFloor(AudioManager[client].engineSecondsAdjusted() - AudioManager[client].timeSeconds);
|
||||
int tPos = RoundToFloor(AudioManager[client].loopSeconds);
|
||||
Format(buffer, 16, "%02d:%02d", sPos / 60, sPos % 60);
|
||||
Format(tbuffer, 16, "%02d:%02d", tPos / 60, tPos % 60);
|
||||
CPrintToChat(client, "The current song (%i) is: {limegreen}%s {orange}(%s / %s)", AudioManager.indexBGM, AudioManager.songName, buffer, tbuffer);
|
||||
CPrintToChat(client, "The current song (%i) is: {limegreen}%s {orange}(%s / %s)", AudioManager[client].indexBGM, AudioManager[client].songName, buffer, tbuffer);
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user