Jump to content

Vehicle driver seat restriction according to humanity. 1.0.6.1


totis

Recommended Posts

Hi

This is a restriction to vehicle seat according to humanity.

It may be handy to PVE servers out there.

Special thanks to Juandayz with his fantastic skills and salival. Both sometimes working unseen for the benefit of this community.

Step 1.

Make a new file, Name it veh_hum.sqf with the below contents and put into dayz_epoch/addons folder. If you dont have addons just create one.

In this example we have a hero superhero and agenthero traders with 20k/40k/60k humanity respectively. Adjust according to your needs.

 

private ["_vehicle","_inVehicle","_driver","_humanity","_txt"];

while {true} do {

_vehicle = vehicle player;
_inVehicle = (_vehicle != player);

if (_inVehicle) then {
	_driver = driver (vehicle player);

	if (({(isPlayer _driver) && (alive _driver)} count (crew _vehicle) > 0)) then {
		

		_humanity = _driver getVariable["humanity",0];

		if (typeOf _vehicle in DZE_heroHumanity && _humanity <= 20000 || (typeOf _vehicle in DZE_superHeroHumanity && _humanity <= 40000) || (typeOf _vehicle in DZE_agentHumanity && _humanity <= 60000)) then {
			player action ["getOut", (vehicle player)];
			titleText ["","WHITE IN"];
			_txt = "<img image='addons\vehicon.paa' /><br/><t size='0.7' color='#ea2828' align='center'>prohibited vehicle</t>";
            [_txt, [safezoneX, safezoneW], [0.20 * safezoneH + safezoneY, 0.3 * safezoneH], 2, 0.5] spawn BIS_fnc_dynamicText;
		};
	};
};
sleep 3;
};

 Step 2: Download this file http://www.mediafire.com/file/bdpt5d96o5cttk3/vehicon.rar

Unzip and put paa file into addons folder.

Step 3: Edit your custom variables file    dayz_code/init/variables.sqf

Put the vehicles you want to restrict below call dayz_resetselfactions; ike this:

	// Custom below
	s_givemoney_dialog = -1;
	s_bank_dialog = -1;
	s_player_checkWallet = -1;
	s_bank_dialog1 = -1;
	s_bank_dialog2 = -1;
	s_player_copyToKey = -1;
	s_player_claimVehicle = -1;
	s_collect_heli = -1;
};

call dayz_resetSelfActions;

	DZE_heroHumanity = ["Mi17_rockets_RU","Mi24_D","UH1Y_DZE"];
	DZE_superHeroHumanity = ["Mi24_V","Mi24_P","Ka52"];		
	DZE_agentHumanity = ["AV8B2","AV8B","A10","F35B"];
	DZE_safeVehicle = DZE_heroHumanity + DZE_superHeroHumanity + DZE_agentHumanity +["ParachuteWest","ParachuteC"];

Step 4: Edit your init file to exec the script. Above the   (false,12)execVm.... like below

    [] execVM "addons\veh_hum.sqf";
    //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";

Thats it. Enjoy!

  Hide contents
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
  • Discord

×
×
  • Create New...