Advertisement
infiSTAR23

player_antiWall #2 - example run

May 14th, 2014
714
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.38 KB | None | 0 0
  1. /*
  2.     DayZ Epoch anti wall
  3.     Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
  4.     edit (not tested and might be bad - but might also be awesome):
  5.     http://infiSTAR.de
  6.     http://DayzAntiHack.com
  7. */
  8. if (!isServer) then {
  9.     [] spawn {
  10.         waitUntil {!isNil 'dayz_animalCheck'};
  11.         _antiWall = {
  12.             private ['_vehicle','_vehiclePos','_playerPos','_activated','_id','_intersectsWith'];
  13.             _activated = false;
  14.             _vehicle = _this;
  15.             _vehiclePos = aimpos _vehicle;
  16.             _playerPos = visiblePositionASL player;
  17.             if((_playerPos distance _vehiclePos) > 10) exitWith {};
  18.             _playerPos set [2,(_playerPos select 2)+1];
  19.             _intersectsWith = lineIntersectsWith [_playerPos, _vehiclePos, player, _vehicle];
  20.             if ((count _intersectsWith) > 0) then
  21.             {
  22.                 {
  23.                     if ((typeOf _x) == '' and {['Wall_DZ', str _x, false] call fnc_inString}) exitWith {
  24.                         _activated = true;
  25.                     };
  26.                     if ((typeOf _x) == '' and {['DoorLocked_DZ', str _x, false] call fnc_inString}) exitWith {
  27.                         _activated = true;
  28.                     };
  29.                     if ((typeOf _x) == '' and {['Floor_DZ', str _x, false] call fnc_inString}) exitWith {
  30.                         _activated = true;
  31.                     };
  32.                 } forEach _intersectsWith;
  33.             };
  34.             if(_activated) then {
  35.                 _vehiclePos set [2,0];
  36.                 player setPos _vehiclePos;
  37.             };
  38.         };
  39.         while {1 == 1} do
  40.         {
  41.             (vehicle player) call _antiWall;
  42.             sleep 0.5;
  43.         };
  44.     };
  45. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement