Nextmap command (basetriggers.sp) will now show 'Pending Vote' if mapchooser is running, and the vote has not yet occured.

Few cvar description changes in rockthevote.sp

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402423
This commit is contained in:
Matt Woodrow 2008-07-17 07:47:11 +00:00
parent 9292e0f816
commit dad66c9204
4 changed files with 74 additions and 9 deletions

View File

@ -35,6 +35,10 @@
#include <sourcemod>
#undef REQUIRE_PLUGIN
#include <mapchooser>
#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);
}
}
}

View File

@ -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
};
};
public __pl_mapchooser_SetNTVOptional()
{
MarkNativeAsOptional("NominateMap");
MarkNativeAsOptional("GetExcludeMapList");
MarkNativeAsOptional("CanMapChooserStartVote");
MarkNativeAsOptional("InitiateMapChooserVote");
MarkNativeAsOptional("HasEndOfMapVoteFinished");
}

View File

@ -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);

View File

@ -77,4 +77,9 @@
"#format" "{1:s}"
"en" "Next Map: {1}"
}
"Pending Vote"
{
"en" "Pending Vote"
}
}