/* All examples explained in the video plus a few additional examples. Enjoy. */ //If the player is dead... if (!alive player) then { //insert your own code here }; //If the player is above 500m... if (getPos player select 2 > 500) then { //insert your own code here }; //If the player is near the second soldier of his group... if (player distance (units (group player) select 1) < 15) then { //insert your own code here }; //Note - code assumes the other soldier exists. If he doesn't, the code will fail. //I recommend adding another condition checking if the other soldier exists first. //If the player is running... if (vehicle player == player && speed player > 10) then { //insert your own code here }; //Note - more options are available. if (! isForcedWalk player) then { //insert your own code here }; //If the player completed other tasks... if (taskState task1 == "Succeeded") then { //insert your own code here }; //Note - more options available. See video for more details. // Additional examples ---------- //We can use many conditions at once, and divide them by brackets and logic operators. if (damage player < 0.3 || (dayTime < 20 && dayTime > 9)) then { }; //We can use our own variables. Just make sure the variable is initialized and assigned a value before checking for it. if (MyOwnVariable == true) then { //My own variable is true }; //We can use direct TRUE or FALSE as neverchanging values, for example in an eternal while...do loop. while {true} do { //true never changes to false, and the commands will be repeated endlessly. }; //We can use if...then... inside some other statements. { if (side _x == east) then { _x setDamage 0.5; //All OPFOR units are affected. } } forEach AllUnits if (alive player) then { if (player distance objectOfInterest < 20) then { if (damage objectOfInterest < 0.5) then { //player is near the object of interest and hasn't destroyed it yet. } //player is near the object of interest, but the object is damaged already. } //player is far from the object of interest, but still alive. } else { //player is dead. }