Jump to content
Sign in to follow this  
Freddan962

Need help with ammo crate script! :)

Recommended Posts

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

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

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
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
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

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 by Gnter Severloh

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×