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:
parent
9292e0f816
commit
dad66c9204
@ -35,6 +35,10 @@
|
|||||||
|
|
||||||
#include <sourcemod>
|
#include <sourcemod>
|
||||||
|
|
||||||
|
#undef REQUIRE_PLUGIN
|
||||||
|
#include <mapchooser>
|
||||||
|
#define REQUIRE_PLUGIN
|
||||||
|
|
||||||
public Plugin:myinfo =
|
public Plugin:myinfo =
|
||||||
{
|
{
|
||||||
name = "Basic Info Triggers",
|
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_ALL_MAYBE 1 /* Print to all players if sm_trigger_show allows */
|
||||||
#define TIMELEFT_ONE 2 /* Print to a single player */
|
#define TIMELEFT_ONE 2 /* Print to a single player */
|
||||||
|
|
||||||
|
new bool:mapchooser;
|
||||||
|
|
||||||
public OnPluginStart()
|
public OnPluginStart()
|
||||||
{
|
{
|
||||||
LoadTranslations("common.phrases");
|
LoadTranslations("common.phrases");
|
||||||
@ -79,6 +85,24 @@ public OnPluginStart()
|
|||||||
g_Cvar_WinLimit = FindConVar("mp_winlimit");
|
g_Cvar_WinLimit = FindConVar("mp_winlimit");
|
||||||
g_Cvar_FragLimit = FindConVar("mp_fraglimit");
|
g_Cvar_FragLimit = FindConVar("mp_fraglimit");
|
||||||
g_Cvar_MaxRounds = FindConVar("mp_maxrounds");
|
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[])
|
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))
|
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
|
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;
|
return Plugin_Handled;
|
||||||
@ -215,11 +253,25 @@ public Action:Command_Say(client, args)
|
|||||||
|
|
||||||
if(GetConVarInt(g_Cvar_TriggerShow))
|
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
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,9 +55,8 @@ native bool:CanMapChooserStartVote();
|
|||||||
*/
|
*/
|
||||||
native InitiateMapChooserVote(MapChange:when, Handle:inputarray=INVALID_HANDLE);
|
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();
|
native bool:HasEndOfMapVoteFinished();
|
||||||
|
|
||||||
@ -77,4 +76,13 @@ public SharedPlugin:__pl_mapchooser =
|
|||||||
#else
|
#else
|
||||||
required = 0,
|
required = 0,
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public __pl_mapchooser_SetNTVOptional()
|
||||||
|
{
|
||||||
|
MarkNativeAsOptional("NominateMap");
|
||||||
|
MarkNativeAsOptional("GetExcludeMapList");
|
||||||
|
MarkNativeAsOptional("CanMapChooserStartVote");
|
||||||
|
MarkNativeAsOptional("InitiateMapChooserVote");
|
||||||
|
MarkNativeAsOptional("HasEndOfMapVoteFinished");
|
||||||
|
}
|
@ -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_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_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_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 after a failed RTV before another 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_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);
|
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);
|
||||||
|
|
||||||
|
@ -77,4 +77,9 @@
|
|||||||
"#format" "{1:s}"
|
"#format" "{1:s}"
|
||||||
"en" "Next Map: {1}"
|
"en" "Next Map: {1}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"Pending Vote"
|
||||||
|
{
|
||||||
|
"en" "Pending Vote"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user