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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...