Jump to content
Sign in to follow this  
hogmason

repairing destroyed vehicle

Recommended Posts

im trying to add a way to repair a destroyed vehicle i have got this to fixe damaged vehicles but it doesnt work when they are fully destroyed any ideas on how to do this

if ! isdedicated then                                   
{

if (count _this > 1) then {
(_this select 1) playMove "ActsPercSnonWnonDnon_carFixing2";
sleep 7;
(_this select 1) playMove "AinvPknlMstpSnonWrflDnon_medicEnd";
(_this select 0) setDammage 0;
(_this select 0) setFuel 1;
 hint "Vehicle Repaired, Re-Fueled & Re-Armed";
};

if (!isNil ("vehicleRepairInitiated")) exitWith {};
vehicleRepairInitiated = true;
waitUntil {sleep 1; alive player};

while {true} do {
{

	if (!(_x getVariable ["usRepairsInitiated", false])) then {
		_id = _x addAction ["Repair Vehicle", "HOG_scripts\Vehicle_Repair\vehicleRepair.sqf", [], 1, false, true, "", "(getDammage _target) < 1 AND (getDammage _target) > 0 AND (faction _this) == 'BIS_US' AND (vehicle _this) == _this"];
		_x setVariable ["usRepairsInitiated", true, false];
	};
} foreach vehicles;
sleep 5;
};

};


Share this post


Link to post
Share on other sites

You can't repair a destroyed vehicle by resetting it's damage and fuel, it doesn't work that way.

You'll need to spawn a brand new one and remove the wreck.

Share this post


Link to post
Share on other sites

have a look in xeno's domination. when you have a destroyed veh you drop it in the wreck repair zone/trigger and a couple mins later Ta-da! new veh. I used his repair, rearm and refuel script in a personal project and with very little scripting knowledge so shouldnt be that hard. Also I've found that 90% of the info/help you need has already been covered on these forums, its just finding it thats hard. I use google advanced search to search only these forums by entering http://forums.bistudio.com into the "Site or Domain" field.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×