OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: B-2-0 on 18 May 2003, 15:06:51

Title: Ammo crate script
Post by: B-2-0 on 18 May 2003, 15:06:51
Hi guys, just a quick one!

Instead of typing all the weapons i want to add to an ammo crate into it's init field.....is it possible to create a script, for example, ammocrate.sqs, type all the lines in there and just have [] exec ammocrate.sqs in the init field??

Thanx in advance! :thumbsup:
Title: Re:Ammo crate script
Post by: macguba on 18 May 2003, 18:43:30
yup

you might want to use

this exec ammocrate.sqs
Title: Re:Ammo crate script
Post by: B-2-0 on 18 May 2003, 20:04:46
Thanks for your reply Mac.....i just found out i have to use a seperate script for each crate tho.....not a major problem but is there a way round this??
Title: Re:Ammo crate script
Post by: Knut Erik on 18 May 2003, 20:31:13
Yes it is. Add this on the top of your script.

_crate = _this select 0

Then use _crate everywhere like this.

_crate addweaponcargo xxxx
_crate addmagazinecargo xxxx

U got it ?  ;) :D