From 8259bd316ac7816fbe857ae19aae79dab60feb69 Mon Sep 17 00:00:00 2001 From: Arron Vinyard Date: Fri, 8 May 2020 18:04:57 -0400 Subject: [PATCH] Alert players of map history console output (#1242) --- plugins/nextmap.sp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/plugins/nextmap.sp b/plugins/nextmap.sp index 99da4069f6..29fd674c40 100644 --- a/plugins/nextmap.sp +++ b/plugins/nextmap.sp @@ -164,12 +164,16 @@ void FindAndSetNextMap() } if (g_MapPos == -1) + { g_MapPos = 0; + } } g_MapPos++; if (g_MapPos >= mapCount) - g_MapPos = 0; + { + g_MapPos = 0; + } g_MapList.GetString(g_MapPos, mapName, sizeof(mapName)); SetNextMap(mapName); @@ -204,6 +208,11 @@ public Action Command_MapHistory(int client, int args) lastMapStartTime = startTime; } + + if (client && GetCmdReplySource() == SM_REPLY_TO_CHAT) + { + PrintToChat(client, "[SM] %t", "See console for output"); + } return Plugin_Handled; } @@ -219,16 +228,16 @@ int FormatTimeDuration(char[] buffer, int maxlen, int time) { return Format(buffer, maxlen, "%id %ih %im", days, hours, (seconds >= 30) ? minutes+1 : minutes); } - else if (hours > 0) + + if (hours > 0) { return Format(buffer, maxlen, "%ih %im", hours, (seconds >= 30) ? minutes+1 : minutes); } - else if (minutes > 0) + + if (minutes > 0) { return Format(buffer, maxlen, "%im", (seconds >= 30) ? minutes+1 : minutes); } - else - { - return Format(buffer, maxlen, "%is", seconds); - } + + return Format(buffer, maxlen, "%is", seconds); }