Use the same system to un-arm and rearm them, there is no need for triggers
Place the following in the INIT field of each unit you want to arm
[this "LABELNAME"] exec "Rearm.sqs"using the following example will rearm the unit with the MGUNNER loadout ( eg #MGUNNER)
[this "MGUNNER"] exec "Rearm.sqs"REARM.SQS_unit = _this select 0
_label = _this select 1
removeallweapons _unit
goto _label
#SNIPER
{_unit addMagazine _x} forEach ["SVDDragunov", "SVDDragunov", "SVDDragunov", "SVDDragunov"]
{_unit addWeapon _x} forEach ["SVDDragunov", "Binocular"]
_unit selectweapon "SVDDragunov"
exit
#OFFICER
{_unit addMagazine _x} forEach ["AK74","AK74", "AK74", "AK74", "Grenadelauncher", "Grenadelauncher", "Smokeshellred"]
{_unit addWeapon _x} forEach ["AK74GrenadeLauncher", "Binocular","NVGoggles"]
;;; NB>> selecting muzzle fire from the AK74 GL
_unit selectweapon "AK74Muzzle"
exit
#MGUNNER
{_unit addMagazine _x} forEach ["PK", "PK", "PK"]
{_unit addWeapon _x} forEach ["PK"]
_unit selectweapon "PK"
exit
#RPG
{_unit addMagazine _x} forEach ["AK74","AK74", "AK74", "AK74", "RPGlauncher", "RPGlauncher"]
{_unit addWeapon _x} forEach ["AK74", "RPGLauncher"]
_unit selectweapon "AK74"
exit
ALTERNATIVELYstill create the "REARM.sqs, but use it as a reference text file and then simply do the following
lets say we wanted to rearm the RPG guy with our exisiting RPG loadout from the above example
so we have the code
#RPG
{_unit addMagazine _x} forEach ["AK74","AK74", "AK74", "AK74", "RPGlauncher", "RPGlauncher"]
{_unit addWeapon _x} forEach ["AK74", "RPGLauncher"]
_unit selectweapon "AK74"
now what we can do, is combine all this together and place it all in the INIT field of the UNIT, this will then allow you to see the unit's loadout in the briefing stage (Gear tab) of the notebook
so we do the following
___ STAGE 1 ___edit the Label, adding an additional line of code and a semi colon after each statement
(all aditions highlighted in red
eg
#RPG
removeallweapons this ;
{_unit addMagazine _x} forEach ["AK74","AK74", "AK74", "AK74", "RPGlauncher", "RPGlauncher"] ;
{_unit addWeapon _x} forEach ["AK74", "RPGLauncher"] ;
_unit selectweapon "AK74"
___ STAGE 2 ___we now copy everything, apart from the #RPG into the INIT field of the UNIT
example
removeallweapons this ;
{_unit addMagazine _x} forEach ["AK74","AK74", "AK74", "AK74", "RPGlauncher", "RPGlauncher"] ;
{_unit addWeapon _x} forEach ["AK74", "RPGLauncher"] ;
_unit selectweapon "AK74"
over a period of time (making missions) your REARM.txt will increase, containing a miriad of custom loadouts that can then quickly be copied into your units init field for every mission