OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: SnakeFart on 08 Apr 2003, 01:14:38

Title: fill up amoo crates
Post by: SnakeFart on 08 Apr 2003, 01:14:38
im using a ranger mod and i want to know if its possible to add every weapon to an ammo crate without have to  to put  this addweapon...blah blah blah ..is there an init that will fill an ammo crate up completly?
Title: Re:fill up amoo crates
Post by: macguba on 08 Apr 2003, 01:36:09
Put this in init.sqs

"_x addmagazinecargo {M16,99}; _x addweapon {m16}" forEach [ammocrate1,ammocrate2]

Syntax even more unguaranteed than usual, as its late, but if you get the idea it will save you writing it out over and over again.
Title: Re:fill up amoo crates
Post by: SnakeFart on 08 Apr 2003, 02:40:15
ok where do i put that at? in Init or script?

sorry im new to all of this
Title: Re:fill up amoo crates
Post by: UberKreb on 08 Apr 2003, 02:43:47
Init field will be fine for executing it.
Title: Re:fill up amoo crates
Post by: SnakeFart on 08 Apr 2003, 02:56:18
and to executing it i have to make  it with not pad and then sve it as an sqs file right?...and what is the correct init to remove all weapons?

i have: this removeallweaspons;

but that then says error
Title: Re:fill up amoo crates
Post by: BHD Mod on 08 Apr 2003, 03:47:32
To remove all weapons from a unit type in the init field: removeallweapons this.
Title: Re:fill up amoo crates
Post by: SnakeFart on 08 Apr 2003, 04:03:16
ok so u put this after removeallweapons and not in front of it?...and do i do it in the same order to take out ammo?
Title: Re:fill up amoo crates
Post by: SnakeFart on 08 Apr 2003, 09:20:34
comeone plz soneone answer im stuck till i get a correct answer
Title: Re:fill up amoo crates
Post by: Artak on 08 Apr 2003, 09:41:04
removeallweapons this

in the init field will remove all weapons from the object in which init field the command is.

the vise versa method goes only for removeallweapons command. so if you do anything else you put in THIS in front of the command and not after like in this particular case.
Title: Re:fill up amoo crates
Post by: SnakeFart on 08 Apr 2003, 11:21:39
ok so to perfect it ...if i want to remove all the weapons from a person i type

removeallweapons this  and they wont have anything
Title: Re:fill up amoo crates
Post by: Artak on 08 Apr 2003, 11:24:50
 :oYou've got it!! :o   ;D ;)
Title: Re:fill up amoo crates
Post by: SnakeFart on 08 Apr 2003, 11:25:57
COOL

SOLVE!