Vehicle destroy action (forces respawn)

This commit is contained in:
Eero af Heurlin 2016-09-11 15:49:18 +03:00
parent 3df9024af2
commit 1f6860e0f9
3 changed files with 12 additions and 0 deletions

View File

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

View File

@ -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";

View File

@ -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)];