Jump to content
  • 0

Anti Wall for bases


theballin7

Question

I took the code from basebuilding and changed the walltypes to the buildings in epoch and when i tried it dont work ingame at all so i was wondering if anyone could help me this is my code

private["_wallRange","_wallType","_inVehicle","_walltypes","_wall","_vehPos","_nearestVeh","_nearestVehs","_isVehicle"];

while {true} do {

if (animationstate player == "acrgpknlmstpsnonwnondnon_amovpercmstpsnonwnondnon_getoutlow" || animationstate player == "acrgpknlmstpsnonwnondnon_amovpercmstpsraswrfldnon_getoutlow" || animationstate player == "acrgpknlmstpsnonwnondnon_amovpercmstpsraswpstdnon_getoutlow") then {

_inVehicle = (vehicle player != player);

_isVehicle = (vehicle player);

_wallRange = 10;



        wallTypes = nearestObjects [player, ["WoodFloor_DZ","WoodFloorHalf_DZ","WoodFloorQuarter_DZ","Land_DZE_LargeWoodDoorLocked","WoodLargeWallDoor_DZ",

        "WoodLargeWallWin_DZ","WoodLargeWall_DZ","Land_DZE_WoodDoorLocked","WoodSmallWallDoor_DZ","WoodSmallWallWin_DZ",

        "Land_DZE_GarageWoodDoor","Land_DZE_GarageWoodDoorLocked","CinderWallDoorway_DZ","Land_DZE_LargeWoodDoor","MetalFloor_DZ","CinderWallDoor_DZ","CinderWallDoorSmallLocked_DZ","CinderWallSmallDoorway_DZ",

        "WoodSmallWall_DZ","WoodSmallWallThird_DZ","WoodLadder_DZ","WoodStairsSans_DZ","WoodStairs_DZ","CinderWallHalf_DZ","CinderWall_DZ"], 20];

        if (count _walltypes > 0) then {

                _wall = _walltypes select 0;

                if (player distance _wall < _wallRange) then {

                        _nearestVehs = nearestObjects [player, ["LandVehicle"], 10];

                        sleep .01;

                        _nearestVeh = _nearestVehs select 0;

                        sleep .01;

                        _vehPos = getPosATL _nearestVeh;

                        sleep .01;

                        player allowdamage false;

                        player setpos _vehPos;

                        sleep 2;

                        player allowdamage true;

                        };            

        };

    };

};
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...