SpecialSettingsSunday -> SpecialSettings for admins
This commit is contained in:
parent
5e523fdab7
commit
b00d9d76d5
@ -10,9 +10,9 @@
|
|||||||
|
|
||||||
public Plugin myinfo =
|
public Plugin myinfo =
|
||||||
{
|
{
|
||||||
name = "SpecialSettingsSunday",
|
name = "SpecialSettings",
|
||||||
author = "Neon",
|
author = "Neon",
|
||||||
description = "Special Settings Sunday",
|
description = "Special Settings",
|
||||||
version = "1.0",
|
version = "1.0",
|
||||||
url = "https://steamcommunity.com/id/n3ontm"
|
url = "https://steamcommunity.com/id/n3ontm"
|
||||||
}
|
}
|
||||||
@ -40,7 +40,8 @@ public APLRes AskPluginLoad2(Handle hThis, bool bLoadedLate, char[] error, int e
|
|||||||
|
|
||||||
public void OnPluginStart()
|
public void OnPluginStart()
|
||||||
{
|
{
|
||||||
RegAdminCmd("sm_force_settings_vote", Command_ForceVote, ADMFLAG_ROOT);
|
RegAdminCmd("sm_special_settings", Command_ForceVote, ADMFLAG_VOTE);
|
||||||
|
RegAdminCmd("sm_ss", Command_ForceVote, ADMFLAG_VOTE);
|
||||||
RegConsoleCmd("sm_currentsettings", Command_CurrentSettings, "Shows the Mode being played currently");
|
RegConsoleCmd("sm_currentsettings", Command_CurrentSettings, "Shows the Mode being played currently");
|
||||||
|
|
||||||
g_cvHlxBonus = FindConVar("hlx_difficulty_humans");
|
g_cvHlxBonus = FindConVar("hlx_difficulty_humans");
|
||||||
@ -108,7 +109,7 @@ public void OnClientPutInServer(int client)
|
|||||||
Format(sBuffer, sizeof(sBuffer), "Current Settings: %s", g_sCurrentSettings);
|
Format(sBuffer, sizeof(sBuffer), "Current Settings: %s", g_sCurrentSettings);
|
||||||
|
|
||||||
Panel hNotifyPanel = new Panel(GetMenuStyleHandle(MenuStyle_Radio));
|
Panel hNotifyPanel = new Panel(GetMenuStyleHandle(MenuStyle_Radio));
|
||||||
hNotifyPanel.SetTitle("*** It's Special Settings Sunday! ***");
|
hNotifyPanel.SetTitle("*** Special Settings have been enabled for this map! Check them below. ***");
|
||||||
hNotifyPanel.DrawItem("", ITEMDRAW_SPACER);
|
hNotifyPanel.DrawItem("", ITEMDRAW_SPACER);
|
||||||
hNotifyPanel.DrawItem(sBuffer, ITEMDRAW_RAWLINE);
|
hNotifyPanel.DrawItem(sBuffer, ITEMDRAW_RAWLINE);
|
||||||
hNotifyPanel.DrawItem("", ITEMDRAW_SPACER);
|
hNotifyPanel.DrawItem("", ITEMDRAW_SPACER);
|
||||||
@ -210,11 +211,11 @@ public Action Command_CurrentSettings(int client, int args)
|
|||||||
}
|
}
|
||||||
else if ((!g_bVoteFinished) && CheckConditions())
|
else if ((!g_bVoteFinished) && CheckConditions())
|
||||||
{
|
{
|
||||||
CPrintToChat(client, "{green}[Special Settings Sunday] {white}Awaiting Vote.");
|
CPrintToChat(client, "{green}[Special Settings] {white}Awaiting Vote.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CPrintToChat(client, "{green}[Special Settings Sunday] {white}is currently not active!");
|
CPrintToChat(client, "{green}[Special Settings] {white}is currently not active!");
|
||||||
}
|
}
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
@ -269,7 +270,7 @@ public bool CheckConditions()
|
|||||||
public Action StartVote(Handle timer)
|
public Action StartVote(Handle timer)
|
||||||
{
|
{
|
||||||
static int iCountDown = 5;
|
static int iCountDown = 5;
|
||||||
PrintCenterTextAll("[Special Settings Sunday] Starting Vote in %ds", iCountDown);
|
PrintCenterTextAll("[Special Settings] Starting Vote in %ds", iCountDown);
|
||||||
|
|
||||||
if (iCountDown-- <= 0)
|
if (iCountDown-- <= 0)
|
||||||
{
|
{
|
||||||
@ -285,7 +286,7 @@ public void InitiateVote()
|
|||||||
{
|
{
|
||||||
if(IsVoteInProgress())
|
if(IsVoteInProgress())
|
||||||
{
|
{
|
||||||
CPrintToChatAll("{green}[Special Settings Sunday] {white}Another vote is currently in progress, retrying again in 5s.");
|
CPrintToChatAll("{green}[Special Settings] {white}Another vote is currently in progress, retrying again in 5s.");
|
||||||
CreateTimer(1.0, StartVote, INVALID_HANDLE, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
|
CreateTimer(1.0, StartVote, INVALID_HANDLE, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -336,7 +337,7 @@ public void Handler_SettingsVoteFinished(Handle menu, int num_votes, int num_cli
|
|||||||
|
|
||||||
if ((highest_votes < required_votes) && (!g_bIsRevote))
|
if ((highest_votes < required_votes) && (!g_bIsRevote))
|
||||||
{
|
{
|
||||||
CPrintToChatAll("{green}[Special Settings Sunday] {white}A revote is needed!");
|
CPrintToChatAll("{green}[Special Settings] {white}A revote is needed!");
|
||||||
char sFirst[128];
|
char sFirst[128];
|
||||||
char sSecond[128];
|
char sSecond[128];
|
||||||
GetMenuItem(menu, item_info[0][VOTEINFO_ITEM_INDEX], sFirst, sizeof(sFirst));
|
GetMenuItem(menu, item_info[0][VOTEINFO_ITEM_INDEX], sFirst, sizeof(sFirst));
|
||||||
@ -361,7 +362,7 @@ public void Handler_VoteFinishedGeneric(Handle menu, int num_votes, int num_clie
|
|||||||
GetMenuItem(menu, item_info[0][VOTEINFO_ITEM_INDEX], sWinner, sizeof(sWinner));
|
GetMenuItem(menu, item_info[0][VOTEINFO_ITEM_INDEX], sWinner, sizeof(sWinner));
|
||||||
float fPercentage = float(item_info[0][VOTEINFO_ITEM_VOTES] * 100) / float(num_votes);
|
float fPercentage = float(item_info[0][VOTEINFO_ITEM_VOTES] * 100) / float(num_votes);
|
||||||
|
|
||||||
CPrintToChatAll("{green}[Special Settings Sunday] {white}Vote Finished! Winner: {red}%s{white} with %d%% of %d votes!", sWinner, RoundToFloor(fPercentage), num_votes);
|
CPrintToChatAll("{green}[Special Settings] {white}Vote Finished! Winner: {red}%s{white} with %d%% of %d votes!", sWinner, RoundToFloor(fPercentage), num_votes);
|
||||||
|
|
||||||
bool bNeedRestart = false;
|
bool bNeedRestart = false;
|
||||||
if (strcmp(sWinner, "Sonaki") == 0)
|
if (strcmp(sWinner, "Sonaki") == 0)
|
||||||
@ -384,10 +385,11 @@ public void Handler_VoteFinishedGeneric(Handle menu, int num_votes, int num_clie
|
|||||||
ServerCommand("exec plaguefest");
|
ServerCommand("exec plaguefest");
|
||||||
bNeedRestart = true;
|
bNeedRestart = true;
|
||||||
}
|
}
|
||||||
/* else if ((strcmp(sWinner, "GFLClan [default]") == 0) && (strcmp(g_sCurrentSettings, "") != 0))
|
else if ((strcmp(sWinner, "GFLClan [default]") == 0) && (strcmp(g_sCurrentSettings, "") != 0))
|
||||||
{
|
{
|
||||||
ServerCommand("exec gfl");
|
ServerCommand("exec gfl");
|
||||||
}*/
|
bNeedRestart = true;
|
||||||
|
}
|
||||||
|
|
||||||
float fDelay = 3.0;
|
float fDelay = 3.0;
|
||||||
if (bNeedRestart)
|
if (bNeedRestart)
|
Loading…
Reference in New Issue
Block a user