_tank = _this select 0
_driver = driver _tank
_gunner = gunner _tank
_commander = commander _tank
_cargo = crew _tank - [_commander,_gunner,_driver]
#loop
?!_driver in _tank:_driver moveindriver _tank
?!_gunner in _tank:_gunner moveingunner _tank
?!_commander in _tank:__commander moveincommander _tank
?!"_x in _tank" foreach _cargo:_x moveincargo _tank
~.5
?unlocked = true:goto "end"
?!alive _tank:goto "end"
goto "loop"
#end
exit
you would exec this script when you want it to be locked, using some kind of trigger, howerver you want it to be activated,
[nameoftank] exec "thisScript.sqs"
it checks for a condition called unlocked to end the script if you want them to be able to get out again,
you would use a trigger and however you want it to happen, in activation you put: unlocked = true
and that will cause the script to end
also, this line may not work:
?!"_x in _tank" foreach _cargo:_x moveincargo _tank
i've never used the foreach command like that before, but it should work, if not the script would have to be changed