Jump to content
Sign in to follow this  
marker

Multiplayer Add / Remove Action for an Addaction Newb!

Recommended Posts

Hey guys!!

Reading through all the search results, I seem to still not be able to understand the addaction command properly!

Want to create a simple mash tent then remove the addaction once complete!

There will be a few more arguments added, but I am sure i can do that myself!

The addaction is as below!

if 

(vehicle player isKindOf "USMC_SoldierS_Engineer" || vehicle player isKindOf "US_Soldier_Engineer_EP1" || vehicle player isKindOf "BAF_Soldier_EN_MTP") then

{
_createmash = player addAction ["Build Mash Tent", "mash.sqf"];
};

Else {};

the script is

_this select 1 playMove "AinvPknlMstpSlayWrflDnon_medic";
sleep 5;
_mash = "Mash" createVehicle (position player);

player removeaction _createmash;

How would I go about removing the addaction?

I tried using waituntil "mash" was the nearestobject then removeaction, obviously tried in the script as well!!

Thanks

Share this post


Link to post
Share on other sites

The id of the action is passed as _this select 2;

So:

player removeaction (_this select 2);

Share this post


Link to post
Share on other sites

_obj = _this select 0; // in this case it's the player object
_id = _this select 2; // addAction index value so we can remove it.
_obj removeAction _id;

This would remove it for the player who spawned the tent, where do you want it to be MP synchronized? Only one tent?

Share this post


Link to post
Share on other sites

Thanks guys.

Yeah removed after the tent is placed....

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  

×