minor changes

This commit is contained in:
jenzur 2019-07-24 00:43:06 +02:00
parent 7439a6b7eb
commit 741afc5d3e

View File

@ -31,6 +31,7 @@ int g_iClientStage[MAXPLAYERS + 1];
int g_iClientChecking[MAXPLAYERS + 1];
bool g_bDisplaySpecial;
bool g_bHumansAllowedTime[MAXPLAYERS + 1];
bool g_bHideTimer[MAXPLAYERS + 1];
Database g_dDatabase;
Handle hText;
public Plugin myinfo =
@ -50,6 +51,7 @@ public void OnPluginStart()
RegConsoleCmd("sm_toptime", cmd_timerCheckTop, "checking top 10");
RegConsoleCmd("sm_mytime", cmd_timerCheckSelf, "checking your personal time");
RegConsoleCmd("sm_stages", cmd_timerCheckStage, "Checking race stages");
RegConsoleCmd("sm_hidetimer", cmd_hideTimerHUD, "Hides timer HUD");
//hooks
HookEvent("round_start", Event_RoundStart, EventHookMode_PostNoCopy);
//HUD
@ -130,6 +132,7 @@ public void OnClientPostAdminCheck(int client)
resetClient(client);
MYSQLCheckRecord(client);
g_bHumansAllowedTime[client] = false;
g_bHideTimer[client] = false;
}
//----------------------------------------------------------------------------------------------------
// Purpose:
@ -149,6 +152,7 @@ public void resetClient(int client)
g_iClientStage[client] = 0;
g_bHumansAllowedTime[client] = false;
resetClientVectors(client);
g_bHideTimer[client] = false;
for (int iterator = 0; iterator < 100; iterator++)
{
g_iRecordMinutes[client][iterator] = 0;
@ -210,9 +214,9 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
}
g_fClientVectors[client] = clientVectors;
{
if (hText != INVALID_HANDLE)
if (hText != INVALID_HANDLE && !g_bHideTimer[client])
{
SetHudTextParams(0.35, 0.7, 0.1, 125, 255, 255, 85);
SetHudTextParams(0.35, 0.85, 0.1, 125, 255, 255, 85);
int l_iCalculateMins = CalculateValuesMinutes(client);
float l_fCalculateSecs = CalculateValues(client);
ShowSyncHudText(client, hText, "%N Time: 0%i:%.1f\nRecord: 0%i:%.1f\nMap: %s\nStage: %i", client, l_iCalculateMins,
@ -716,6 +720,17 @@ public int MenuHandler1(Menu menu, MenuAction action, int param1, int param2)
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public Action cmd_hideTimerHUD(int client, int args)
{
if (!g_bHideTimer[client])
{
g_bHideTimer[client] = true;
PrintToChat(client, "Disabled timer HUD");
} else { g_bHideTimer[client] = false; PrintToChat(client, "Enabled timer HUD"); }
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public Action cmd_timerCheckStage(int client, int args)
{
CheckStagesOnMap(client, 0);