SmokeyMeadow
Well-Known Member
I've been trying to adapt a spare tire script from one of the rmod 2 vehicles to work with other cars in day z. It's the M1161, the spare tire can be removed and used as a temporary fix (it goes away after server restart). I like this idea, and am even considering adding a timer to make the spare even more temporary, basically just have it useful as a way to get your vehicle to safety before it becomes immobilized again. But right now, I'm having trouble with it actually putting the tire on. I've written an fn_selfaction that works, and the tirechange.sqf does initialize and make the player perform the tire changing action. But no wheel is placed on the vehicle. Now obviously I don't expect to have the spare tire actually be removable from the day z vehicle, that would require too much 3d modeling and would drastically increase mission size. But for certain trucks, with a spare tire bolted to the side, I'd like to be able to at least use that.
here's the code for fn_selfactions:
That is just for the landrover so far, but I intend to add the pickups and large trucks as well.
Here is the problematic code for tirechange.sqf. The only thing I changed was the _M116 variable name to _landrover:
Does anyone have an idea why it won't take the part?
here's the code for fn_selfactions:
Code:
// SPARE TIRE END
_isLand = (cursorTarget isKindOf "LandRover_TK_CIV_EP1") or (cursorTarget isKindOf "LandRover_CZ_EP1") or (cursorTarget isKindOf "LandRover_MG_TK_EP1") or (cursorTarget isKindOf "BAF_Offroad_D") or (cursorTarget isKindOf "BAF_Offroad_W");
if ((_isLand) && ("ItemToolbox" in items player)) then {
if (usespare < 0) then {
usespare = player addAction [("<t color=""#00c362"">" + ("Spare Tire") +"</t>"),"scripts\tirechange.sqf","",5,false,true,"",""];
};
} else {
player removeAction usespare ;
usespare = -1;
};
// SPARE TIRE END
That is just for the landrover so far, but I intend to add the pickups and large trucks as well.
Here is the problematic code for tirechange.sqf. The only thing I changed was the _M116 variable name to _landrover:
Code:
if (isDedicated) exitWith {};
_Landrover = _this select 0;
_Landrover animate ["spare", 1];
// 'RepairingKneel' - 120 seconds
player playMove 'AinvPknlMstpSlayWrflDnon_medic';
sleep 8;
player playMove 'AinvPknlMstpSlayWrflDnon_medic';
sleep 8;
player playMove 'AinvPknlMstpSlayWrflDnon_medic';
sleep 8;
_Landrover setHit ["levy predni tlumic", 0];
_Landrover setHit ["levy zadni tlumic", 0];
_Landrover setHit ["pravy predni tlumic", 0];
_Landrover setHit ["pravy zadni tlumic", 0];
_Landrover setDamage 0.1;
Does anyone have an idea why it won't take the part?