From cc2ca64ad59c3acd8954c356170c4b9e6a6a3ba4 Mon Sep 17 00:00:00 2001 From: jenzur Date: Sun, 4 Aug 2019 15:56:53 +0200 Subject: [PATCH] minor changes for moltard --- RaceTimer/scripting/unloze_racetimer_redux.sp | 50 ++++++++++++++++--- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/RaceTimer/scripting/unloze_racetimer_redux.sp b/RaceTimer/scripting/unloze_racetimer_redux.sp index 7dba4a89..5ffda523 100644 --- a/RaceTimer/scripting/unloze_racetimer_redux.sp +++ b/RaceTimer/scripting/unloze_racetimer_redux.sp @@ -116,7 +116,7 @@ public void startTimer() public Action Timer_CountdownRace(Handle timer, any data) { g_fRoundSeconds += 0.1; - if (g_fRoundSeconds >= 60.0) + if (g_fRoundSeconds > 59.9) { g_iRoundMinutes += 1; g_fRoundSeconds = 0.0; @@ -187,7 +187,7 @@ public void resetClient(int client) //---------------------------------------------------------------------------------------------------- public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2]) { - if (g_bHumansAllowedTime[client] && (GetClientTeam(client) == CS_TEAM_CT)) + if (g_bHumansAllowedTime[client] && (GetClientTeam(client) == CS_TEAM_CT) && IsPlayerAlive(client)) { int frameCap = 11; if (g_iClientFrames[client] >= frameCap) @@ -242,9 +242,34 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 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\nCourse: %i", client, l_iCalculateMins, - l_fCalculateSecs, g_iRecordMinutes[client][g_iClientStage[client]], g_fRecordSeconds[client][g_iClientStage[client]], - g_cMapname, g_iClientStage[client]); + if (l_fCalculateSecs < 10.0) + { + if (g_fRecordSeconds[client][g_iClientStage[client]] < 10.0) + { + ShowSyncHudText(client, hText, "%N Time: 0%i:0%.1f\nRecord: 0%i:0%.1f\nMap: %s\nCourse: %i", client, l_iCalculateMins, + l_fCalculateSecs, g_iRecordMinutes[client][g_iClientStage[client]], g_fRecordSeconds[client][g_iClientStage[client]], + g_cMapname, g_iClientStage[client]); + } else + { + ShowSyncHudText(client, hText, "%N Time: 0%i:0%.1f\nRecord: 0%i:%.1f\nMap: %s\nCourse: %i", client, l_iCalculateMins, + l_fCalculateSecs, g_iRecordMinutes[client][g_iClientStage[client]], g_fRecordSeconds[client][g_iClientStage[client]], + g_cMapname, g_iClientStage[client]); + } + } + else + { + if (g_fRecordSeconds[client][g_iClientStage[client]] < 10.0) + { + ShowSyncHudText(client, hText, "%N Time: 0%i:%.1f\nRecord: 0%i:0%.1f\nMap: %s\nCourse: %i", client, l_iCalculateMins, + l_fCalculateSecs, g_iRecordMinutes[client][g_iClientStage[client]], g_fRecordSeconds[client][g_iClientStage[client]], + g_cMapname, g_iClientStage[client]); + } else + { + ShowSyncHudText(client, hText, "%N Time: 0%i:%.1f\nRecord: %i:%.1f\nMap: %s\nCourse: %i", client, l_iCalculateMins, + l_fCalculateSecs, g_iRecordMinutes[client][g_iClientStage[client]], g_fRecordSeconds[client][g_iClientStage[client]], + g_cMapname, g_iClientStage[client]); + } + } } } g_iClientSpeedInterval[client]++; @@ -272,7 +297,7 @@ public bool checkClientOrigin(float oldVals[3], float newVals[3], int client) { return false; } - float teleport_range = 50000.0; + float teleport_range = 100000.0; int velocityCap = 525; float distance = GetVectorDistance(oldVals, newVals, true); //PrintToChatAll("distance: %f", distance); @@ -377,7 +402,16 @@ public void FinishedStageRaceZone(int client) int l_iCalculateMins; float l_fCalculateSecs; if (g_iRecordMinutes[client][g_iClientStage[client]] > 0 || g_fRecordSeconds[client][g_iClientStage[client]] > 0.0) - CPrintToChat(client, "Your record: 0%i:%.1f \nCommand: !toptime !mytime !stages", g_iRecordMinutes[client][g_iClientStage[client]], g_fRecordSeconds[client][g_iClientStage[client]]); + if (g_fRecordSeconds[client][g_iClientStage[client]] < 10.0) + { + CPrintToChat(client, "Your record: 0%i:0%.1f \nCommand: !toptime !mytime !stages", g_iRecordMinutes[client][g_iClientStage[client]], + g_fRecordSeconds[client][g_iClientStage[client]]); + } else + { + CPrintToChat(client, "Your record: 0%i:%.1f \nCommand: !toptime !mytime !stages", g_iRecordMinutes[client][g_iClientStage[client]], + g_fRecordSeconds[client][g_iClientStage[client]]); + } + else { if (l_iZoneCount < 2) @@ -448,7 +482,7 @@ public float CalculateValues(int client) float l_fSecAdd; if (l_fRoundSeconds < l_fRoundSecondsIndividual) { - while (l_fRoundSecondsIndividual < 60) + while (l_fRoundSecondsIndividual < 59.9) { l_fRoundSecondsIndividual++; l_fSecAdd++;