Jump to content

Fix for Wheels in Repair/Salvage Vehicle


Panadur

Recommended Posts

Hi there,

 

on my server i have a modified repair_vehicle.sqf and salvage_vehicle.sqf that only allow you to repair or salvage 4 or 6 wheels on a vehicle, depending on its class

 

Serach for

private ["_part","_cancel","_color","_allFixed","_percent","_string","_handle","_damage","_cmpt","_vehicle","_hitpoints"];

and change it to

private ["_part","_cancel","_color","_allFixed","_percent","_string","_handle","_damage","_cmpt","_vehicle","_hitpoints","_hitpoints2"];

then search for

_hitpoints = _vehicle call vehicle_getHitpoints;

and add this code after

// ********************* Panadur's Wheelfix Start **************************************************************************************************************************

_hitpoints2=[];
 if ((typeof _vehicle) isKindOf  "Truck") then {

		if (_x in ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitGlass7","HitGlass8","HitLFWheel","HitLBWheel","HitRFWheel","HitRBWheel","HitLMWheel","HitRMWheel","HitFuel","HitRGlass","HitLGlass","HitEngine"]) then 

			_hitpoints2 set [(count _hitpoints2),_x];
		} 
	} foreach _hitpoints;
	_hitpoints = _hitpoints2;
};

if (((typeof _vehicle) isKindOf  "Car") and !((typeof _vehicle) isKindOf  "Truck")) then {
	{
		if (_x in ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitGlass7","HitGlass8","HitLFWheel","HitLBWheel","HitRFWheel","HitRBWheel","HitFuel","HitRGlass","HitLGlass","HitEngine"]) then 

			_hitpoints2 set [(count _hitpoints2),_x];
		} 
	} foreach _hitpoints;
	_hitpoints = _hitpoints2;
};
// ********************* Panadur's Wheelfix End **************************************************************************************************************************

Now Cars only have four or six Wheels.

Link to comment
Share on other sites

This is not working in 1.0.4.

 

I added

 ,"_hitpoints2"

to the end of private, an edited "fn_selfActions" to call the new edited files. But when you click repair or salvage in game you don't get any options to fix anything... Anyone know a way of getting this to work?

Same here, would love to have it fixed.

Link to comment
Share on other sites

  • 3 months later...

I have changed the code so it works, i had the repair and salvage functions back.

But it doesnt matter if you use this code or not, the addional wheels which logically u dont see are still there for repairing or slavaging.

With other words, this script has no function !

I also tryed to create a query to only one specific vehicle like a "SUV Orange", but still 8 wheels are available for salvaging.

 

Panadur:

Can you take a look at this again and/or fix it so it works ?

Probably u forgot some "{" or used too many of them ?

 

What i try to say is: If you use this code as it shown at the first post, u will break the script process all over. Thats the reason why no option is shown if you want to repair or salvage any vehicle.

And if you fix the script process with some missing "{" the options come back but the script isnt working as it should do.

Link to comment
Share on other sites

  • 10 months later...

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