minor updates for the eventnotifier to run on ze again and minor adjustment for racetimer to detect teleport abuse
This commit is contained in:
@@ -172,7 +172,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
|
||||
g_iClientFrames[client] = 0;
|
||||
float clientVectors[3];
|
||||
GetClientAbsOrigin(client, clientVectors);
|
||||
if (checkClientOrigin(g_fClientVectors[client], clientVectors, client, vel))
|
||||
if (checkClientOrigin(g_fClientVectors[client], clientVectors, client))
|
||||
{
|
||||
g_bHumansAllowedTime[client] = false;
|
||||
resetClientVectors(client);
|
||||
@@ -204,7 +204,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
|
||||
float gravityFloat = gravity.FloatValue;
|
||||
int minimalPermitedGravity = 610;
|
||||
//PrintToChat(client, "client_gravity: %f\ngravityFloat: %f", client_gravity, gravityFloat);
|
||||
if ((client_gravity > 1.3 || client_gravity < 0.8000) || gravityFloat < minimalPermitedGravity)
|
||||
if (((client_gravity > 1.3 || client_gravity < 0.8000) && client_gravity != 0.000000) || gravityFloat < minimalPermitedGravity)
|
||||
{
|
||||
g_bHumansAllowedTime[client] = false;
|
||||
resetClientVectors(client);
|
||||
@@ -219,7 +219,7 @@ 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\nStage: %i", client, l_iCalculateMins,
|
||||
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]);
|
||||
}
|
||||
@@ -242,25 +242,27 @@ public void resetClientVectors(int client)
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public bool checkClientOrigin(float oldVals[3], float newVals[3], int client, float vel[3])
|
||||
public bool checkClientOrigin(float oldVals[3], float newVals[3], int client)
|
||||
{
|
||||
float zero = 0.000000;
|
||||
int velocityCap = 600;
|
||||
if ((oldVals[0] == zero && oldVals[1] == zero && oldVals[2] == zero) || (newVals[0] == zero && newVals[1] == zero && newVals[2] == zero))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
float teleport_range = 50000.0;
|
||||
int velocityCap = 525;
|
||||
float distance = GetVectorDistance(oldVals, newVals, true);
|
||||
//PrintToChatAll("distance: %f", distance);
|
||||
bool bInAir = (GetEntPropEnt(client, Prop_Send, "m_hGroundEntity") == -1);
|
||||
if (distance > teleport_range)
|
||||
{
|
||||
//PrintToChat(client, "distance: %f", distance);
|
||||
//PrintToChat(client, "vel[0] %f \nvel[1] %f \nvel[2] %f", vel[0], vel[1], vel[2]);
|
||||
{
|
||||
if (StrContains(g_cMapname, "surf", false) != -1)
|
||||
return false;
|
||||
if ((vel[0] > velocityCap || vel[1] > velocityCap || vel[2] > velocityCap) && bInAir)
|
||||
float fVelocity[3];
|
||||
GetEntPropVector(client, Prop_Data, "m_vecVelocity", fVelocity);
|
||||
float currentspeed = SquareRoot(Pow(fVelocity[0],2.0)+Pow(fVelocity[1],2.0));
|
||||
//PrintToChat(client, "currentspeed: %f", currentspeed);
|
||||
if (bInAir && currentspeed > velocityCap)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -300,7 +302,7 @@ public void unloze_zoneLeave(int client, char[] zone)
|
||||
float notRounded = float(RetrieveZoneIndex(zone));
|
||||
g_iClientStage[client] = RoundToCeil(notRounded / 2);
|
||||
g_bHumansAllowedTime[client] = true;
|
||||
CPrintToChat(client, "Timer started for stage: %i", g_iClientStage[client]);
|
||||
CPrintToChat(client, "Timer started for Course: %i", g_iClientStage[client]);
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user