MV22 Osprey Folding wings?

And does i need to edit init.sqf? and in fn_selfactions.sqf i added
this addAction ["Fold","fold.sqf"];
this addAction ["UnFold","unfold.sqf"];
at the bottom but this does not work, why?
 
Okay in server_monitor.sfq i did that
but now my dayz server got completly fucked, it says error in hivext





this is how it looks like



clearWeaponCargoGlobal _object;
clearMagazineCargoGlobal _object;


if (_object isKindOf "[/SIZE]MV22") then {
_object addAction ["Fold","fold.sqf"];
_object addAction ["UnFold","unfold.sqf"];
};

if ((typeOf _object) in dayz_allowedObjects) then {
_object addMPEventHandler ["MPKilled",{_this call object_handleServerKilled;}];
// Test disabling simulation server side on buildables only.
_object enableSimulation false;
// used for inplace upgrades and lock/unlock of safe
_object setVariable ["OEMPos", _pos, true];
};
 
Thanks so much :) But again, i need this to work in database saved vehicles, do you know how? without fuck the hive
 
Thanks :D But the blades are spinning when the engine is off, is it posible to add fuel to 0 when the wings are folded?
 
A better way is to store current fuel in a variable and then restore it when unfolding or use an event handler that prevents folding when engine is on.


Why use an event handler and mess around with the fuel when you have this?
http://community.bistudio.com/wiki/isEngineOn

fold.sqf:
Code:
_on = isEngineOn themv22;
if (_on) then {
    //tell player to turn engine off first
    titleText [("You have to turn the engine off first!"), "PLAIN DOWN", 2];
} else {
    //fold the wings
    _xtype = [themv22,1] execvm "\ca\air2\mv22\scripts\pack.sqf"
};
 
works great... thankz....
but whats the issue with the fuel ?? It does not effect my fuel when I fold or unfold
 
You can still turn the engine off while flying and fold the wings and then turn the engine on and fly wings folded :)
 
this works great, as long as its a MV22_DZ and not a MV22 took me a min to figure that out. kept failing to work
and the oh yeah thats why...

thankz for this....


Add this to the bottom of your init.sqf:
Code:
[] execVM "scripts\mv22fold.sqf";

Save this in scripts\mv22fold.sqf in your mission pbo:
Code:
Waituntil{!isNull player};
 
while{true} do {
sleep 0.5;
if ((cursortarget isKindOf "MV22_DZ") && (isNil "mv22actionsadded")) then {
themv22 = cursorTarget;
mv22_fold = themv22 addAction ["Fold","scripts\fold.sqf","",5,false,true,"",""];
mv22_unfold = themv22 addAction ["UnFold","scripts\unfold.sqf","",5,false,true,"",""];
mv22actionsadded = true;
} else {
};
};

Save this in scripts\fold.sqf:
Code:
_xtype = [themv22,1] execvm "\ca\air2\mv22\scripts\pack.sqf"

Save this in scripts\unfold.sqf
Code:
_xtype = [themv22,0] execvm "\ca\air2\mv22\scripts\pack.sqf"

Lastly if you are using antihax you need to whitelist these two actions so they aren't removed for non-admins. Find
Code:
dayzActions = [s_player_dropflare,s_player_butcher,s_player_cook,
                                s_player_boil,s_player_fireout,s_player_packtent,s_player_sleep,s_player_studybody,
                                NORRN_dropAction,s_player_selfBloodbag,

Add these two to the list:
Code:
mv22_fold,mv22_unfold

;)[/quote]
 
Looking at this, you should be able to change it to just be able to fold the wings from the outside and have it call this script here:
Code:
if (vehicle player != player) then {
    _mv22 = cursorTarget player;
    _xtype = [_mv22,1] execvm "\ca\air2\mv22\scripts\pack.sqf"
    _mv22 addEventHandler ["GetIn",{
        _ytype = [_mv22,0] execvm "\ca\air2\mv22\scripts\pack.sqf"
    }];
};

If the player is on foot it will fold the wings, then it adds an eventhandler to check if they get in, and when they do, unfolds the wings.

Haven't tested it but it should work fine. Should prevent folded wing flying bugs.
 
Back
Top