Trigger something via addAction

Here’s one method for using an addAction command to activate something such as a trigger.

This would go on the object that will have the action:

_nul = this addAction["Start mission","start.sqf"];

This would be the text for start.sqf:

_me = _this select 0;
_act = _this select 2;
_me removeAction _act;
startmission = true;
publicVariable "startmission";
hint "Mission started!";

This would be the condition of a trigger:

!isNil { startmission }  

Comments are closed.