mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-16 03:37:18 +00:00
add !ihate!main
This commit is contained in:
parent
b893486972
commit
1954583070
@ -129,6 +129,7 @@ float gF_Fraction[MAXPLAYERS + 1];
|
||||
// cookies
|
||||
Handle gH_StyleCookie = null;
|
||||
Handle gH_AutoBhopCookie = null;
|
||||
Cookie gH_IHateMain = null;
|
||||
|
||||
// late load
|
||||
bool gB_Late = false;
|
||||
@ -352,6 +353,8 @@ public void OnPluginStart()
|
||||
RegConsoleCmd("sm_restart", Command_StartTimer, "Start your timer.");
|
||||
RegConsoleCmd("sm_m", Command_StartTimer, "Start your timer on the main track.");
|
||||
RegConsoleCmd("sm_main", Command_StartTimer, "Start your timer on the main track.");
|
||||
RegConsoleCmd("sm_ihate!main", Command_IHateMain, "If you really hate !main :(((");
|
||||
gH_IHateMain = new Cookie("shavit_mainhater", "If you really hate !main :(((", CookieAccess_Protected);
|
||||
|
||||
RegConsoleCmd("sm_b", Command_StartTimer, "Start your timer on the bonus track.");
|
||||
RegConsoleCmd("sm_bonus", Command_StartTimer, "Start your timer on the bonus track.");
|
||||
@ -732,7 +735,7 @@ public Action Command_StartTimer(int client, int args)
|
||||
}
|
||||
else if(StrContains(sCommand, "sm_r", false) == 0 || StrContains(sCommand, "sm_s", false) == 0)
|
||||
{
|
||||
track = gA_Timers[client].iTrack;
|
||||
track = (DoIHateMain(client)) ? Track_Main : gA_Timers[client].iTrack;
|
||||
|
||||
Action result = Plugin_Continue;
|
||||
Call_StartForward(gH_Forwards_OnRestartPre);
|
||||
@ -763,7 +766,6 @@ public Action Command_StartTimer(int client, int args)
|
||||
StartTimer(client, track);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
char sTrack[32];
|
||||
@ -775,6 +777,27 @@ public Action Command_StartTimer(int client, int args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
bool DoIHateMain(int client)
|
||||
{
|
||||
char data[2];
|
||||
gH_IHateMain.Get(client, data, sizeof(data));
|
||||
return (data[0] == '1');
|
||||
}
|
||||
|
||||
public Action Command_IHateMain(int client, int args)
|
||||
{
|
||||
if (!IsValidClient(client))
|
||||
{
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
bool bIHateMain = DoIHateMain(client);
|
||||
gH_IHateMain.Set(client, (bIHateMain) ? "0" : "1");
|
||||
Shavit_PrintToChat(client, (bIHateMain) ? ":)" : ":(");
|
||||
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
public Action Command_TeleportEnd(int client, int args)
|
||||
{
|
||||
if(!IsValidClient(client))
|
||||
@ -1322,9 +1345,9 @@ void CallOnTrackChanged(int client, int oldtrack, int newtrack)
|
||||
Call_PushCell(newtrack);
|
||||
Call_Finish();
|
||||
|
||||
if (oldtrack == Track_Main && oldtrack != newtrack)
|
||||
if (oldtrack == Track_Main && oldtrack != newtrack && !DoIHateMain(client))
|
||||
{
|
||||
Shavit_PrintToChat(client, "%T", "TrackChangeFromMain", client, gS_ChatStrings.sVariable, gS_ChatStrings.sText, gS_ChatStrings.sVariable, gS_ChatStrings.sText);
|
||||
Shavit_PrintToChat(client, "%T", "TrackChangeFromMain", client, gS_ChatStrings.sVariable, gS_ChatStrings.sText, gS_ChatStrings.sVariable, gS_ChatStrings.sText, gS_ChatStrings.sVariable, gS_ChatStrings.sText);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -143,7 +143,7 @@
|
||||
}
|
||||
"TrackChangeFromMain"
|
||||
{
|
||||
"#format" "{1:s},{2:s},{3:s},{4:s}"
|
||||
"en" "Use {1}!m{2}/{3}!main{4} go to back to the main track."
|
||||
"#format" "{1:s},{2:s},{3:s},{4:s},{5:s},{6:s}"
|
||||
"en" "Use {1}!m{2}/{3}!main{4} go to back to the main track. Or {5}!ihate!main{6}."
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user