Freddan962 1 Posted March 14, 2013 Hello, For some reason my ammo crate script doesn't want to fill the ammo crate with items that I executed it upon. Any help would be appreciated! http://pastebin.com/W8tL7vJ0 Cheers, Fred. Share this post Link to post Share on other sites
Freddan962 1 Posted March 15, 2013 Please, I can't figure this out on my own. Share this post Link to post Share on other sites
CR-4267 Dutch 1 Posted March 15, 2013 Does it give you an error of some sort? Share this post Link to post Share on other sites
tryteyker 28 Posted March 15, 2013 Execution is of importance here. How do you call the script? Is it supposed to be working n MP? Share this post Link to post Share on other sites
loyalguard 15 Posted March 15, 2013 From looking at the paste bin, it appears thay you are putting all of that code in the crate's init line. Is that correct? If so, there are probably formatting issues. So you have -showScriptErrors enabled? Share this post Link to post Share on other sites
Gunter Severloh 4020 Posted March 15, 2013 Your missing the underscore--> _ you want to do it like this: if isnull _this exitwith {}; clearweaponcargo _this; clearmagazinecargo _this; _this addweaponcargo ["srifle_EBR_F",12]; _this addweaponcargo ["LMG_Mk200_F",12]; _this addweaponcargo ["arifle_MXC_F",12]; _this addweaponcargo ["arifle_MX_F",12]; _this addweaponcargo ["arifle_MX_GL_F",12]; _this addweaponcargo ["arifle_MX_SW_F",12]; _this addweaponcargo ["arifle_MXM_F",12]; _this addweaponcargo ["arifle_SDAR_F",12]; _this addweaponcargo ["arifle_TRG21_F",12]; _this addweaponcargo ["arifle_TRG20_F",12]; _this addweaponcargo ["arifle_TRG21_GL_F",12]; _this addweaponcargo ["arifle_TRG20_F",12]; _this addmagazinecargo ["20Rnd_762x45_Mag", 100]; _this addmagazinecargo ["16Rnd_9x21_Mag", 100]; _this addmagazinecargo ["30Rnd_9x21_Mag", 100]; _this additemcargo ["optic_Aco", 12; _this additemcargo ["optic_Hamr", 12]; _this additemcargo ["optic_Holosight", 12]; _this additemcargo ["acc_flashlight", 12]; _this additemcargo ["acc_pointer_IR", 12]; _this additemcargo ["U_B_CombatUniform_mcam", 12]; _this additemcargo ["U_B_CombatUniform_mcam_tshirt", 12]; _this additemcargo ["U_B_CombatUniform_mcam_vest", 12]; _this additemcargo ["H_HelmetB", 12]; _this additemcargo ["H_HelmetB_light", 12]; _this additemcargo ["H_HelmetB_paint", 12]; _this additemcargo ["V_PlateCarrier1_rgr", 12]; _this additemcargo ["V_PlateCarrier2_rgr", 12]; _this additemcargo ["V_PlateCarrierGL_rgr", 12]; _this addbackpackcargo ["B_AssaultPack_ocamo", 12]; _this addbackpackcargo ["B_Kitbag_sgg", 12]; _this additemcargo ["FirstAidKit", 100]; _this additemcargo ["Medikit", 100]; _this addweaponcargo ["A3_Weapons_F_Launchers_NLAW", 20]; _this addmagazinecargo ["NLAW_F", 100]; _this addmagazinecargo ["100Rnd_65x39_caseless_mag_Tracer", 100]; _this addmagazinecargo ["30Rnd_65x39_caseless_mag_Tracer", 100]; _this addmagazinecargo ["200Rnd_65x39_cased_Box_Tracer", 100]; _this addmagazinecargo ["30Rnd_65x39_caseless_mag", 50]; _this addmagazinecargo ["100Rnd_65x39_caseless_mag", 50]; Put this code only in the init of your ammo box which will call the script: _dummy = this execvm "ammo.sqf"; ammo.sqf is the name of the script, if its something else then put that in between the quotes instead. Be sure the script is in the same folder as the mission, same place the mission.sqm is at. Share this post Link to post Share on other sites
Freddan962 1 Posted March 15, 2013 Your missing the underscore--> _you want to do it like this: if isnull _this exitwith {}; clearweaponcargo _this; clearmagazinecargo _this; _this addweaponcargo ["srifle_EBR_F",12]; _this addweaponcargo ["LMG_Mk200_F",12]; _this addweaponcargo ["arifle_MXC_F",12]; _this addweaponcargo ["arifle_MX_F",12]; _this addweaponcargo ["arifle_MX_GL_F",12]; _this addweaponcargo ["arifle_MX_SW_F",12]; _this addweaponcargo ["arifle_MXM_F",12]; _this addweaponcargo ["arifle_SDAR_F",12]; _this addweaponcargo ["arifle_TRG21_F",12]; _this addweaponcargo ["arifle_TRG20_F",12]; _this addweaponcargo ["arifle_TRG21_GL_F",12]; _this addweaponcargo ["arifle_TRG20_F",12]; _this addmagazinecargo ["20Rnd_762x45_Mag", 100]; _this addmagazinecargo ["16Rnd_9x21_Mag", 100]; _this addmagazinecargo ["30Rnd_9x21_Mag", 100]; _this additemcargo ["optic_Aco", 12; _this additemcargo ["optic_Hamr", 12]; _this additemcargo ["optic_Holosight", 12]; _this additemcargo ["acc_flashlight", 12]; _this additemcargo ["acc_pointer_IR", 12]; _this additemcargo ["U_B_CombatUniform_mcam", 12]; _this additemcargo ["U_B_CombatUniform_mcam_tshirt", 12]; _this additemcargo ["U_B_CombatUniform_mcam_vest", 12]; _this additemcargo ["H_HelmetB", 12]; _this additemcargo ["H_HelmetB_light", 12]; _this additemcargo ["H_HelmetB_paint", 12]; _this additemcargo ["V_PlateCarrier1_rgr", 12]; _this additemcargo ["V_PlateCarrier2_rgr", 12]; _this additemcargo ["V_PlateCarrierGL_rgr", 12]; _this addbackpackcargo ["B_AssaultPack_ocamo", 12]; _this addbackpackcargo ["B_Kitbag_sgg", 12]; _this additemcargo ["FirstAidKit", 100]; _this additemcargo ["Medikit", 100]; _this addweaponcargo ["A3_Weapons_F_Launchers_NLAW", 20]; _this addmagazinecargo ["NLAW_F", 100]; _this addmagazinecargo ["100Rnd_65x39_caseless_mag_Tracer", 100]; _this addmagazinecargo ["30Rnd_65x39_caseless_mag_Tracer", 100]; _this addmagazinecargo ["200Rnd_65x39_cased_Box_Tracer", 100]; _this addmagazinecargo ["30Rnd_65x39_caseless_mag", 50]; _this addmagazinecargo ["100Rnd_65x39_caseless_mag", 50]; Put this code only in the init of your ammo box which will call the script: _dummy = this execvm "ammo.sqf"; ammo.sqf is the name of the script, if its something else then put that in between the quotes instead. Be sure the script is in the same folder as the mission, same place the mission.sqm is at. Thanks, I'm so stupid :P Share this post Link to post Share on other sites
Gunter Severloh 4020 Posted March 15, 2013 Does it work for you in A3? what was the name of your script btw? Share this post Link to post Share on other sites
Freddan962 1 Posted March 15, 2013 Does it work for you in A3?what was the name of your script btw? It does work and the script name is weaponcrate.sqf, I was just overlooking the _this issue haha, my bad, but once again! :) Share this post Link to post Share on other sites
Gunter Severloh 4020 Posted March 17, 2013 (edited) Late reply sorry, but good deal, so then for those that also are looking to use this, then the code for the init line of the weapon crate would be this for example if you used his name for the script: _dummy = this execvm "weaponcrate.sqf"; The name dont matter you can name the script whatever you want, but then you need to make sure that the code in the init line see above has the same name, so if you saved your ammo script as weapons.sqf then it would look like: _dummy = this execvm "weapons.sqf"; Edited March 17, 2013 by Gnter Severloh Share this post Link to post Share on other sites