Jump to content

Humanity Restriction for certain Vehicles


DAKA

Recommended Posts

easiest way would be to probably make a nested array of vehicle classes and humanity.

 

in your init.sqf or variables.sqf add (preferably around the same line as ConfigVariable.sqf) DZE_VehHumanityReq = [["vehclass1",123],["Vehclass2",123],["Vehclass3",123]];

At the bottom of the inveh check in fn_damageActions https://github.com/EpochModTeam/DayZ-Epoch/blob/master/SQF/dayz_code/compile/fn_damageActions.sqf#L19-L78 add the following code:

_humanity = player getVariable["humanity",0];
{
	_CheckVeh = _x select 0;
	_HumanityReq = _x select 1;
	if (((vehicle player) == _CheckVeh) && {_humanity < _HumanityReq}) then { //you can also check assigned roles to restrict certain seats if you are so inclined
		player action ["getOut", (vehicle player)];
		(format ["Your humanity, %1, is less than the required humanity, %2, to use this vehicle", _humanity, _HumanityReq]) call dayz_rollingMessages;
	};
} forEach DZE_VehHumanityReq;

 

Link to comment
Share on other sites

Yes, someone is helping me with it and they figured it out. it was all them. im too stupid to do anything, but i have learned a lot just looking at they gave me. I have now decided that I am going to learn more so maybe one day i can write my own scripts.

 

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...