Skip to content

Commit

Permalink
Fast movement log
Browse files Browse the repository at this point in the history
  • Loading branch information
Gigatek1 committed Jan 14, 2017
1 parent 04aadf0 commit f7c0d1b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
34 changes: 34 additions & 0 deletions client/init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,37 @@ inGameUISetEventHandler ["Action", "_this call A3W_fnc_inGameUIActionEvent"];
_x setVariable ["groupOnly", true, true];
};
} forEach pvar_spawn_beacons;

// Fast movement log
if (["A3W_fastMovementLog"] call isConfigOn) then
{
0 spawn
{
private ["_distCheck", "_loopTime", "_newPos", "_oldPos", "_spawnPos"];
_distCheck = ["A3W_fastMovementLogDist", 1000] call getPublicVar;
_loopTime = ["A3W_fastMovementLoopTime", 1] call getPublicVar;
_oldPos = nil;
_spawnPos = getMarkerPos "respawn_guerrila";

while {true} do
{
_newPos = getPosATL player;

if (!isNil "_oldPos" && {_newPos distance2D _oldPos > _distCheck}) then
{
if (_spawnPos distance2D _newPos > 50 && !(player getVariable ["playerSpawning", true])) then
{
publicVariableServer format["FML|Name:%1|Vehicle:%2", name player, typeof vehicle player];
publicVariableServer format["FML|Speed:%1|OldPos:%2", round speed vehicle player, _oldPos];
publicVariableServer format["FML|NewPos:%1", _newPos];
};
};

_oldPos = _newPos;

if (player getVariable ["playerSpawning", true]) then {_oldPos = nil};

uiSleep _loopTime;
};
};
};
3 changes: 3 additions & 0 deletions server/default_config.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ A3W_maxSpawnBeacons = 2; // Maxmimum number of spawn beacons (0 = dis
// Antihack settings
A3W_antiHackUnitCheck = 1; // Detect players who spawn unauthorized AI units (0 = no, 1 = yes) - disable if you have custom unit scripts/mods like AI recruitment or ALiVE
A3W_antiHackMinRecoil = 1.0; // Mininum recoil coefficient enforced by the antihack (recommended values: default = 1.0, TMR Mod = 0.5, VTS Weapon Resting = 0.25) (minimum: 0.02)
A3W_fastMovementLog = 1; // Enable fast movement check (0 = no, 1 = yes)
A3W_fastMovementLogDist = 1000; // Number of meters in loop before logged
A3W_fastMovementLoopTime = 1; // Number of seconds before loop check

// Store settings
A3W_showGunStoreStatus = 1; // Show enemy and friendly presence at gunstores on map (0 = no, 1 = yes)
Expand Down
7 changes: 5 additions & 2 deletions server/init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ if (isServer) then
"A3W_maxMoney",
"A3W_healthTime",
"A3W_hungerTime",
"A3W_thirstTime"
"A3W_thirstTime",
"A3W_fastMovementLog",
"A3W_fastMovementLogDist",
"A3W_fastMovementLoopTime"
];

addMissionEventHandler ["PlayerConnected", fn_onPlayerConnected];
Expand Down Expand Up @@ -563,4 +566,4 @@ if !(["A3W_hcObjCleanup"] call isConfigOn) then
{
// Start clean-up loop
execVM "server\WastelandServClean.sqf";
};
};

0 comments on commit f7c0d1b

Please sign in to comment.