Im unfamiliar with the syntax of Arma. But here is what i believe you need to do.
It is only Pseudocode.
//"_________" signifies spaces.
/**
*The following are variables that will be used as a timer, and
*to stop the timer and reset.
*/
int counter // <type> <identifier>
boolean stop = false //This needs to be global, will be used in the remove script.
/**
*Your First if statment should check if the player is blufor.
*If player is, execute the code. If not, display to user
*they are unable to execute and dnt execute the code.
*/
if (player is blufor) then //Check if player is blufor
_____removeAction //Remove plant action from the crate.
_____this.addaction(remove charge) //Add the remove action to crate.
_____while ((counter <= 40) and (!stop)) then
____________counter = counter + 1
_____if (counter == 40) then //40 is the time it takes to have the charge go off.
__________//BLOW UP THE CRATE.
__________removeAction(removecharge) //Get rid of this option.
__________counter = 0
_____else
__________//The charger was diffused because stop was set to true from removecharge script.
__________removeAction(removecharge)
__________addAction(plantcharge)
__________counter = 0
else //if player is opfor
____//display to player this is not possible.
---------- Post added at 15:04 ---------- Previous post was at 14:43 ----------
Remove Script Pseuocode.
/**
*Check if opfor. Set a disarmant time(sleep). set stop to true.
*/
int disarment = 5
int count = 0
if (player is opfor) then //Check if player is opfor
_____while ((player is alive) and (count <= disarment)
__________count = count + 1 //time it takes to disarm
_____if (count = disarment)
__________stop = true //stop the countdown
__________removeAction(removeCharge)
__________addAction(plantCharge)
_____else
__________count = 0 //restart counter because player was killed.
else //if player is bluefor
_____//display to player this is not possible.