Dan86 10 Posted November 11, 2009 (edited) Like in the topic: "respawnvehicle.sqf" calls "ahfold.sqf" to respawn with folded rotor. //respawnvehicle deletevehicle _vehicle; _vehicle = objNull; sleep 0.5; _vehicle = _type createvehicle _startpos; _vehicle setpos _startpos; _vehicle setdir _startdir; _vehicle addAction ["Fold", "ahfold.sqf",[],0,false]; _vehicle addAction ["Unfold", "ahunfold.sqf",[],0,false]; [b]_vehicle execVM "ahfold.sqf";[/b] //Fold _vehicle = _this select 0; _vehicle animate ["mainrotor_folded",0]; _vehicle animate ["mainrotor_unfolded",1]; _vehicle animate ["rotorshaft_unfolded",1]; _vehicle setVehicleLock "LOCKED"; however this dosn't work like i wish to work. Vehicle is being respawned without folded rotor and unlocked. Edited November 17, 2009 by Dan86 Share this post Link to post Share on other sites
fincuan 0 Posted November 11, 2009 [_vehicle] execVM "ahfold.sqf"; or _vehicle = _this; Share this post Link to post Share on other sites
Dan86 10 Posted November 14, 2009 (edited) Thanks man, this worked. For any more interested in respawning air vehicle folded and locked. //Cobra Fold _vehicle = _this select 0; if (isengineOn _vehicle) exitwith {hint format ["Cannot fold when engine is running %1!", _type_name]}; _vehicle animate ["mainrotor_folded",0]; _vehicle animate ["mainrotor_unfolded",1]; _vehicle animate ["rotorshaft_unfolded",1]; _vehicle setVehicleLock "LOCKED"; //Cobra UnFold _vehicle = _this select 0; if (isengineOn _vehicle) exitwith {hint format ["Cannot fold when engine is running %1!", _type_name]}; _vehicle animate ["mainrotor_folded",1]; _vehicle animate ["mainrotor_unfolded",0]; _vehicle animate ["rotorshaft_unfolded",0]; _vehicle setVehicleLock "UNLOCKED"; //Osprey fold _vehicle = _this select 0; if (isengineOn _vehicle) exitwith {hint format ["Cannot fold when engine is running %1!", _type_name]}; _vehicle setVehicleLock "LOCKED"; _vehicle = [_vehicle,1] execvm "\ca\air2\mv22\scripts\pack.sqf"; //Osprey Unfold _vehicle = _this select 0; if (isengineOn _vehicle) exitwith {hint format ["Cannot fold when engine is running %1!", _type_name]}; _vehicle = [_vehicle,0] execvm "\ca\air2\mv22\scripts\pack.sqf"; _vehicle setVehicleLock "UNLOCKED"; //UH1Y Fold _vehicle = _this select 0; if (isengineOn _vehicle) exitwith {hint format ["Cannot fold when engine is running %1!", _type_name]}; _xtype = [_vehicle,1] execVM "\Ca\air2\UH1Y\Scripts\fold.sqf"; _vehicle setVehicleLock "LOCKED"; //UH1Y UnFold _vehicle = _this select 0; if (isengineOn _vehicle) exitwith {hint format ["Cannot fold when engine is running %1!", _type_name]}; _xtype = [_vehicle,0] execVM "\Ca\air2\UH1Y\Scripts\fold.sqf"; _vehicle setVehicleLock "UNLOCKED"; You can call this scripts when vehicle gets respawned by Xeno respawn script. This is for Cobra (ahfold.sqf is the name of folding cobra file) Cobra init: handle = [this, 220] execVM "x_scripts\x_vehirespawnAH.sqf"; nul=[this,1] execVM "ahfold.sqf"; this addAction ["Fold", "ahfold.sqf", [], 0, false, true, ""]; this addAction ["Unfold", "ahunfold.sqf", [], 0, false, true, ""]; // by Xeno private ["_delay","_disabled","_moved","_newveh","_startdir","_startpos","_type","_vehicle"]; if (!isServer) exitWith{}; _vehicle = _this select 0; _delay = _this select 1; _moved = false; _startpos = getpos _vehicle; _startdir = getdir _vehicle; _type = typeof _vehicle; while {true} do { sleep (_delay + random 15); _moved = (if (_vehicle distance _startpos > 5) then {true} else {false}); _empty = (if (({alive _x} count (crew _vehicle)) > 0) then {false} else {true}); _disabled = (if (damage _vehicle > 0) then {true} else {false}); if ((_disabled && _empty) || (_moved && _empty) || (_empty && !(alive _vehicle))) then { deletevehicle _vehicle; _vehicle = objNull; sleep 0.5; _vehicle = _type createvehicle _startpos; _vehicle setpos _startpos; _vehicle setdir _startdir; _vehicle addAction ["Fold", "ahfold.sqf",[],0,false]; _vehicle addAction ["Unfold", "ahunfold.sqf",[],0,false]; [_vehicle] execVM "ahfold.sqf"; //_vehicle addeventhandler ["killed", {_this execVM "ahfold.sqf"}]; }; }; Edited November 14, 2009 by Dan86 Share this post Link to post Share on other sites