Alright, I've had the time to test and update this baby. I've included a way to have user made guns integrated relatively easy. Now all I have left to do is figure out a way to add LAW's and the like.
To use: [unitname, "ModName"] exec "randomweapons.sqs" (Default ModName is "Default")
;Random Loadouts.... Originally by PsyWarrior
;Edited by Homefry
;To Use: [unitname, "modname"] exec "randomweapons.sqs"
;use [unitname, "Default"] exec "randomweapons.sqs" to use BIS Weapons only
_man = _this select 0
_mod = _this select 1
;Weapons are removed:
removeAllWeapons _man
;Determine what side the unit is on
?side _man == west : goto "westweapons"
?side _man == east : goto "eastweapons"
?side _man == resistance : goto "resistanceweapons"
?side _man == civilian : goto "civilianweapons"
;Add West Weapons:
#westweapons
;Format for Adding in Addon Weapons:
;?_mod == "MODNAME" : _primaryArray = ["GUN_CLASS_NAME_ONE", "GUN_CLASS_NAME_TWO", "ETC..."]
;?_mod == "MODNAME" : _BulletArray = ["MAG_CLASS_NAME_ONE", "GUN_CLASS_NAME_TOW", "ETC..."]
?_mod == "BAS" : _primaryArray = ["BAS_JM4ACOG", "BAS_JM4ACOGS", "BAS_JM4MKACOG", "BAS_JM4REFLEX", "BAS_JM4REFLEXS", "BAS_JM4ReflexM203", "BAS_JM4ReflexSM203", "BAS_JM4MKReflex", "BAS_JM4EOTech", "BAS_JM4EOTechS", "BAS_JM4EOTechM203", "BAS_JM4EOTechSM203", "BAS_JM4Aimpoint", "BAS_JM4AimpointS", "BAS_JM4AimpointM203", "BAS_JM4AimpointSM203", "BAS_JM14AIMPOINT", "BAS_JM14DMR", "BAS_JM24SWS", "BAS_JSR25", "BAS_JSR25S", "BAS_JMP5SDAimpoint", "BAS_JM249", "BAS_JM249SPW", "BAS_JM249SPWSD", "BAS_JM240B"]
?_mod == "BAS" : _BulletArray = ["JAM_W556_30mag", "JAM_W556_30SDmag", "JAM_W556_30mag", "JAM_W556_30mag", "JAM_W556_30SDmag", "JAM_W556_30mag", "JAM_W556_30mag", "JAM_W556_30mag", "JAM_W556_30mag", "JAM_W556_30SDmag", "JAM_W556_30mag", "JAM_W556_30mag", "JAM_W556_30mag", "JAM_W556_30SDmag", "JAM_W556_30mag", "JAM_W556_30SDmag", "JAM_W762_20mag", "JAM_W762_20mag", "JAM_W762_5mag", "JAM_W762Sniper_20Mag", "JAM_W762Sniper_20SDMag", "JAM_MP5SBASDmag", "JAM_W556M_200mag", "JAM_W556M_200mag", "JAM_W556M_200SDmag", "JAM_W762M_100mag"]
?_mod == "BAS" : goto "randomize"
?_mod == "MARPAT" : _primaryArray = ["C8XM16acog", "C8XM16cco", "C8XM16reflex", "C8XM16M203", "C8XM16M203acog", "C8XM16M203reflex", "C8XM16M203cco", "C8XM249", "C8XM249m145", "C8XM249PARA", "C8XM249PARAcco", "C8XM4", "C8XM4acog", "C8XM4reflex", "C8XM4cco", "C8XM4M203", "C8XM4M203cco", "C8XM4M203acog", "C8XM4M203reflex", "C8XM4_sd", "C8XM4acog_sd", "C8XM4reflex_sd", "C8XM4cco_sd", "C8XM4M203_sd", "C8XM4M203cco_sd", "C8XM4M203acog_sd", "C8XM4reflex_sd", "C8XM1014", "C8XM1014cco"]
?_mod == "MARPAT" : _BulletArray = ["c8xm16mag", "c8xm16mag", "c8xm16mag", "c8xm16mag", "c8xm16mag", "c8xm16mag", "c8xm16mag", "c8xm16mag", "c8xm249mag", "c8xm249mag", "c8xm249mag", "c8xm249mag", "c8xm4mag", "c8xm4mag", "c8xm4mag", "c8xm4mag", "c8xm4mag", "c8xm4mag", "c8xm4mag", "c8xm4mag", "c8xm4sdmag", "c8xm4sdmag","c8xm4sdmag","c8xm4sdmag","c8xm4sdmag","c8xm4sdmag","c8xm4sdmag","c8xm4sdmag", "c8xm1014mag", "c8xm1014mag"]
?_mod == "MARPAT" : goto "randomize"
_primaryArray = ["m16", "M60", "M4", "G36A", "FAL", "Steyr", "HKG3"]
_BulletArray = ["m16", "M60", "M4", "G36AMag", "FALMag", "SteyrMag", "HKG3Mag"]
goto "randomize"
#eastweapons
?_mod == "MARPAT" : _primaryArray = ["C8XAK74M", "C8XAK74Mcobra", "C8XAK74M1p29", "C8XAK74MGP25", "C8XAK74MGP25cobra", "C8XAK74MGP251p29", "C8XAK74M_SD", "C8XAK74Mcobra_SD", "C8XAK74M1p29_SD", "C8XAK74MGP25_SD", "C8XAK74MGP25cobra_SD", "C8XAK74MGP251p29_SD", "C8XRPK74M", "C8XRPK74M1p29", "C8XAKS74U", "C8XAKS74Ucobra", "C8XAKS74U_sd", "C8XAKS74Ucobra_sd", "C8XAKS74UBS1", "C8XAKS74UBS1cobra"]
?_mod == "MARPAT" : _BulletArray = ["c8xak74mag", "c8xak74mag", "c8xak74mag", "c8xak74mag", "c8xak74mag", "c8xak74mag", "c8xak74sdmag", "c8xak74sdmag", "c8xak74sdmag", "c8xak74sdmag", "c8xak74sdmag", "c8xak74sdmag", "c8xrpk74mag", "c8xrpk74mag", "c8xaks74umag", "c8xaks74umag", "c8xaks74usdmag", "c8xaks74usdmag", "c8xaks74usdmag", "c8xaks74usdmag"]
?_mod == "MARPAT" : goto "randomize"
_primaryArray = ["AK47", "AK74", "AK74SU", "PK"]
_BulletArray = ["AK47", "AK74", "AK74", "PK"]
goto "randomize"
#resistanceweapons
_primaryArray = ["AK47", "AK47CZ", "HuntingRifle", "PK", "FAL"]
_BulletArray = ["AK47", "AK47", "HuntingRifleMag", "PK", "FALMag"]
goto "randomize"
#civilianweapons
_primaryArray = ["Beretta", "CZ75", "Glock", "Ingram", "Revolver", "Skorpion", "Tokarev"]
_BulletArray = ["BerettaMag", "CZ75Mag", "GlockMag", "IngramMag", "RevolverMag", "SkorpionMag", "TokarevMag"]
goto "randomize"
;Generate random number based on number of elements in array.
#randomize
_random1 = 0
_n = 0
_n = count _primaryArray
_random1 = random _n
_random1 = _random1 - 1
?_random1 == 0 : goto "randomize"
?_random1 > _n : goto "randomize"
?_random1 < 0 : goto "randomize"
_ammo = _BulletArray select _random1
_primaryWeap = _primaryArray select _random1
_a = 0
goto "specialweapons"
;Weapons with speconday weapons go here:
;In this case, weapon's with M203's or similar were given two rounds
#specialweapons
?_a == 2: goto "loopstart"
?_mod == "BAS" && _primaryWeap == "BAS_JM4ReflexM203" : _man addMagazine "JAM_M433grenade"
?_mod == "BAS" && _primaryWeap == "BAS_JM4ReflexSM203" : _man addMagazine "JAM_M433grenade"
?_mod == "BAS" && _primaryWeap == "BAS_JM4EOTechM203" : _man addMagazine "JAM_M433grenade"
?_mod == "BAS" && _primaryWeap == "BAS_JM4EOTechSM203" : _man addMagazine "JAM_M433grenade"
?_mod == "BAS" && _primaryWeap == "BAS_JM4AimpointM203" : _man addMagazine "JAM_M433grenade"
?_mod == "BAS" && _primaryWeap == "BAS_JM4AimpointSM203" : _man addMagazine "JAM_M433grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XM16M203" : _man addMagazine "c8xm203grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XM16M203acog" : _man addMagazine "c8xm203grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XM4M203reflex" : _man addMagazine "c8xm203grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XM4M203_sd" : _man addMagazine "c8xm203grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XM4M203acog_sd" : _man addMagazine "c8xm203grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XM4M203reflex_sd" : _man addMagazine "c8xm203grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XM4M203cco_sd" : _man addMagazine "c8xm203grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XM16M203reflex" : _man addMagazine "c8xm203grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XM16M203cco" : _man addMagazine "c8xm203grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XM4M203" : _man addMagazine "c8xm203grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XM4M203cco" : _man addMagazine "c8xm203grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XM4M203acog" : _man addMagazine "c8xm203grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XAK74MGP25" : _man addMagazine "c8xgp25grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XAK74MGP25cobra" : _man addMagazine "c8xgp25grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XAK74MGP251p29" : _man addMagazine "c8xgp25grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XAK74MGP25_SD" : _man addMagazine "c8xgp25grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XAK74MGP25cobra_SD" : _man addMagazine "c8xgp25grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XAK74MGP251p29_SD" : _man addMagazine "c8xgp25grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XAKS74UBS1" : _man addmagazine "C8XBS1grenade"
?_mod == "MARPAT" && _primaryWeap == "C8XAKS74UBScobra" : _man addmagazine "C8XBS1grenade"
_a = _a + 1
goto "specialweapons"
#loopstart
;Give the unit his weapon and ammo
_man addmagazine _ammo
_man addmagazine _ammo
_man addmagazine _ammo
_man addmagazine _ammo
_man addWeapon _primaryWeap
~3
_b = _man hasWeapon _primaryWeap
?_b = 0 : goto "randomize"
exit
I've also included support for the BAS Delta/Rangers (v1.55) and the MARPAT Marines/RNI. ModName="BAS" or "MARPAT".