Jump to content
Sign in to follow this  
csk222

How do I make addaction available to all players?

Recommended Posts

We have an in game tablet that allows us to click buttons to spawn vehicles. The following works properly as far as spawning the vehicle for everyone but the addactions (Get On Skid) only appear to the person that spawned the vehicle. What do I have to do?

private ["_caller"];
_caller = _this select 0;

titleText ["Open Map and Click on MH9 Vehicle Spawn location.", "PLAIN"];
["mk_wst_mh9", "onMapSingleClick", {
titleText ["", "PLAIN"];
_tpos = _pos;

mrkrnum = server_1 getVariable "mrkrcnt";
mrkrnum = mrkrnum + 1;
mrkrname = format["MH9_%1", mrkrnum];
vehname = format["BFMH9_%1", mrkrnum];

_mrkr = createMarker [mrkrname, _tpos];
mrkrname setMarkerShape "ICON";
mrkrname setMarkerColor "Color4_FD_F";
mrkrname setMarkerSize [1, 1];
mrkrname setMarkerType "mil_dot";
mrkrname setMarkerText mrkrname;

server_1 setVariable ["mrkrcnt",mrkrnum,true];

vehname = "B_Heli_Light_01_F" createVehicle getMarkerPos mrkrname;

vehname addAction["Get on Skid Left Front", "player moveInCargo [vehname, 4]"];
vehname addAction["Get on Skid Left Back", "player moveInCargo [vehname, 3]"];
vehname addAction["Get on Skid Right Front", "player moveInCargo [vehname, 2]"];
vehname addAction["Get on Skid Right Back", "player moveInCargo [vehname, 5]"];

["mk_wst_mh9", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
bfvehlist = bfvehlist + [[vehname, mrkrname]]; publicVariable "bfvehlist";	
true;
}] call BIS_fnc_addStackedEventHandler;

Share this post


Link to post
Share on other sites

[[vehName, ["Get on Skid Left Front", "player moveInCargo [vehname, 4]"]], "addAction", true, true] call BIS_fnc_MP;

I've never used this command before so I hope it works

Edited by DreadedEntity

Share this post


Link to post
Share on other sites

Just as a side question, why set the marker size to [1,1] if that's the default size? Unless your moving the marker from somewhere else, where it started smaller?

Share this post


Link to post
Share on other sites

@DreadedEntity - Thanks it worked, but I guess the way we are spawning the vehicles is causing other issues.

@JShock - The scripter of our mission was a very methodical individual, that's just how he did things.

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  

×