diff --git a/plugins/basetriggers.sp b/plugins/basetriggers.sp index 8cac49fb..50a436fa 100644 --- a/plugins/basetriggers.sp +++ b/plugins/basetriggers.sp @@ -35,6 +35,10 @@ #include +#undef REQUIRE_PLUGIN +#include +#define REQUIRE_PLUGIN + public Plugin:myinfo = { name = "Basic Info Triggers", @@ -58,6 +62,8 @@ new Handle:g_Cvar_MaxRounds = INVALID_HANDLE; #define TIMELEFT_ALL_MAYBE 1 /* Print to all players if sm_trigger_show allows */ #define TIMELEFT_ONE 2 /* Print to a single player */ +new bool:mapchooser; + public OnPluginStart() { LoadTranslations("common.phrases"); @@ -79,6 +85,24 @@ public OnPluginStart() g_Cvar_WinLimit = FindConVar("mp_winlimit"); g_Cvar_FragLimit = FindConVar("mp_fraglimit"); g_Cvar_MaxRounds = FindConVar("mp_maxrounds"); + + mapchooser = LibraryExists("mapchooser"); +} + +public OnLibraryRemoved(const String:name[]) +{ + if (StrEqual(name, "mapchooser")) + { + mapchooser = false; + } +} + +public OnLibraryAdded(const String:name[]) +{ + if (StrEqual(name, "mapchooser")) + { + mapchooser = true; + } } public ConVarChange_TimeleftInterval(Handle:convar, const String:oldValue[], const String:newValue[]) @@ -124,11 +148,25 @@ public Action:Command_Nextmap(client, args) if(GetConVarInt(g_Cvar_TriggerShow)) { - PrintToChatAll("[SM] %t", "Next Map", map); + if (mapchooser && !HasEndOfMapVoteFinished()) + { + PrintToChatAll("[SM] %t", "Pending Vote"); + } + else + { + PrintToChatAll("[SM] %t", "Next Map", map); + } } else { - ReplyToCommand(client, "[SM] %t", "Next Map", map); + if (mapchooser && !HasEndOfMapVoteFinished()) + { + ReplyToCommand(client, "[SM] %t", "Pending Vote"); + } + else + { + ReplyToCommand(client, "[SM] %t", "Next Map", map); + } } return Plugin_Handled; @@ -215,11 +253,25 @@ public Action:Command_Say(client, args) if(GetConVarInt(g_Cvar_TriggerShow)) { - PrintToChatAll("[SM] %t", "Next Map", map); + if (mapchooser && !HasEndOfMapVoteFinished()) + { + PrintToChatAll("[SM] %t", "Pending Vote"); + } + else + { + PrintToChatAll("[SM] %t", "Next Map", map); + } } else { - PrintToChat(client, "[SM] %t", "Next Map", map); + if (mapchooser && !HasEndOfMapVoteFinished()) + { + PrintToChat(client, "[SM] %t", "Pending Vote"); + } + else + { + PrintToChat(client, "[SM] %t", "Next Map", map); + } } } diff --git a/plugins/include/mapchooser.inc b/plugins/include/mapchooser.inc index d1608b86..541f30c5 100644 --- a/plugins/include/mapchooser.inc +++ b/plugins/include/mapchooser.inc @@ -55,9 +55,8 @@ native bool:CanMapChooserStartVote(); */ native InitiateMapChooserVote(MapChange:when, Handle:inputarray=INVALID_HANDLE); - /** - * A horribly named native that checks if MapChooser's end of map vote has completed. + * Checks if MapChooser's end of map vote has completed. */ native bool:HasEndOfMapVoteFinished(); @@ -77,4 +76,13 @@ public SharedPlugin:__pl_mapchooser = #else required = 0, #endif -}; \ No newline at end of file +}; + +public __pl_mapchooser_SetNTVOptional() +{ + MarkNativeAsOptional("NominateMap"); + MarkNativeAsOptional("GetExcludeMapList"); + MarkNativeAsOptional("CanMapChooserStartVote"); + MarkNativeAsOptional("InitiateMapChooserVote"); + MarkNativeAsOptional("HasEndOfMapVoteFinished"); +} \ No newline at end of file diff --git a/plugins/rockthevote.sp b/plugins/rockthevote.sp index 9ca69668..7ed1cd96 100644 --- a/plugins/rockthevote.sp +++ b/plugins/rockthevote.sp @@ -69,8 +69,8 @@ public OnPluginStart() g_Cvar_Needed = CreateConVar("sm_rtv_needed", "0.60", "Percentage of players needed to rockthevote (Def 60%)", 0, true, 0.05, true, 1.0); g_Cvar_MinPlayers = CreateConVar("sm_rtv_minplayers", "0", "Number of players required before RTV will be enabled.", 0, true, 0.0, true, float(MAXPLAYERS)); - g_Cvar_InitialDelay = CreateConVar("sm_rtv_initialdelay", "30.0", "Time before first RTV can be held", 0, true, 0.00); - g_Cvar_Interval = CreateConVar("sm_rtv_interval", "240.0", "Time after a failed RTV before another can be held", 0, true, 0.00); + g_Cvar_InitialDelay = CreateConVar("sm_rtv_initialdelay", "30.0", "Time (in seconds) before first RTV can be held", 0, true, 0.00); + g_Cvar_Interval = CreateConVar("sm_rtv_interval", "240.0", "Time (in seconds) after a failed RTV before another can be held", 0, true, 0.00); g_Cvar_ChangeTime = CreateConVar("sm_rtv_changetime", "0", "When to change the map after a succesful RTV: 0 - Instant, 1 - RoundEnd, 2 - MapEnd", _, true, 0.0, true, 2.0); g_Cvar_RTVPostVoteAction = CreateConVar("sm_rtv_postvoteaction", "0", "What to do with RTV's after a mapvote has completed. 0 - Allow, success = instant change, 1 - Deny", _, true, 0.0, true, 1.0); diff --git a/translations/basetriggers.phrases.txt b/translations/basetriggers.phrases.txt index 05b3bf49..3dd38736 100644 --- a/translations/basetriggers.phrases.txt +++ b/translations/basetriggers.phrases.txt @@ -77,4 +77,9 @@ "#format" "{1:s}" "en" "Next Map: {1}" } + + "Pending Vote" + { + "en" "Pending Vote" + } }