RonnieJ 10 Posted January 13, 2010 Hey... can anyone tell me why the following code aint working? It makes the crate but the content inside is the normal that comes with the crate... not empty'd and not with the new content inside?! :confused: if (!isServer) exitWith {}; _crate = "RUBasicAmmunitionBox" createVehicle (getMarkerPos "friendly"); // Remove the stock items from the crate clearMagazineCargo _crate; clearWeaponCargo _crate; // Add the items to the crate _crate addMagazineCargo ["FlareGreen_M203", 25]; _crate addMagazineCargo ["FlareRed_M203", 25]; _crate addMagazineCargo ["FlareWhite_M203", 25]; _crate addMagazineCargo ["FlareYellow_M203", 25]; Share this post Link to post Share on other sites
Ghost 40 Posted January 13, 2010 you might want to check these two commands out http://community.bistudio.com/wiki/processInitCommands http://community.bistudio.com/wiki/setVehicleInit Share this post Link to post Share on other sites
RonnieJ 10 Posted January 13, 2010 Im now sure how to incorporate thoose commands... Share this post Link to post Share on other sites
Ghost 40 Posted January 13, 2010 something like this. Might need tweaking if (!isServer) exitWith {}; _crate = "RUBasicAmmunitionBox" createVehicle (getMarkerPos "friendly"); _crate setvehicleinit "clearMagazineCargo this; clearWeaponCargo this; this addMagazineCargo ["FlareGreen_M203", 25]; this addMagazineCargo ["FlareRed_M203", 25]; this addMagazineCargo ["FlareWhite_M203", 25]; this addMagazineCargo ["FlareYellow_M203", 25];"; processInitCommands; sleep 1; clearVehicleInit _crate; Share this post Link to post Share on other sites
RonnieJ 10 Posted January 13, 2010 Ghost you are the man! :) works like a charm... could you possibly tell why it does hehe? :) trying to understand the damn thing :P Share this post Link to post Share on other sites
Ghost 40 Posted January 13, 2010 I just followed the examples from the wiki. Basically when you used _crate = "RUBasicAmmunitionBox" createVehicle .... _crate refers to the model and all kinds of stuff. if you want to know what im talking about put a hint in the script after the createvehicle command as follows hint format ["%1", _crate]; so since _crate is not technically the name of the object but what the object is you have to use the setvehicleinit command then process those commands via processinitcommands. Share this post Link to post Share on other sites