batch remove trailing spaces and convert windows \r\n line endings to linux \n

i don't want to have to do this again, fix your shitty code editors @commiters !!!
This commit is contained in:
BotoX
2018-08-09 19:35:44 +02:00
parent ff970b8d5f
commit eefb23882b
30 changed files with 1992 additions and 1992 deletions
+32 -32
View File
@@ -12,7 +12,7 @@ Handle g_hCVar_PushStrength = INVALID_HANDLE;
Handle g_hCVar_PushScale = INVALID_HANDLE;
public Plugin myinfo =
public Plugin myinfo =
{
name = "PushNades",
author = "Neon",
@@ -22,37 +22,37 @@ public Plugin myinfo =
}
public void OnPluginStart()
{
{
g_hCVar_PushNadesEnabled = CreateConVar("sm_hegrenade_push_enabled", "0", "Enable PushBack for HE-Grenades", 0, true, 0.0, true, 1.0);
g_hCVar_PushScale = CreateConVar("sm_hegrenade_push_scale", "0", "Make the push scale with the distance to the explosion", 0, true, 0.0, true, 1.0);
g_hCVar_PushRange = CreateConVar("sm_hegrenade_push_range", "500", "Range arround Explosion in which Zombies are affected by the push.");
g_hCVar_PushStrength = CreateConVar("sm_hegrenade_push_strength", "2500", "How strong the HE-Grenade pushes back");
HookEvent("hegrenade_detonate", OnHEDetonate);
HookEvent("hegrenade_detonate", OnHEDetonate);
}
public void OnMapStart()
public void OnMapStart()
{
}
public Action OnHEDetonate(Event hEvent, const char[] sEvent, bool bDontBroadcast)
public Action OnHEDetonate(Event hEvent, const char[] sEvent, bool bDontBroadcast)
{
if (!GetConVarBool(g_hCVar_PushNadesEnabled))
return Plugin_Continue;
float fNadeOrigin[3];
fNadeOrigin[0] = hEvent.GetFloat("x");
fNadeOrigin[0] = hEvent.GetFloat("x");
fNadeOrigin[1] = hEvent.GetFloat("y");
fNadeOrigin[2] = hEvent.GetFloat("z");
int iOwner = GetClientOfUserId(hEvent.GetInt("userid"));
if (!IsValidClient(iOwner, false))
return Plugin_Continue;
return Plugin_Continue;
if (!IsPlayerAlive(iOwner) || !ZR_IsClientHuman(iOwner))
return Plugin_Continue;
for (int client = 1; client <= MaxClients; client++)
{
if (IsValidClient(client, false))
@@ -60,43 +60,43 @@ public Action OnHEDetonate(Event hEvent, const char[] sEvent, bool bDontBroadcas
if (IsPlayerAlive(client) && ZR_IsClientZombie(client))
{
float fZombieOrigin[3];
GetClientAbsOrigin(client, fZombieOrigin);
float fDistance = GetVectorDistance(fZombieOrigin, fNadeOrigin, false);
float fMaxRange = GetConVarFloat(g_hCVar_PushRange);
GetClientAbsOrigin(client, fZombieOrigin);
float fDistance = GetVectorDistance(fZombieOrigin, fNadeOrigin, false);
float fMaxRange = GetConVarFloat(g_hCVar_PushRange);
if (fDistance <= fMaxRange)
{
{
float fOwnerOrigin[3];
GetClientAbsOrigin(iOwner, fOwnerOrigin);
float fPushVector[3];
float fPushVector[3];
MakeVectorFromPoints(fOwnerOrigin, fZombieOrigin, fPushVector);
float fCurrentVector[3];
float fCurrentVector[3];
//GetEntPropVector(iOwner, Prop_Data, "m_vecVelocity", fCurrentVector);
float fPushStrength = GetConVarFloat(g_hCVar_PushStrength);
float fDistanceScalingFactor = 1.0;
float fDistanceScalingFactor = 1.0;
if (GetConVarBool(g_hCVar_PushScale))
fDistanceScalingFactor = 1.0 - ((1.0/fMaxRange) * fDistance);
NormalizeVector(fPushVector, fPushVector);
fPushVector[0] *= fPushStrength * fDistanceScalingFactor;
fPushVector[1] *= fPushStrength * fDistanceScalingFactor;
fPushVector[0] *= fPushStrength * fDistanceScalingFactor;
fPushVector[1] *= fPushStrength * fDistanceScalingFactor;
fPushVector[2] *= fPushStrength * fDistanceScalingFactor;
fPushVector[0] += fCurrentVector[0];
fPushVector[1] += fCurrentVector[1];
fPushVector[2] += fCurrentVector[2];
fPushVector[2] += fCurrentVector[2];
TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, fPushVector);
}
}
}
}
return Plugin_Continue;
}