Jump to content
Sign in to follow this  
wangsvik

Sling load players Multiplayer

Recommended Posts

So heres my idea, i want to sling load people from the ground and into the helicopter. But people on the ground cant see the addaction, and they doesent "connect" to my slingrope.

Im quite new on this kind of scripting as you may se underneath.

this is the exec.sqf

drop = _this addaction ["Deploy Winch","gsoc\sling1\drop.sqf", "", 0, false, true, "", "_this in _target"];

then deploy.sqf:

if(isServer) then {
waitUntil{!isnil("BIS_MPF_InitDone")};
waitUntil{BIS_MPF_InitDone};
waituntil { !isNil "BIS_fnc_init" };

EXT_V = vehicle;
EXT_V removeaction drop;

if (EXT_V iskindof "yup_MH60L") then {

EXT_R = "ACE_FastRope_60" createvehicle [0,0,0];
EXT_S = "ACE_Target_WHvy" createvehicle [0,0,0];
EXT_S1 = "ACE_Target_WHvy" createvehicle [0,0,0];


EXT_N = "NVG_TargetC" createVehicle [0,0,0];
EXT_S Setvehiclelock "UNLOCKED";
EXT_R attachto [EXT_V,[1.399,2.2,0]];
EXT_S attachto [EXT_R,[0,0,-18]];
EXT_S1 attachto [EXT_R,[0,0,-18.5]];

EXT_N attachto [EXT_S,[0,0,0]];
raise = EXT_V addaction ["Raise Winch","gsoc\sling1\raise.sqf", "", 0, false, true, "", "_this in _target"];
[nil, EXT_S1, "per", rADDACTION, "Connect", "gsoc\sling1\connect.sqf",[EXT_S1, nil, 1],1,true,true,"","(_target distance _this) < 5"] call RE;
_title  = "<t color='#ff0000' size='1.2' shadow='1' shadowColor='#000000' align='center'>Status:</t><br/>";
_text   = "<t color='#228b22'>Wire deployed!</t>";
hintsilent parseText (_title + _text);
};

Now the slingrope is dropped and its time for the ground units to connect to the rope: connect.sqf

EXT_S2 = "ACE_Target_WHvy" createvehicle [0,0,0];
EXT_S2 attachto [EXT_R,[0,0,-18.5]];
[nil, EXT_S2, "per", rADDACTION, "Connect1", "gsoc\sling1\connect2.sqf",[EXT_S2, nil, 1],1,true,true,"","(_target distance _this) < 5"] call RE;
MAN_1 = vehicle player;
MAN_1 attachto [EXT_S,[-0.2,-0.1,0]];
deletevehicle EXT_S1;

Have tryed many things, but nothing seems to work! Hope somebody out there have some good tips for me.

Share this post


Link to post
Share on other sites

The addaction command is local to the client it runs on, meaning the script that adds the action to what you want has to be running on everyone's computer or they wont have it.

http://community.bistudio.com/wiki/addAction

Either put the addAction code in init.sqf, or have your "exec.sqf" executed by a trigger/unit initialization field. ex: execVM "exec.sqf"

You can then use the "condition" parameter of addAction to show/hide based on true/false.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×