Home   Help Search Login Register  

Author Topic: how can i add ammo to crates?.....  (Read 1358 times)

0 Members and 1 Guest are viewing this topic.

Offline John

  • Members
  • *
how can i add ammo to crates?.....
« on: 17 Jul 2006, 22:22:09 »
I think I have to remove all the other wapons first dont I?...and how do I do that?

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: how can i add ammo to crates?.....
« Reply #1 on: 17 Jul 2006, 22:41:46 »
Hardly necessary :)

Adding ammo/weapons to crates or vehicles :

addweaponcargo

and for magazines

addmagazinecargo

Format is :

<unit> addweaponcargo  ["Weapon", #]

So, for instance

AmmoCrate addweaponCargo ["AK74", 5]; AmmoCrate addmagazinecargo ["AK74", 30]

Shadam. For full list of official weapon/magazine names, refer to the http://www.ofpec.com/COMREF/weapons.html list found there. :)

Good luck!

/Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline John

  • Members
  • *
Re: how can i add ammo to crates?.....
« Reply #2 on: 17 Jul 2006, 22:47:07 »
not working.....i add what you say and then get near to the ammo crate....and it only says take m16 and take hand grenade....and not what I have added....dont you have to remove what it has to begin with

Offline Cheetah

  • Former Staff
  • ****
Re: how can i add ammo to crates?.....
« Reply #3 on: 17 Jul 2006, 22:52:08 »
You don't have to remove what's already in the crate, I think that something went wrong and only the default M16 is present.

If you wish to clear the crate, type in its init:
Code: [Select]
removeAllWeapons this; clearMagazineCargo this;
To add an AK74 type:
Code: [Select]
this addweaponCargo ["AK74",1]; this addmagazinecargo ["AK74",1]
Hope that this works.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline SniperAndy

  • Members
  • *
    • VBS Community
Re: how can i add ammo to crates?.....
« Reply #4 on: 19 Jul 2006, 02:00:14 »
but this script in oyur mission folder and adjust it do your needs.
in the init line of your crate you put:
[this] exec ammo1.sqs

Quote
; *****************************************************
; ammo2: Loadout for AssaultTeam
; Contains Magazines from :
; CORE
; *****************************************************
; EXAMPLE:
; Type this code into the INITIALIZATION box of the crate.
; [this] Exec "ammo1.sqs"
; *****************************************************

clearmagazinecargo _this;
clearweaponcargo _this;

; Get the parameters given
_crate = _this Select 0

_crate AddWeaponCargo ["Steyr", 5]
_crate AddWeaponCargo ["M4ReflexSD", 5]
_crate AddWeaponCargo ["M4A1Acog", 5]
_crate AddWeaponCargo ["MK46", 5]
_crate AddWeaponCargo ["RPGLauncher", 5]
_crate AddWeaponCargo ["AALauncher", 5]


_crate AddMagazineCargo ["SteyrMag", 10]
_crate AddMagazineCargo ["M4ReflexSDMag", 10]
_crate AddMagazineCargo ["M4A1SilencedMag", 30]
_crate AddMagazineCargo ["M4A1Mag", 20]
_crate AddMagazineCargo ["MK46Mag", 20]
_crate AddMagazineCargo ["GrenadeLauncher", 30]
_crate AddMagazineCargo ["RPGLauncher", 20]
_crate AddMagazineCargo ["AALauncher", 10]
_crate AddMagazineCargo ["PipeBomb", 20]
_crate AddMagazineCargo ["Mine", 20]
EXIT

Offline Martin Kuka

  • Members
  • *
Re: how can i add ammo to crates?.....
« Reply #5 on: 10 Aug 2006, 19:22:29 »
Think this version of your script is quicker...

; *****************************************************
; ammo2: Loadout for AssaultTeam
; Contains Magazines from :
; CORE
; *****************************************************
; EXAMPLE:
; Type this code into the INITIALIZATION box of the crate.
; this Exec "ammo1.sqs"
; *****************************************************

clearmagazinecargo _this;
clearweaponcargo _this;

; Get the parameters given


_This AddWeaponCargo ["Steyr", 5]
_This  AddWeaponCargo ["M4ReflexSD", 5]
_This  AddWeaponCargo ["M4A1Acog", 5]
_This  AddWeaponCargo ["MK46", 5]
_This  AddWeaponCargo ["RPGLauncher", 5]
_This  AddWeaponCargo ["AALauncher", 5]


_This AddMagazineCargo ["SteyrMag", 10]
_This AddMagazineCargo ["M4ReflexSDMag", 10]
_This AddMagazineCargo ["M4A1SilencedMag", 30]
_This AddMagazineCargo ["M4A1Mag", 20]
_This AddMagazineCargo ["MK46Mag", 20]
_This AddMagazineCargo ["GrenadeLauncher", 30]
_This AddMagazineCargo ["RPGLauncher", 20]
_This AddMagazineCargo ["AALauncher", 10]
_This AddMagazineCargo ["PipeBomb", 20]
_This AddMagazineCargo ["Mine", 20]
EXIT

As this version doesnt need the initial array line.
Lets get rocked

PetriHonka

  • Guest
Re: how can i add ammo to crates?.....
« Reply #6 on: 12 Aug 2006, 16:08:59 »
you could just put in the init. field of the crate : this addWeaponCargo "WEAPONNAME , #"; this addMagazineCargo "MAGAZINENAME, #" this will put the specified weapons in the crate alongside the default loadout. The remove weapon script can go before the addweapon part t orem,ove default weapons. If you are adding satchel charges the weapon name is pipebomb.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re: how can i add ammo to crates?.....
« Reply #7 on: 12 Aug 2006, 17:51:41 »
If you wish to clear the crate, type in its init:
Code: [Select]
removeAllWeapons this; clearMagazineCargo this;
clearWeaponsCargo this, not removeAllWeapons this. :)

I'd use the init line as I reckon a script is a bit of an overkill. Just post what you wrote in the init line and we'll sort it out for you. :)