Jump to content

[FIX] Prevent glitching into bases


Shawn

Recommended Posts

If you have very low fps, or set your view distance high, you can run against a door and go prone, and it will let you glitch into the base. To fix this...

Add:

DZE_AntiGlitch = 0;

in init.sqf under:

MaxDynamicDebris = 0;

Then open up dayz_spaceInterrupt, and add:

if (_dikCode in actionKeys "Prone") then {
	if (diag_tickTime <= DZE_AntiGlitch) then {
		_handled = true;
	} else {
		_handled = !( [] call check_prone);
	};
};

Now in compiles.sqf, add:

check_prone = compile preprocessFileLineNumbers "Path\to\check_prone.sqf";

below:

building_spawnZombies =	compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnZombies.sqf";

Now finally, create the file named check_prone.sqf in the directory you made, and add:

private ["_result","_wallCheck","_wallPoint"];
_result = true;
_wallPoint = nearestObjects [player, DZE_DoorsLocked, 3];
if (count _wallPoint > 0) then {
	_wallCheck = [_wallPoint, player] call BIS_fnc_nearestPosition;
	if ((vehicle player) distance _wallCheck < 1.9) then {				
		_msg = "Do not prone near a locked door! Prone blocked for 5 sec...";
		systemChat ("[Server]: "+str _msg);
		DZE_AntiGlitch = diag_tickTime + 5;
		_result = false;			
	};
};
_result

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...