I worked a little with this system and I reached the conclusion:
1. does not have to check if player has grenade's/satchels because inventory of player is a little too small (need to have grenades at the expense of ammunition)
2. Tank does not have to be destroyed, enough to be immobilized
3. Crew can die from the overloading of explosion strength even if tank is not destroyed
4. Time is displayed for an explosion (in upper right corner)*
I a little worked on this system and i present this:
Check.sqs
; *****************************************************
; ** Check.sqs this script will check distance player and object to blow up
; ** Written by guziczek101 for Operation "Neptune" mission
; ** [object,distance,true/false] exec "Skrypty\Efekty\Check.sqs"
; *****************************************************
_gun = _this select 0
_dis = _this select 1
_random = _this select 2
_checkarray = []
#loop
?(player distance _gun) < _dis && !(_gun in _checkarray): destroy = _gun addaction ["Place Charge","stickybomb.sqs"]; _checkarray = _checkarray + [_gun]
?(player distance _gun) > _dis : _gun removeaction destroy; _checkarray = _checkarray - [_gun]
?(!(alive player) || !(alive _gun)) : exit
~0.5
goto "loop"
Stickybomb.sqs
; *****************************************************
; ** Stickybomb.sqs this script will blow up the object
; ** Written by guziczek101 for Operation "Neptune" mission
; ** Script is called from Check.sqs
; *****************************************************
_gun = _this select 0
?(!(alive _gun)) : exit
TimeisUp = FALSE
_dam = Getdammage _gun
player switchmove "CombatToMedic"
~5
player say "Eng29"
player sidechat "Lookout"
player switchmove "MedicToCombat"
[] exec "CountD.sqs"
~10
?TimeIsUp : goto "RDamage";
#RDamage
_nrand = random(10)
?_nrand >= 7: goto "KILL2"
?_nrand >= 3: goto "KILL3"
?_nrand >= -10: goto "KILL1"
#kill1
_gun setdammage (_dam + 0.5)
playsound "Explo"
goto "fire"
exit
#kill2
_gun setdammage (_dam + 1)
playsound "Explo"
goto "fire"
exit
#kill3
_gun setdammage (_dam + 0.7)
playsound "Explo"
goto "fire"
exit
#fire
_smoke= "SmokeShell" CamCreate [0,0,0]
_smoke setpos getpos _gun
_color2 = [0.009, 0.00,0,0.99]
_whitereal = [0,0,0,0]
_shell = "Shell105" CamCreate [0, 0, 0]
_shell setpos getpos _gun
drop ["cl_basic", "", "Billboard", 1, 5, [0,3,0], [0,0,0], 0, 1.1, 1, 0.5, [Random 7, 9, 15],[_color2, _color2, _color2, _whitereal],[0],0.2,0.6,"","",_shell]
~3
deletevehicle _smoke
goto "Randomkill"
#Randomkill
_random = true
_maxkills = 3
?count _this == 2: _random = _this select 2; _maxkills = 4
?count _this == 3: _random = _this select 2; _maxkills = _this select 3
; now the randomkills
_crew = crew _gun
_c = count _crew
_i = 0
_kills = 0
#crew
_unit = _crew select _i
?random 1 > 0.8 && _unit != player : _unit setdammage (random 1)
?random 1 > 0.8 && _unit != player && _kills < _maxkills : _unit setdammage 1; _kills = _kills + 1
_i = _i + 1
?_i < _c : goto "crew"
exit
CountD.sqs
; *****************************************************
; ** CountD.sqs
; *****************************************************
Counting=true
_timeRSC = 10
#COUNTDOWN
?_timeRSC >= 100 : TitleRSC [format ["%1",_timeRSC],"PLAIN"]
?_timeRSC < 100 && _timeRSC >= 10 : TitleRSC [format ["0%1",_timeRSC],"PLAIN"]
?_timeRSC < 10 : TitleRSC [format ["00%1",_timeRSC],"PLAIN"]
_timeRSC = _timeRSC - 1
?_timeRSC == 010 : _timeRSC = 000
?_timeRSC == -1 : TimeIsUp = True; Exit
~1
?alive player and Counting : Goto "COUNTDOWN"
Exit
Demo Mission* The countdown script is not mine it's from the CSLA 2 mission Poison Island (I hope this is not offended anyone, but really wanted to have the counter to keep the climate,yet it is not what I wanted, watch such as in Call of Duty 2 / Medal of Honor )