Home   Help Search Login Register  

Author Topic: Ammo Crates - Autoloading SQS  (Read 1606 times)

0 Members and 1 Guest are viewing this topic.

Offline satexas69

  • Members
  • *
Ammo Crates - Autoloading SQS
« on: 27 Feb 2007, 04:39:54 »
In the OPF, I used to use this very neat script that would auto-load all my crates for me - which is beyond badass for large maps with lots of crates you'd like to "auto-load".

My question is this : Is this syntax still correct, and is it still EAST and WEST?

Also, if anyone has an updated guns and weapon list, I'd be grateful!


Code: [Select]
; **********************************************************************
; **** Adds lots of goodies to a regular crate.
; ****
; **** 4 parameters needed:
; **** 1. Crate to receive goodies.  (Object)
; **** 2. Side crate is for. ("EAST", "WEST") (String)
; **** 3. Weapons to add. ("GUNS", "ROCKETS", "ALL", "NONE") (String)
; **** 4. Add extra equipment. ("YES", "NO") (String)
; ****
; **** EXAMPLE:
; **** Type this code into the INITIALIZATION box of the crate.
; **** [this, "WEST", "ALL", "YES"] Exec "ammo.sqs"
; ****      [this, "WEST", "ROCKETS", "NO"] Exec "ammo.sqs"
; ****
; **********************************************************************

; Get the parameters given
_crate = _this Select 0
_side = _this Select 1
_weapons = _this Select 2
_equip = _this Select 3

; Check for equipment only
?(_weapons == "NONE"): Goto "AddEquip"

; Add the proper East or West goodies
?(_side == "EAST"): Goto "AddGunsEast"


; **********************************************************************
; **** West weapons
; **********************************************************************

#AddGunsWest
; Add the guns and ammo to the crate
?(_weapons == "ROCKETS"): Goto "AddRocketsWest"
ClearWeaponCargo _crate
ClearMagazineCargo _crate
_crate AddWeaponCargo ["M4", 25]
_crate AddMagazineCargo ["M4", 25]
_crate AddWeaponCargo ["M60", 25]
_crate AddMagazineCargo ["m60", 20]
_crate AddWeaponCargo ["G36a", 50]
_crate AddMagazineCargo ["G36aMag", 50]
_crate AddWeaponCargo ["M21", 50]
_crate AddMagazineCargo ["M21", 50]
_crate AddWeaponCargo ["SVDDragunov", 15]
_crate AddMagazineCargo ["SVDDragunov", 15]
_crate AddWeaponCargo ["Steyr", 50]
_crate AddMagazineCargo ["SteyrMag", 50]
_crate AddWeaponCargo ["XMS", 25]
_crate AddWeaponCargo ["KEGAK107", 50]
_crate AddMagazineCargo ["kegak107mag", 50]


#AddRocketsWest
; Add the rockets and ammo to the crate
?(_weapons == "GUNS"): Goto "AddEquip"
ClearWeaponCargo _crate
ClearMagazineCargo _crate
_crate AddWeaponCargo ["Binocular", 25]
_crate AddWeaponCargo ["HandGrenade", 25]
_crate AddWeaponCargo ["NVGoggles", 25]
_crate AddMagazineCargo ["PipeBomb", 25]
_crate AddMagazineCargo ["Mine", 25]
_crate AddWeaponCargo ["LAWLauncher", 15]
_crate AddMagazineCargo ["LAWLauncher", 15]
_crate AddWeaponCargo ["rpglauncher", 15]
_crate AddMagazineCargo ["rpglauncher", 15]
_crate AddWeaponCargo ["AALauncher", 15]
_crate AddMagazineCargo ["AALauncher", 15]
_crate AddMagazineCargo ["Flare", 30]
_crate AddMagazineCargo ["FlareRed", 15]
_crate AddMagazineCargo ["FlareGreen", 15]
_crate AddMagazineCargo ["FlareYellow", 15]
_crate AddMagazineCargo ["HandGrenade", 15]
_crate AddWeaponCargo ["LaserDesignator", 10]
_crate AddMagazineCargo ["LaserDesignator", 50]
Goto "AddEquip"



; **********************************************************************
; **** East weapons
; **********************************************************************

#AddGunsEast
; Add the guns and ammo to the crate
?(_weapons == "ROCKETS"): Goto "AddRocketsEast"
_crate AddWeaponCargo ["6G30", 10]
_crate AddWeaponCargo ["AK47", 10]
_crate AddWeaponCargo ["AK47CZ", 10]
_crate AddWeaponCargo ["AK47GrenadeLauncher", 10]
_crate AddWeaponCargo ["AK74", 10]
_crate AddWeaponCargo ["AK74GrenadeLauncher", 10]
_crate AddWeaponCargo ["AK74SU", 10]
_crate AddWeaponCargo ["Bizon", 10]
_crate AddWeaponCargo ["Kozlice", 10]
_crate AddWeaponCargo ["PK", 10]
_crate AddWeaponCargo ["SVDDragunov", 50]
_crate AddWeaponCargo ["Skorpion", 50]
_crate AddWeaponCargo ["Tokarev", 50]
_crate AddMagazineCargo ["6G30Magazine", 50]
_crate AddMagazineCargo ["AK47", 50]
_crate AddMagazineCargo ["AK74", 50]
_crate AddMagazineCargo ["BizonMag", 50]
_crate AddMagazineCargo ["GrenadeLauncher", 50]
_crate AddMagazineCargo ["KozliceBall", 50]
_crate AddMagazineCargo ["KozliceShell", 50]
_crate AddMagazineCargo ["PK", 50]
_crate AddMagazineCargo ["SVDDragunov", 50]
_crate AddMagazineCargo ["SkorpionMag", 50]
_crate AddMagazineCargo ["TokarevMag", 50]

#AddRocketsEast
; Add the rockets and ammo to the crate
?(_weapons == "GUNS"): Goto "AddEquip"
_crate AddWeaponCargo ["9K32Launcher", 10]
_crate AddWeaponCargo ["AT4Launcher", 10]
_crate AddWeaponCargo ["RPGLauncher", 10]
_crate AddMagazineCargo ["9K32Launcher", 50]
_crate AddMagazineCargo ["AT4Launcher", 50]
_crate AddMagazineCargo ["RPGLauncher", 50]



; **********************************************************************
; **** Equipment
; **********************************************************************

#AddEquip
; Add the equiptment to the crate
?(_equip == "NO"): Goto "Exit"
_crate AddWeaponCargo ["HandGrenade", 50]
_crate AddWeaponCargo ["Binocular", 25]
_crate AddWeaponCargo ["NVGoggles", 25]
_crate AddWeaponCargo ["Flare", 25]
_crate AddMagazineCargo ["SmokeShell", 25]
_crate AddMagazineCargo ["PipeBomb", 25]
_crate AddMagazineCargo ["Mine", 25]
Exit

#Exit
Exit

Offline satexas69

  • Members
  • *
Re: Ammo Crates - Autoloading SQS
« Reply #1 on: 27 Feb 2007, 05:32:04 »
I think I just solved my problem.

I found this script, and added "COMMENTS" to the top so you k now how to use it. Very creative.

I called this "ammobox_1.sqs" and have it in a sub-directory in my mission called "reload".

To whoever orig wrote this - thank you.

Code: [Select]
; TO use this, put this in INIT:
;
; [ammobox_1] exec "reload\ammobox_1.sqs
;
; and put this as it's NAME:
;
; [ammobox_1]
;
; Increment the ammobox tag for each individual box: IE: [ammobox_2]... [ammobox_5]...


; Get the crate parameter given
_crate = _this Select 0

; Remove the stock items from the crate
ClearMagazineCargo _crate
ClearWeaponCargo _crate

; Add the items to the crate
_crate addweaponcargo ["M9",10]
_crate addweaponcargo ["M9SD",10]
_crate addweaponcargo ["M16A2",10]
_crate addweaponcargo ["M16A2GL",10]
_crate addweaponcargo ["M4",10]
_crate addweaponcargo ["M4A1SD",10]
_crate addweaponcargo ["M4GL",10]
_crate addweaponcargo ["M4A1",10]
_crate addweaponcargo ["M4A1GL",10]
_crate addweaponcargo ["M4AIM",10]
_crate addweaponcargo ["M4SPR",10]
_crate addweaponcargo ["G36a",10]
_crate addweaponcargo ["g36c",10]
_crate addweaponcargo ["g36k",10]
_crate addweaponcargo ["m24",10]
_crate addweaponcargo ["mp5A5",10]
_crate addweaponcargo ["MP5SD",10]
_crate addweaponcargo ["M240",10]
_crate addweaponcargo ["M249",10]
_crate addweaponcargo ["Stinger",10]
_crate addweaponcargo ["M136",10]
_crate addweaponcargo ["Laserdesignator",10]
_crate addweaponcargo ["Binocular",10]
_crate addweaponcargo ["NVGoggles",10]
_crate addmagazinecargo ["Handgrenade",10]
_crate addmagazinecargo ["Smokeshell",10]
_crate addmagazinecargo ["Smokeshellred",10]
_crate addmagazinecargo ["Smokeshellgreen",10]
_crate addmagazinecargo ["30Rnd_9x19_MP5",50]
_crate addmagazinecargo ["30Rnd_9x19_MP5SD",50]
_crate addmagazinecargo ["15Rnd_9x19_M9",50]
_crate addmagazinecargo ["15Rnd_9x19_M9SD",50]
_crate addmagazinecargo ["30Rnd_556x45_Stanag",50]
_crate addmagazinecargo ["30Rnd_556x45_G36",50]
_crate addmagazinecargo ["200Rnd_556x45_M249",50]
_crate addmagazinecargo ["5Rnd_762x51_M24",50]
_crate addmagazinecargo ["100Rnd_762x51_M240",50]
_crate addmagazinecargo ["FlareWhite_M203",50]
_crate addmagazinecargo ["FlareGreen_M203",50]
_crate addmagazinecargo ["FlareRed_M203",50]
_crate addmagazinecargo ["FlareYellow_M203",50]
_crate addmagazinecargo ["1Rnd_HE_M203",50]
_crate addmagazinecargo ["M136",20]
_crate addmagazinecargo ["Stinger",10]
_crate addmagazinecargo ["Pipebomb",10]
_crate addmagazinecargo ["Mine",10]
_crate addmagazinecargo ["Laserbatteries",10]

Exit