minor changes for moltard

This commit is contained in:
jenzur 2019-08-04 15:56:53 +02:00
parent 452f6516aa
commit cc2ca64ad5

View File

@ -116,7 +116,7 @@ public void startTimer()
public Action Timer_CountdownRace(Handle timer, any data) public Action Timer_CountdownRace(Handle timer, any data)
{ {
g_fRoundSeconds += 0.1; g_fRoundSeconds += 0.1;
if (g_fRoundSeconds >= 60.0) if (g_fRoundSeconds > 59.9)
{ {
g_iRoundMinutes += 1; g_iRoundMinutes += 1;
g_fRoundSeconds = 0.0; 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]) 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; int frameCap = 11;
if (g_iClientFrames[client] >= frameCap) 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); SetHudTextParams(0.35, 0.85, 0.1, 125, 255, 255, 85);
int l_iCalculateMins = CalculateValuesMinutes(client); int l_iCalculateMins = CalculateValuesMinutes(client);
float l_fCalculateSecs = CalculateValues(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, if (l_fCalculateSecs < 10.0)
l_fCalculateSecs, g_iRecordMinutes[client][g_iClientStage[client]], g_fRecordSeconds[client][g_iClientStage[client]], {
g_cMapname, g_iClientStage[client]); 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]++; g_iClientSpeedInterval[client]++;
@ -272,7 +297,7 @@ public bool checkClientOrigin(float oldVals[3], float newVals[3], int client)
{ {
return false; return false;
} }
float teleport_range = 50000.0; float teleport_range = 100000.0;
int velocityCap = 525; int velocityCap = 525;
float distance = GetVectorDistance(oldVals, newVals, true); float distance = GetVectorDistance(oldVals, newVals, true);
//PrintToChatAll("distance: %f", distance); //PrintToChatAll("distance: %f", distance);
@ -377,7 +402,16 @@ public void FinishedStageRaceZone(int client)
int l_iCalculateMins; int l_iCalculateMins;
float l_fCalculateSecs; float l_fCalculateSecs;
if (g_iRecordMinutes[client][g_iClientStage[client]] > 0 || g_fRecordSeconds[client][g_iClientStage[client]] > 0.0) 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 else
{ {
if (l_iZoneCount < 2) if (l_iZoneCount < 2)
@ -448,7 +482,7 @@ public float CalculateValues(int client)
float l_fSecAdd; float l_fSecAdd;
if (l_fRoundSeconds < l_fRoundSecondsIndividual) if (l_fRoundSeconds < l_fRoundSecondsIndividual)
{ {
while (l_fRoundSecondsIndividual < 60) while (l_fRoundSecondsIndividual < 59.9)
{ {
l_fRoundSecondsIndividual++; l_fRoundSecondsIndividual++;
l_fSecAdd++; l_fSecAdd++;