v8.3.0a
FIXED THE MUSIC SYSTEM FINALLY AFTER THE 7TH REWRITE. THANK YOU SO MUCH, @arieshi255 !!! + Made music system CONSIDERABLY more accurate, and virtually immune to server lag as we now base ticks off the game engine's real time clock in seconds, with an accuracy of up to 100ns. + Changed ChangeBGM function to accept a true or false, determining whether to stop the music and change it on the fly, or wait for the current song to finish. + Disabled debug info (getting real world time) from going into global chat. + Optimised music system's loop code to skip over index 0 (console) as the server console should never receive sound commands anyways.
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.ticksBGM / 66.6666666666);
|
||||
int tPos = RoundToFloor(AudioManager.refireBGM / 66.6666666666);
|
||||
int sPos = RoundToFloor(AudioManager.engineSecondsAdjusted() - AudioManager.timeSeconds);
|
||||
int tPos = RoundToFloor(AudioManager.loopSeconds);
|
||||
Format(buffer, 16, "%02d:%02d", sPos / 60, sPos % 60);
|
||||
Format(tbuffer, 16, "%02d:%02d", tPos / 60, tPos % 60);
|
||||
CPrintToChat(client, "The current song is: {limegreen}%s {orange}(%s / %s)", AudioManager.songName, buffer, tbuffer);
|
||||
CPrintToChat(client, "The current song (%i) is: {limegreen}%s {orange}(%s / %s)", AudioManager.indexBGM, AudioManager.songName, buffer, tbuffer);
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user