Changed hardcoded antistick force into a CVAR.
This commit is contained in:
parent
018e283679
commit
72cb683278
@ -1,3 +1,6 @@
|
||||
2009.01.16 - 2.5.1.22
|
||||
* Changed hardcoded antistick force into a CVAR.
|
||||
|
||||
2009.01.14 - 2.5.1.21
|
||||
* Fixed spectactor admins not able to teleport players to their custom location.
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#undef REQUIRE_PLUGIN
|
||||
#include <market>
|
||||
|
||||
#define VERSION "2.5.1.21"
|
||||
#define VERSION "2.5.1.22"
|
||||
|
||||
#include "zr/zombiereloaded"
|
||||
#include "zr/global"
|
||||
|
@ -80,7 +80,8 @@ enum ZRSettings
|
||||
Handle:CVAR_INFECT_SHAKE,
|
||||
Handle:CVAR_INFECT_SHAKE_AMP,
|
||||
Handle:CVAR_INFECT_SHAKE_FREQUENCY,
|
||||
Handle:CVAR_INFECT_SHAKE_DURATION
|
||||
Handle:CVAR_INFECT_SHAKE_DURATION,
|
||||
Handle:CVAR_INFECT_ANTISTICK_FORCE
|
||||
}
|
||||
|
||||
new gCvars[ZRSettings];
|
||||
@ -160,6 +161,7 @@ CreateCvars()
|
||||
gCvars[CVAR_INFECT_SHAKE_AMP] = CreateConVar("zr_infect_shake_amp", "15.0", "Amplitude of the shake, when zr_infect_shake is 1");
|
||||
gCvars[CVAR_INFECT_SHAKE_FREQUENCY] = CreateConVar("zr_infect_shake_frequency", "1.0", "Frequency of the shake, when zr_infect_shake is 1");
|
||||
gCvars[CVAR_INFECT_SHAKE_DURATION] = CreateConVar("zr_infect_shake_duration", "5.0", "Duration of the shake, when zr_infect_shake is 1");
|
||||
gCvars[CVAR_INFECT_ANTISTICK_FORCE] = CreateConVar("zr_infect_antistick_force", "-160.0", "Force to push away players from eachother on infection. Negative values push away, positive values pull. (0: Disable)");
|
||||
|
||||
HookConVarChange(gCvars[CVAR_ENABLE], EnableHook);
|
||||
|
||||
|
@ -657,6 +657,12 @@ AntiStick(attacker, client)
|
||||
return;
|
||||
}
|
||||
|
||||
new Float:force = GetConVarFloat(gCvars[CVAR_INFECT_ANTISTICK_FORCE]);
|
||||
if (force == 0.0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
new Float:vector[3];
|
||||
|
||||
new Float:attackerloc[3];
|
||||
@ -668,7 +674,7 @@ AntiStick(attacker, client)
|
||||
MakeVectorFromPoints(attackerloc, clientloc, vector);
|
||||
|
||||
NormalizeVector(vector, vector);
|
||||
ScaleVector(vector, -160.0);
|
||||
ScaleVector(vector, force);
|
||||
|
||||
TeleportEntity(attacker, NULL_VECTOR, NULL_VECTOR, vector);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user