Forum Jump :

Author Message


Posts: 3
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2015-01-16 23:47        
     
Hi I'm looking to make a custom supply drop for missions with my friends but i cant get the Crate init functions to work
clearMagazineCargoglobal _this]; [clearitemCargoglobal _this]; [clearWeaponCargoglobal _this] ;_[_this addweponcargoglobal ["ej_m107",5]]; [_this addmagazinecargoglobal ["Barret_mag",90];
this is what i'm using but the crate neither clears or adds the weapon and mags let me know what im doing wrong and if you could redirect me to a guide that would be appreciated as well


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 21
In-game name: Wak

 
#2 Posted at 2015-01-17 00:11        
     
Other than the syntax errors (Use of the "[" and "]" in the wrong places) your code is perfect.

Here is the fixed one:
clearMagazineCargoGlobal _this;
clearItemCargoGlobal _this;
clearWeaponCargoGlobal _this;
clearBackpackCargoGlobal _this;
_this addWeaponCargoGlobal ["ej_m107",5];
_this addMagazineCargoGlobal ["Barret_mag",90];

As for the guide, you can always check things about a scripting command (info, usage, example code) in the wiki here.
Ctrl + F will be one of your most valuable comrades!

Also, specifically for loadout editing; you can check LEA. You can easily use it and learn from the code it generates too.

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Advertisement


Author Message


Posts: 3
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2015-01-17 02:03        
     
Thanks for the reply i took out the [] in the wrong spots and it didn't work but i re-wrote the code and it started working so i don't know what was up.