opendome 91 Posted February 25, 2015 Did they change the "this addweaponcargo ["name", amount];" system? I'm trying to add task force 47's maaws but it just doesn't want to work. It also won't let me clear the inventory of any vehicles either. Thanks! Share this post Link to post Share on other sites
opendome 91 Posted February 26, 2015 how do people add items to their vehicles through their inits? Share this post Link to post Share on other sites
jandrews 116 Posted February 26, 2015 for coop i use global https://community.bistudio.com/wiki/addItemCargoGlobal https://community.bistudio.com/wiki/clearItemCargoGlobal scroll down on either and see additional info. it will have several different options to use. Share this post Link to post Share on other sites
opendome 91 Posted February 26, 2015 Thanks bud! So in the vehicles init I should put (without quaotations) "addWeaponCargoGlobal [t47_maaws, 1]"? and then use ; to separate multiples like usual right? Thanks again! Share this post Link to post Share on other sites
Larrow 2823 Posted February 26, 2015 Weapon class name needs to be in quotes.. this addWeaponCargoGlobal ["t47_maaws", 1] Share this post Link to post Share on other sites
L3TUC3 32 Posted February 26, 2015 Wrap it in a server check while you're at it. if (isServer) then { this addWeaponCargoGlobal ["tf47_maaws",1]; }; Otherwise every jip player will add a maaws to the vehicle. Share this post Link to post Share on other sites
opendome 91 Posted February 26, 2015 thanks for the help guys! Unfortunately I haven't had any luck yet, also I have the correct spelling for the maaws, I just tossed what I thought it was quickly to see the format. I tried putting them each into the vehicle initialization field in the editor. I used to do this all the time in arma 2 and it was so easy lol Share this post Link to post Share on other sites
naizarak 4 Posted February 26, 2015 add this to the init if (isServer) then { clearMagazineCargoGlobal this; clearWeaponCargoGlobal this; clearItemCargoGlobal this; clearBackpackCargoGlobal this; this addWeaponCargoGlobal ["tf47_m3maaws", 1]; }; Share this post Link to post Share on other sites
opendome 91 Posted February 26, 2015 Thanks for the help! Unfortunately that doesn't seem to work either :( Share this post Link to post Share on other sites
epicgoldenwarrior 11 Posted February 26, 2015 They should work. Place your full init here, cause sometimes grammar/coding mistakes can wreck an entire script. Share this post Link to post Share on other sites
opendome 91 Posted February 26, 2015 So to be clear Im referring to the code used to add weapons to the inventory of a vehicle through its initialization field in the empty unit, in the editor. (just in case there s any confusion). Right now my exact code is if (isServer) then { clearMagazineCargoGlobal this; clearWeaponCargoGlobal this; clearItemCargoGlobal this; clearBackpackCargoGlobal this; this addWeaponCargoGlobal ["tf47_m3maaws", 1]; }; Share this post Link to post Share on other sites
epicgoldenwarrior 11 Posted February 26, 2015 did you try it with a default weapon in game? aka a non mod wep? Just to make sure its working Share this post Link to post Share on other sites
opendome 91 Posted February 27, 2015 I just tried it with the vanilla mx and it didnt work either :( Share this post Link to post Share on other sites
fight9 14 Posted February 27, 2015 Are you using some kind of respawn script or module on the vehicle? Share this post Link to post Share on other sites
BadHabitz 235 Posted February 27, 2015 if (isServer) then { clearMagazineCargoGlobal _this; clearWeaponCargoGlobal _this; clearItemCargoGlobal _this; clearBackpackCargoGlobal _this; _this addWeaponCargoGlobal ["tf47_m3maaws", 1]; }; Share this post Link to post Share on other sites
opendome 91 Posted February 27, 2015 if (isServer) then { clearMagazineCargoGlobal _this; clearWeaponCargoGlobal _this; clearItemCargoGlobal _this; clearBackpackCargoGlobal _this; _this addWeaponCargoGlobal ["tf47_m3maaws", 1]; }; that doesn't work either unfortunately :( I just don't get it, and apparently the class name is correct so I dunno. The only re spawn for vehicles i have is the vanilla arma vehicle re-spawn module synced to the vehicles. Share this post Link to post Share on other sites
fight9 14 Posted February 27, 2015 (edited) Well there lies your problem. The module is probably respawning the vehicle at the start of the mission... "Forced Respawn". Put this under the "expression" field in the modules window. This will run every time the vehicle respawns. if (isServer) then { (_this select 0) spawn { clearMagazineCargoGlobal _this; clearWeaponCargoGlobal _this; clearItemCargoGlobal _this; clearBackpackCargoGlobal _this; _this addWeaponCargoGlobal ["tf47_m3maaws", 1]; }; }; Confirmed to work with forced respawn. Edited February 27, 2015 by Fight9 Share this post Link to post Share on other sites
opendome 91 Posted February 27, 2015 weird its not working either :( I tired putting both "Forced Respawn" and Forced Respawn in the expression field (but I also had forced respawn enabled in the drop down option if that matters?) My description looks like class header { gametype = COOP; minplayers = 1; maxplayers = 19; }; Onloadmission = "Operation FOXHOUND"; OnLoadMissionTime = True; respawn = "BASE"; respawndelay = 30; disabledAI=true; #include "ASORGS\menu.hpp" class CfgFunctions { #include "ASORGS\cfgfunctions.hpp" }; #include "ATM_airdrop\dialog.hpp" class CfgSounds { sounds[] = {Vent,Vent2,Para}; class Vent {name="Vent";sound[]={ATM_airdrop\data\Vent.ogg,db-11,1.0};titles[] = {};}; class Vent2 {name="Vent2";sound[]={ATM_airdrop\data\Vent2.ogg,db-11,1.0};titles[] = {};}; class Para {name="Para";sound[]={ATM_airdrop\data\parachute.ogg,db-11,1.0};titles[] = {};}; }; but I just cant figure out why this is working Share this post Link to post Share on other sites
fight9 14 Posted February 27, 2015 (edited) Um, put the code I posted in the expression field, not the words "forced respawn"... thats just the option I was talking about that was causing your issue. youre silly dude lol To clarify, FORCED RESPAWN: ENABLED EXPRESSION: if (isServer) then { (_this select 0) spawn { clearMagazineCargoGlobal _this; clearWeaponCargoGlobal _this; clearItemCargoGlobal _this; clearBackpackCargoGlobal _this; _this addWeaponCargoGlobal ["tf47_m3maaws", 1]; }; }; Now, when the mission starts, the vehicle will automatically respawn, running the code above from the expression field. You can leave the vehicle INIT blank, because it wont apply. Edited February 27, 2015 by Fight9 Share this post Link to post Share on other sites
opendome 91 Posted February 27, 2015 Oh whoops lol. I just tried it and it didnt work either :( Share this post Link to post Share on other sites
naizarak 4 Posted February 27, 2015 the init code should work, there's something else in your mission conflicting with it. upload your mission for us Share this post Link to post Share on other sites