diff --git a/helotraining_mp.Altis/destroyVehicleAction.sqf b/helotraining_mp.Altis/destroyVehicleAction.sqf new file mode 100644 index 0000000..904cd73 --- /dev/null +++ b/helotraining_mp.Altis/destroyVehicleAction.sqf @@ -0,0 +1,9 @@ +private _vehicle = _this select 0; +private _caller = _this select 1; +private _returnValue = []; + +_vehicle setDamage 1; +sleep 1; +_vehicle setDamage 0; + +_returnValue diff --git a/helotraining_mp.Altis/precompile.sqf b/helotraining_mp.Altis/precompile.sqf index 830abb5..ed08ee3 100644 --- a/helotraining_mp.Altis/precompile.sqf +++ b/helotraining_mp.Altis/precompile.sqf @@ -18,6 +18,7 @@ selectLZ = compileFinal preProcessfile "selectLZ.sqf"; getAlivePlayers = compileFinal preProcessfile "getAlivePlayers.sqf"; spawnCrewAction = compileFinal preProcessfile "spawnCrewAction.sqf"; spawnPlayerTask = compileFinal preProcessfile "spawnPlayerTask.sqf"; +destroyVehicleAction = compileFinal preProcessfile "destroyVehicleAction.sqf"; taskSpawner = compileFinal preProcessfile "taskSpawner.sqf"; xenoRepair = compileFinal preProcessfile "xenoRepair.sqf"; diff --git a/helotraining_mp.Altis/vehicleInit.sqf b/helotraining_mp.Altis/vehicleInit.sqf index e383c14..7a1b133 100644 --- a/helotraining_mp.Altis/vehicleInit.sqf +++ b/helotraining_mp.Altis/vehicleInit.sqf @@ -1,7 +1,9 @@ //diag_log format["vehicleIinit called, _this: %1", _this]; _vehicle = _this select 0; +_vehicle setDamage 0; _vehicle remoteExec ["removeAllActions", 0, "rmall" + (_vehicle call BIS_fnc_netId)]; [_vehicle, ["Repair", { [_this select 0] spawn xenoRepair; }]] remoteExec ["addAction", 0, "addrepair" + (_vehicle call BIS_fnc_netId)]; [_vehicle, ["Spawn crew", { _this spawn spawnCrewAction; }]] remoteExec ["addAction", 0, "addcrew" + (_vehicle call BIS_fnc_netId)]; +[_vehicle, ["Respawn vehicle", { _this spawn destroyVehicleAction; }]] remoteExec ["addAction", 0, "destroy" + (_vehicle call BIS_fnc_netId)];