Jump to content
Sign in to follow this  

addaction Arguments

Recommended Posts

Below is a basic addaction. How ever can some one tell me how to use the Arguments, I need to pass 3 Arguments, unit1,unit2,unit3

ID = player["Recall", "recall.sqf" , Arguments ,Priority, Display, Hiding, "Hotkeys"];


Share this post

Link to post
Share on other sites

_actionIdx = player addaction ["Recall","recall.sqf",[unit1,unit2,unit3],0,false,false,"",""];

Just guessing how you want the priorities etc. They are optional and don't have to be there I imagine, just never tried.

To access the arguments in the recall.sqf script

addaction passes other parameters which you can see here.


Your arguments are passed as the third parameter, and I have sent them as an array.

So to access them you can use the likes of below.

_first_parameter = (_this select 3) select 0;

_second_parameter = (_this select 3) select 1;

_third_parameter = (_this select 3) select 2;

Or keep them as an array and access them that way in your script

_arguments_passed_by_me = _this select 3;

So that

_first_parameter = _arguments_passed_by_me select 0;

Hope this helps,


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