kennyleif 20 Posted July 15, 2015 It has problerly been answered at some point, but i used to have a working script for several boxes, containing all kinds of stuff from weapons, ammo etc. When we recently began playing again, after a year breaktime, the script wont work in multiplayer. In editing, AND in multiplayer I can see the stuff, if i have hosted the game. But if its on server, the script wont show any add stuff to the crate, only original stuff. My script looks like this: // Add init_Handle = this execVM "Bokse\Ammo_Boks.sqf"; // Settings _amountWeapon = 20; _amountAmmo = 100; _refreshTime = 600; // refill every 10 minutes _this allowDamage false; // Loop forever while {true} do { // Clear box clearWeaponCargo _this; clearMagazineCargo _this; clearItemCargo _this; // Fill box // M4 / M16 _this addmagazinecargo ["30Rnd_556x45_Stanag_Tracer_Red",100]; _this addmagazinecargo ["rhs_mag_30Rnd_556x45_Mk318_Stanag",100]; // P07 _this addmagazinecargo ["16Rnd_9x21_Mag",100]; // M249 _this addmagazinecargo ["rhsusf_100Rnd_556x45_soft_pouch",100]; // M14 EBR _this addmagazinecargo ["20Rnd_762x51_Mag",100]; _this addmagazinecargo ["ACE_20Rnd_762x51_Mag_Tracer",100]; // Granatstyr Ammo _this addmagazinecargo ["3Rnd_Smoke_Grenade_shell",50]; _this addmagazinecargo ["1Rnd_Smoke_Grenade_shell",50]; _this addmagazinecargo ["1Rnd_HE_Grenade_shell",50]; _this addmagazinecargo ["3Rnd_HE_Grenade_shell",50]; _this addmagazinecargo ["3Rnd_SmokeRed_Grenade_shell",50]; _this addmagazinecargo ["1Rnd_SmokeGreen_Grenade_shell",50]; _this addmagazinecargo ["3Rnd_UGL_FlareWhite_F",50]; _this addmagazinecargo ["1Rnd_SmokeRed_Grenade_shell",50]; _this addmagazinecargo ["rhs_mag_M441_HE",50]; // Wait the duration of _refreshTime sleep _refreshTime; }; Can someone please explain me how to fix this to a working script? Share this post Link to post Share on other sites
davidoss 552 Posted July 15, 2015 (edited) // nul = this execVM "Bokse\Ammo_Boks.sqf"; private ["_refreshTime"]; // Settings _refreshTime = 600; // refill every 10 minutes _this allowDamage false; // Loop forever while {true} do { // Clear box clearWeaponCargoGlobal _this; clearMagazineCargoGlobal _this; clearItemCargoGlobal _this; clearBackpackCargoGlobal _this; // Fill box // M4 / M16 _this addMagazineCargoGlobal ["30Rnd_556x45_Stanag_Tracer_Red",100]; _this addMagazineCargoGlobal ["rhs_mag_30Rnd_556x45_Mk318_Stanag",100]; // P07 _this addMagazineCargoGlobal ["16Rnd_9x21_Mag",100]; // M249 _this addMagazineCargoGlobal ["rhsusf_100Rnd_556x45_soft_pouch",100]; // M14 EBR _this addMagazineCargoGlobal ["20Rnd_762x51_Mag",100]; _this addMagazineCargoGlobal ["ACE_20Rnd_762x51_Mag_Tracer",100]; // Granatstyr Ammo _this addMagazineCargoGlobal ["3Rnd_Smoke_Grenade_shell",50]; _this addMagazineCargoGlobal ["1Rnd_Smoke_Grenade_shell",50]; _this addMagazineCargoGlobal ["1Rnd_HE_Grenade_shell",50]; _this addMagazineCargoGlobal ["3Rnd_HE_Grenade_shell",50]; _this addMagazineCargoGlobal ["3Rnd_SmokeRed_Grenade_shell",50]; _this addMagazineCargoGlobal ["1Rnd_SmokeGreen_Grenade_shell",50]; _this addMagazineCargoGlobal ["3Rnd_UGL_FlareWhite_F",50]; _this addMagazineCargoGlobal ["1Rnd_SmokeRed_Grenade_shell",50]; _this addMagazineCargoGlobal ["rhs_mag_M441_HE",50]; // Wait the duration of _refreshTime sleep _refreshTime; }; There are better way to do something like this. You use mods , than you can use CBA_fnc_globalExecute function to achieve this. Edited July 15, 2015 by DaVIdoSS Share this post Link to post Share on other sites
kennyleif 20 Posted July 15, 2015 There are better way to do something like this. You use mods , than you can use CBA_fnc_globalExecute function to achieve this. Please tell how that works? Share this post Link to post Share on other sites
R3vo 2654 Posted July 15, 2015 https://dev.withsix.com/docs/cba/files/network/fnc_globalExecute-sqf.html What exactly doesn't work ? Won't it fill the crate at all? Share this post Link to post Share on other sites
kennyleif 20 Posted July 15, 2015 https://dev.withsix.com/docs/cba/files/network/fnc_globalExecute-sqf.htmlWhat exactly doesn't work ? Won't it fill the crate at all? Yeah. none of it spawns. The crate has all of the original stuff in it instead. Share this post Link to post Share on other sites
mobilemick 13 Posted July 15, 2015 Have you tried this > http://forums.bistudio.com/showthread.php?170132-LEA-Loadout-Editor-for-ArmA-3 Share this post Link to post Share on other sites
kennyleif 20 Posted July 16, 2015 Have you tried this > http://forums.bistudio.com/showthread.php?170132-LEA-Loadout-Editor-for-ArmA-3 Tried and couldnt get it to work YET in multiplayer, maybee im doing it wrong. ---------- Post added at 08:12 ---------- Previous post was at 08:11 ---------- Also, I have no idea how to insert that CBA thingy into the script?? Possible for some help? Share this post Link to post Share on other sites
whiztler 137 Posted July 16, 2015 (edited) Give this a go. 1. Crates to be executed on the server - if (!isServer) exitWith {}; 2. use the 'global' versions of add/clear commands: https://community.bistudio.com/wiki/clearWeaponCargoGlobal https://community.bistudio.com/wiki/clearMagazineCargoGlobal https://community.bistudio.com/wiki/clearItemCargoGlobal https://community.bistudio.com/wiki/addWeaponCargoGlobal https://community.bistudio.com/wiki/addMagazineCargoGlobal https://community.bistudio.com/wiki/addItemCargoGlobal etc. [color="#FF8040"][color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#8B3E2F"][b]![/b][/color][color="#191970"][b]isServer[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]exitWith[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// Add init_Handle = this execVM "Bokse\Ammo_Boks.sqf";[/i][/color] [color="#006400"][i]// Settings[/i][/color] [color="#1874CD"]_amountWeapon[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#FF0000"]20[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_amountAmmo[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#FF0000"]100[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_refreshTime[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#FF0000"]600[/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// refill every 10 minutes[/i][/color][/color] Made with KK's SQF to BBCode Converter [color=#FF8040][color=#191970][b]clearWeaponCargoGlobal[/b][/color] [color=#000000]_this[/color][color=#8B3E2F][b];[/b][/color] [color=#191970][b]clearMagazineCargoGlobal[/b][/color] [color=#000000]_this[/color][color=#8B3E2F][b];[/b][/color] [color=#191970][b]clearItemCargoGlobal[/b][/color] [color=#000000]_this[/color][color=#8B3E2F][b];[/b][/color] [/color] Made with KK's SQF to BBCode Converter [color=#FF8040][color=#000000]_this[/color] [color=#191970][b]addMagazineCargoGlobal[/b][/color] [color=#8B3E2F][b][[/b][/color][color=#7A7A7A]"30Rnd_556x45_Stanag_Tracer_Red"[/color][color=#8B3E2F][b],[/b][/color][color=#FF0000]100[/color][color=#8B3E2F][b]][/b][/color][color=#8B3E2F][b];[/b][/color] [color=#000000]_this[/color] [color=#191970][b]addMagazineCargoGlobal[/b][/color] [color=#8B3E2F][b][[/b][/color][color=#7A7A7A]"rhs_mag_30Rnd_556x45_Mk318_Stanag"[/color][color=#8B3E2F][b],[/b][/color][color=#FF0000]100[/color][color=#8B3E2F][b]][/b][/color][color=#8B3E2F][b];[/b][/color][/color] Made with KK's SQF to BBCode Converter Edited July 16, 2015 by whiztler Share this post Link to post Share on other sites
davidoss 552 Posted July 16, 2015 (edited) This is already posted. I assume he is executing this wrong. Anyway there is a example of my custom crate script using CBA_fnc_globalExecute. class Extended_Init_EventHandlers { class B_CargoNet_01_ammo_F { init = "(_this select 0) call (compile preprocessFileLineNumbers 'scripts\arsenalCrate.sqf')"; }; scripts\arsenalCrate.sqf // fill ammo box using CBA_fnc_globalExecute private ["_crate"]; _crate = _this; [-1, { _crate = _this; clearWeaponCargoGlobal _crate; clearMagazineCargoGlobal _crate; clearItemCargoGlobal _crate; clearBackpackCargoGlobal _crate; _crate addMagazineCargoGlobal ["rhs_mag_30Rnd_556x45_M855A1_Stanag", 20]; _crate addMagazineCargoGlobal ["rhs_mag_30Rnd_556x45_M855A1_Stanag_No_Tracer", 20]; _crate addMagazineCargoGlobal ["rhs_mag_30Rnd_556x45_M855A1_Stanag_Tracer_Red", 20]; _crate addMagazineCargoGlobal ["rhs_mag_30Rnd_556x45_M855A1_Stanag_Tracer_Green", 20]; _crate addMagazineCargoGlobal ["rhs_mag_30Rnd_556x45_M855A1_Stanag_Tracer_Yellow", 20]; _crate addMagazineCargoGlobal ["rhs_mag_30Rnd_556x45_Mk318_Stanag", 20]; _crate addMagazineCargoGlobal ["rhs_mag_30Rnd_556x45_Mk262_Stanag", 20]; _crate addMagazineCargoGlobal ["rhs_mag_30Rnd_556x45_M200_Stanag", 20]; _crate addMagazineCargoGlobal ["rhs_mag_M441_HE", 20]; _crate addMagazineCargoGlobal ["rhs_mag_M433_HEDP", 20]; _crate addMagazineCargoGlobal ["rhs_mag_m4009", 20]; _crate addMagazineCargoGlobal ["rhs_mag_m576", 20]; _crate addMagazineCargoGlobal ["rhs_mag_M585_white", 10]; _crate addMagazineCargoGlobal ["rhs_mag_m661_green", 10]; _crate addMagazineCargoGlobal ["rhs_mag_m662_red", 10]; _crate addMagazineCargoGlobal ["rhs_mag_m713_Red", 10]; _crate addMagazineCargoGlobal ["rhs_mag_m714_White", 10]; _crate addMagazineCargoGlobal ["rhs_mag_m715_Green", 10]; _crate addMagazineCargoGlobal ["rhs_mag_m716_yellow", 10]; _crate addMagazineCargoGlobal ["rhsusf_5Rnd_300winmag_xm2010", 20]; _crate addMagazineCargoGlobal ["rhsusf_5Rnd_00Buck", 20]; _crate addMagazineCargoGlobal ["rhsusf_8Rnd_00Buck", 20]; _crate addMagazineCargoGlobal ["rhsusf_5Rnd_doomsday_Buck", 20]; _crate addMagazineCargoGlobal ["rhsusf_8Rnd_doomsday_Buck", 20]; _crate addMagazineCargoGlobal ["rhsusf_100Rnd_556x45_soft_pouch", 100]; _crate addMagazineCargoGlobal ["rhsusf_100Rnd_556x45_M200_soft_pouch", 100]; _crate addMagazineCargoGlobal ["rhsusf_200Rnd_556x45_soft_pouch", 50]; _crate addMagazineCargoGlobal ["rhsusf_100Rnd_762x51", 100]; _crate addMagazineCargoGlobal ["rhsusf_100Rnd_762x51_m993", 100]; _crate addMagazineCargoGlobal ["rhsusf_20Rnd_762x51_m118_special_Mag", 100]; _crate addMagazineCargoGlobal ["rhsusf_20Rnd_762x51_m993_Mag", 100]; _crate addMagazineCargoGlobal ["rhsusf_mag_7x45acp_MHP", 20]; _crate addMagazineCargoGlobal ["SatchelCharge_Remote_Mag", 10]; _crate addMagazineCargoGlobal ["ClaymoreDirectionalMine_Remote_Mag", 10]; _crate addMagazineCargoGlobal ["DemoCharge_Remote_Mag", 10]; _crate addMagazineCargoGlobal ["Titan_AT", 10]; _crate addMagazineCargoGlobal ["Titan_AP", 10]; _crate addMagazineCargoGlobal ["Titan_AA", 10]; _crate addMagazineCargoGlobal ["rhs_m136_mag", 10]; _crate addMagazineCargoGlobal ["rhs_m136_hedp_mag", 10]; _crate addMagazineCargoGlobal ["rhs_m136_hp_mag", 10]; _crate addMagazineCargoGlobal ["rhs_fim92_mag", 10]; _crate addMagazineCargoGlobal ["rhs_fgm148_magazine_AT", 10]; _crate addMagazineCargoGlobal ["rhs_mine_M19_mag", 10]; _crate addMagazineCargoGlobal ["rhs_mag_m67", 10]; _crate addMagazineCargoGlobal ["rhs_mag_m69", 10]; _crate addMagazineCargoGlobal ["rhs_mag_mk84", 10]; _crate addMagazineCargoGlobal ["rhs_mag_an_m8hc", 10]; _crate addMagazineCargoGlobal ["rhs_mag_an_m14_th3", 10]; _crate addMagazineCargoGlobal ["rhs_mag_m7a3_cs", 10]; _crate addMagazineCargoGlobal ["rhs_mag_mk3a2", 10]; _crate addMagazineCargoGlobal ["rhs_mag_m18_green", 10]; _crate addMagazineCargoGlobal ["rhs_mag_m18_purple", 10]; _crate addMagazineCargoGlobal ["rhs_mag_m18_red", 10]; _crate addMagazineCargoGlobal ["rhs_mag_m18_yellow", 10]; _crate addMagazineCargoGlobal ["ACE_100Rnd_65x39_caseless_mag_Tracer_Dim", 20]; _crate addMagazineCargoGlobal ["ACE_200Rnd_65x39_cased_Box_Tracer_Dim", 20]; _crate addMagazineCargoGlobal ["ACE_30Rnd_65x47_Scenar_mag", 20]; _crate addMagazineCargoGlobal ["ACE_30Rnd_65_Creedmor_mag", 20]; _crate addMagazineCargoGlobal ["ACE_10Rnd_338_300gr_HPBT_Mag", 20]; _crate addMagazineCargoGlobal ["ACE_10Rnd_338_API526_Mag", 20]; _crate addMagazineCargoGlobal ["ACE_5Rnd_127x99_Mag", 20]; _crate addMagazineCargoGlobal ["ACE_5Rnd_127x99_API_Mag", 20]; _crate addMagazineCargoGlobal ["ACE_5Rnd_127x99_AMAX_Mag", 20]; _crate addMagazineCargoGlobal ["ACE_20Rnd_762x51_Mag_SD", 20]; _crate addMagazineCargoGlobal ["ACE_10Rnd_762x51_M993_AP_Mag", 20]; _crate addMagazineCargoGlobal ["ACE_20Rnd_762x51_M993_AP_Mag", 20]; _crate addMagazineCargoGlobal ["ACE_10Rnd_762x51_M118LR_Mag", 20]; _crate addMagazineCargoGlobal ["ACE_20Rnd_762x51_M118LR_Mag", 20]; _crate addMagazineCargoGlobal ["ACE_10Rnd_762x51_Mk316_Mod_0_Mag", 20]; _crate addMagazineCargoGlobal ["ACE_20Rnd_762x51_Mk316_Mod_0_Mag", 20]; _crate addMagazineCargoGlobal ["ACE_10Rnd_762x51_Mk319_Mod_0_Mag", 20]; _crate addMagazineCargoGlobal ["ACE_20Rnd_762x51_Mk319_Mod_0_Mag", 20]; _crate addMagazineCargoGlobal ["ACE_20Rnd_762x51_Mag_Tracer", 20]; _crate addMagazineCargoGlobal ["ACE_20Rnd_762x51_Mag_Tracer_Dim", 20]; _crate addMagazineCargoGlobal ["ACE_20Rnd_762x67_Mk248_Mod_0_Mag", 20]; _crate addMagazineCargoGlobal ["ACE_20Rnd_762x67_Mk248_Mod_1_Mag", 20]; _crate addMagazineCargoGlobal ["ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag", 20]; _crate addMagazineCargoGlobal ["ACE_10Rnd_762x54_Tracer_mag", 20]; _crate addMagazineCargoGlobal ["ACE_30Rnd_556x45_Stanag_M995_AP_mag", 20]; _crate addMagazineCargoGlobal ["ACE_30Rnd_556x45_Stanag_Mk262_mag", 20]; _crate addMagazineCargoGlobal ["ACE_30Rnd_556x45_Stanag_Mk318_mag", 20]; _crate addMagazineCargoGlobal ["ACE_30Rnd_556x45_Stanag_Tracer_Dim", 20]; _crate addMagazineCargoGlobal ["ACE_30Rnd_65x39_caseless_mag_Tracer_Dim", 20]; _crate addMagazineCargoGlobal ["ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim", 20]; _crate addMagazineCargoGlobal ["ACE_M84", 20]; _crate addMagazineCargoGlobal ["ACE_HandFlare_White", 10]; _crate addMagazineCargoGlobal ["ACE_HandFlare_Red", 10]; _crate addMagazineCargoGlobal ["ACE_HandFlare_Green", 10]; _crate addMagazineCargoGlobal ["ACE_HandFlare_Yellow", 10]; _crate addItemCargoGlobal ["ACE_ATragMX", 20]; _crate addItemCargoGlobal ["ACE_Altimeter", 10]; _crate addItemCargoGlobal ["ACE_CableTie", 20]; _crate addItemCargoGlobal ["ACE_Cellphone", 20]; _crate addItemCargoGlobal ["ACE_Clacker", 20]; _crate addItemCargoGlobal ["ACE_DAGR", 20]; _crate addItemCargoGlobal ["ACE_DeadManSwitch", 20]; _crate addItemCargoGlobal ["ACE_DefusalKit", 20]; _crate addItemCargoGlobal ["ACE_EarPlugs", 20]; _crate addItemCargoGlobal ["ACE_IR_Strobe_Item", 20]; _crate addItemCargoGlobal ["ACE_Kestrel4500", 20]; _crate addItemCargoGlobal ["ACE_M26_Clacker", 20]; _crate addItemCargoGlobal ["ACE_wirecutter", 20]; _crate addItemCargoGlobal ["ACE_MX2A", 20]; _crate addItemCargoGlobal ["ACE_MapTools", 20]; _crate addItemCargoGlobal ["ACE_NVG_Gen1", 20]; _crate addItemCargoGlobal ["ACE_NVG_Gen2", 20]; _crate addItemCargoGlobal ["ACE_NVG_Gen4", 20]; _crate addItemCargoGlobal ["ACE_NVG_Wide", 20]; _crate addItemCargoGlobal ["ACE_RangeCard", 20]; _crate addItemCargoGlobal ["ACE_Sandbag_empty", 20]; _crate addItemCargoGlobal ["ACE_SpareBarrel", 20]; _crate addItemCargoGlobal ["ACE_Tripod", 20]; _crate addItemCargoGlobal ["ACE_UAVBattery", 20]; _crate addItemCargoGlobal ["ACE_Vector", 20]; _crate addItemCargoGlobal ["ACE_Yardage450", 20]; _crate addItemCargoGlobal ["ACE_acc_pointer_green", 20]; _crate addItemCargoGlobal ["ACE_bodyBag", 20]; _crate addItemCargoGlobal ["ACE_quikclot", 100]; _crate addItemCargoGlobal ["ACE_fieldDressing", 100]; _crate addItemCargoGlobal ["ACE_elasticBandage", 100]; _crate addItemCargoGlobal ["ACE_packingBandage", 100]; _crate addItemCargoGlobal ["ACE_personalAidKit", 20]; _crate addItemCargoGlobal ["ACE_epinephrine", 100]; _crate addItemCargoGlobal ["ACE_morphine", 100]; _crate addItemCargoGlobal ["ACE_atropine", 100]; _crate addItemCargoGlobal ["ACE_bloodIV", 50]; _crate addItemCargoGlobal ["ACE_bloodIV_250", 50]; _crate addItemCargoGlobal ["ACE_bloodIV_500", 50]; _crate addItemCargoGlobal ["ACE_plasmaIV", 50]; _crate addItemCargoGlobal ["ACE_plasmaIV_250", 50]; _crate addItemCargoGlobal ["ACE_plasmaIV_500", 50]; _crate addItemCargoGlobal ["ACE_salineIV", 50]; _crate addItemCargoGlobal ["ACE_salineIV_250", 50]; _crate addItemCargoGlobal ["ACE_salineIV_500", 50]; _crate addItemCargoGlobal ["ACE_surgicalKit", 20]; _crate addItemCargoGlobal ["ACE_tourniquet", 20]; _crate addItemCargoGlobal ["ACE_microDAGR", 20]; _crate addItemCargoGlobal ["ACE_muzzle_mzls_338", 20]; _crate addItemCargoGlobal ["ACE_muzzle_mzls_93mmg", 20]; _crate addItemCargoGlobal ["ACE_muzzle_mzls_H", 20]; _crate addItemCargoGlobal ["ACE_muzzle_mzls_L", 20]; _crate addItemCargoGlobal ["ACE_muzzle_mzls_smg_01", 20]; _crate addItemCargoGlobal ["ACE_muzzle_mzls_smg_02", 20]; _crate addItemCargoGlobal ["ACE_optic_Arco_2D", 10]; _crate addItemCargoGlobal ["ACE_optic_Arco_PIP", 10]; _crate addItemCargoGlobal ["ACE_optic_Hamr_2D", 10]; _crate addItemCargoGlobal ["ACE_optic_Hamr_PIP", 10]; _crate addItemCargoGlobal ["ACE_optic_LRPS_2D", 10]; _crate addItemCargoGlobal ["ACE_optic_LRPS_PIP", 10]; _crate addItemCargoGlobal ["ACE_optic_MRCO_2D", 10]; _crate addItemCargoGlobal ["ACE_optic_SOS_2D", 10]; _crate addItemCargoGlobal ["ACE_optic_SOS_PIP", 10]; _crate addItemCargoGlobal ["tf_anprc152_1", 10]; _crate addItemCargoGlobal ["ItemCompass", 10]; _crate addItemCargoGlobal ["ToolKit", 10]; _crate addItemCargoGlobal ["G_Combat", 10]; _crate addItemCargoGlobal ["Laserdesignator", 10]; _crate addItemCargoGlobal ["ItemGPS", 10]; _crate addItemCargoGlobal ["B_UavTerminal", 5]; _crate addAction ["<t color='#ff1111'>BIS Arsenal</t>", {["Open",true] call BIS_fnc_arsenal},[],6,false,true,"","(_target distance _this) < 5"]; _crate addAction ["<t color='#ff1111'>Virtual Ammobox</t>", "VAS\open.sqf",[],5,false,true,"","(_target distance _this) < 5"]; }, _crate] call CBA_fnc_globalExecute; Edited July 17, 2015 by DaVIdoSS Share this post Link to post Share on other sites
whiztler 137 Posted July 16, 2015 This is already posted. I assume he is executing this wrong.Anyway there is a example of my custom crate script using CBA_fnc_globalExecute. [/code] Commands such as addItemCargoGlobal have global arguments and global effects (see: https://community.bistudio.com/wiki/addItemCargoGlobal). Imho there is no reason to globalExecute as well. [h=3]Additional Information[/h]Multiplayer:Command is executed on all connected clients in multiplayer. Share this post Link to post Share on other sites
davidoss 552 Posted July 16, 2015 Yes it is if the object was not exist until spawn. Share this post Link to post Share on other sites
mr-blizzard 10 Posted July 17, 2015 (edited) ///////// MP Ammo Box script ///////// MP Ammo Box script ///////// By: Riouken ///////// For Arma 3 if (!isServer) exitWith {}; _crate = _this select 0; while {alive _crate} do { clearMagazineCargoGlobal _crate; clearWeaponCargoGlobal _crate; clearItemCargoGlobal _crate; clearBackpackCargoGlobal _crate; //NATO Weapons _crate addWeaponCargoGlobal ["CUP_arifle_M16A4_Base", 50]; _crate addWeaponCargoGlobal ["CUP_arifle_M16A4_GL", 50]; _crate addWeaponCargoGlobal ["CUP_arifle_M4CAR_black", 50]; _crate addWeaponCargoGlobal ["CUP_arifle_M4CAR_BUIS_GL", 50]; _crate addWeaponCargoGlobal ["CUP_lmg_M249", 50]; _crate addWeaponCargoGlobal ["ej_IAR30", 50]; _crate addWeaponCargoGlobal ["CUP_srifle_M110", 10]; _crate addWeaponCargoGlobal ["CUP_srifle_Mk12SPR", 10]; _crate addWeaponCargoGlobal ["CUP_arifle_M4A1_BUIS_GL", 50]; _crate addWeaponCargoGlobal ["CUP_arifle_M4A1_black", 50]; _crate addWeaponCargoGlobal ["CUP_srifle_M107_Base", 10]; _crate addWeaponCargoGlobal ["CUP_sgun_M1014", 10]; _crate addWeaponCargoGlobal ["CUP_lmg_M240", 10]; _crate addWeaponCargoGlobal ["CUP_hgun_M9", 5]; //AMMO _crate addMagazineCargoGlobal ["MEU_30Rnd_M855A1_556x45_Stanag", 100]; _crate addMagazineCargoGlobal ["MEU_30Rnd_M855A1_556x45_T_Stanag", 100]; _crate addMagazineCargoGlobal ["MEU_200Rnd_M249_556x45_Stanag", 100]; _crate addMagazineCargoGlobal ["MEU_200Rnd_M249_556x45_T_Stanag", 100]; _crate addMagazineCargoGlobal ["MEU_8Rnd_12Gauge_Pellets", 100]; _crate addMagazineCargoGlobal ["MEU_8Rnd_12Gauge_Slug", 100]; _crate addMagazineCargoGlobal ["MEU_20x762_Mag", 100]; _crate addMagazineCargoGlobal ["MEU_100Rnd_M240_762x51", 100]; _crate addMagazineCargoGlobal ["MEU_100Rnd_M240_762x51_T", 100]; _crate addMagazineCargoGlobal ["MEU_30x556_Mk262_Mag", 100]; _crate addMagazineCargoGlobal ["MEU_M882_9mm", 50]; _crate addMagazineCargoGlobal ["MEU_10x127_HEIAP_Mag", 50]; _crate addMagazineCargoGlobal ["M433_40mm_HEDP_Shell", 50]; _crate addMagazineCargoGlobal ["1Rnd_Smoke_Grenade_shell", 25]; _crate addMagazineCargoGlobal ["1Rnd_SmokeRed_Grenade_shell", 25]; _crate addMagazineCargoGlobal ["1Rnd_SmokeGreen_Grenade_shell", 25]; _crate addMagazineCargoGlobal ["1Rnd_SmokeYellow_Grenade_shell", 25]; _crate addMagazineCargoGlobal ["1Rnd_SmokePurple_Grenade_shell", 25]; _crate addMagazineCargoGlobal ["1Rnd_SmokeBlue_Grenade_shell", 25]; _crate addMagazineCargoGlobal ["1Rnd_SmokeOrange_Grenade_shell", 25]; _crate addMagazineCargoGlobal ["MEU_FlareWhite_M203", 25]; _crate addMagazineCargoGlobal ["MEU_FlareGreen_M203", 25]; _crate addMagazineCargoGlobal ["MEU_FlareRed_M203", 25]; _crate addMagazineCargoGlobal ["MEU_FlareYellow_M203", 25]; //AGM _crate addItemCargoGlobal ["AGM_Bandage",500]; _crate addItemCargoGlobal ["AGM_Epipen",200]; _crate addItemCargoGlobal ["AGM_Morphine",200]; _crate addItemCargoGlobal ["AGM_Bloodbag",200]; _crate addItemCargoGlobal ["AGM_SpareBarrel",50]; _crate addItemCargoGlobal ["AGM_EarBuds",50]; _crate addItemCargoGlobal ["AGM_DefusalKit",50]; _crate addItemCargoGlobal ["AGM_IR_Strobe_Item",50]; _crate addItemCargoGlobal ["AGM_MapTools",50]; _crate addItemCargoGlobal ["AGM_UAVBattery",50]; _crate addItemCargoGlobal ["AGM_Clacker",50]; _crate addItemCargoGlobal ["AGM_ItemKestrel",50]; _crate addItemCargoGlobal ["AGM_Vector",50]; _crate addItemCargoGlobal ["AGM_HandFlare_Green",50]; _crate addItemCargoGlobal ["AGM_HandFlare_Red",50]; _crate addItemCargoGlobal ["AGM_HandFlare_White",50]; _crate addItemCargoGlobal ["AGM_HandFlare_Yellow",50]; //Launchers _crate addWeaponCargoGlobal ["meu_AT4_CS", 50]; _crate addWeaponCargoGlobal ["meu_AT4", 50]; _crate addWeaponCargoGlobal ["CUP_launch_Mk153Mod0", 50]; //Launcher Ammo _crate addMagazineCargoGlobal ["CUP_SMAW_HEAA_M_N", 50]; _crate addMagazineCargoGlobal ["CUP_SMAW_HEDP_M_N", 50]; //Explosives _crate addMagazineCargoGlobal ["CUP_PipeBomb_M", 5]; _crate addMagazineCargoGlobal ["ATMine_Range_Mag", 50]; _crate addMagazineCargoGlobal ["APERSMine_Range_Mag", 50]; _crate addMagazineCargoGlobal ["ClaymoreDirectionalMine_Remote_Mag", 50]; _crate addMagazineCargoGlobal ["DemoCharge_Remote_Mag", 50];; _crate addMagazineCargoGlobal ["APERSBoundingMine_Range_Mag", 50]; _crate addMagazineCargoGlobal ["SLAMDirectionalMine_Wire_Mag", 50]; _crate addMagazineCargoGlobal ["APERSTripMine_Wire_Mag", 50]; _crate addWeaponCargoGlobal ["MineDetector", 50]; //Grenades _crate addMagazineCargoGlobal ["AGM_M84", 25]; _crate addMagazineCargoGlobal ["HandGrenade", 50]; _crate addMagazineCargoGlobal ["MiniGrenade", 50]; _crate addMagazineCargoGlobal ["SmokeShell", 50]; _crate addMagazineCargoGlobal ["SmokeShellRed", 50]; _crate addMagazineCargoGlobal ["SmokeShellGreen", 50]; _crate addMagazineCargoGlobal ["SmokeShellYellow", 50]; _crate addMagazineCargoGlobal ["SmokeShellPurple", 50]; _crate addMagazineCargoGlobal ["SmokeShellBlue", 50]; _crate addMagazineCargoGlobal ["SmokeShellOrange", 50]; _crate addMagazineCargoGlobal ["Chemlight_green", 10]; _crate addMagazineCargoGlobal ["Chemlight_red", 10]; _crate addMagazineCargoGlobal ["B_IR_Grenade", 10]; //Attachments _crate addItemCargoGlobal ["CUP_optic_AN_PVS_10", 20]; _crate addItemCargoGlobal ["CUP_optic_Eotech533Grey", 20]; _crate addItemCargoGlobal ["CUP_optic_CompM2_Black", 20]; _crate addItemCargoGlobal ["CUP_muzzle_snds_M9", 20]; _crate addItemCargoGlobal ["CUP_muzzle_snds_M110", 20]; _crate addItemCargoGlobal ["CUP_muzzle_snds_M16", 20]; _crate addItemCargoGlobal ["AGM_muzzle_mzls_L", 20]; _crate addItemCargoGlobal ["AGM_muzzle_mzls_B", 20]; _crate addItemCargoGlobal ["CUP_acc_ANPEQ_2", 20]; _crate addItemCargoGlobal ["CUP_acc_ANPEQ_15", 20]; _crate addItemCargoGlobal ["optic_MRCO", 20]; _crate addItemCargoGlobal ["optic_Arco", 20]; _crate addItemCargoGlobal ["optic_Hamr", 20]; _crate addItemCargoGlobal ["optic_Aco", 20]; _crate addItemCargoGlobal ["optic_ACO_grn", 20]; _crate addItemCargoGlobal ["CUP_acc_flashlight", 20]; _crate addItemCargoGlobal ["optic_SOS", 20]; _crate addItemCargoGlobal ["optic_LRPS", 20]; _crate addItemCargoGlobal ["CUP_optic_RCO", 20]; _crate addItemCargoGlobal ["CUP_optic_ACOG", 20]; _crate addItemCargoGlobal ["CUP_optic_elcanM145", 20]; _crate addItemCargoGlobal ["CUP_optic_HoloBlack", 20]; _crate addItemCargoGlobal ["CUP_optic_SB_3_12x50_PMll", 20]; _crate addItemCargoGlobal ["optic_NVS", 20]; _crate addItemCargoGlobal ["CUP_optic_SMAW_Scope", 20]; //Items _crate addItemCargoGlobal ["tf_microdagr",100]; _crate addItemCargoGlobal ["Toolkit", 50]; _crate addItemCargoGlobal ["itemGPS", 50]; _crate addItemCargoGlobal ["itemWatch", 50]; _crate addItemCargoGlobal ["Laserbatteries", 50]; _crate addItemCargoGlobal ["Laserdesignator", 20]; _crate addItemCargoGlobal ["Binocular", 20]; _crate addItemCargoGlobal ["Rangefinder", 20]; _crate addItemCargoGlobal ["B_UavTerminal", 2]; _crate addItemCargoGlobal ["NVGoggles_OPFOR", 40]; _crate addItemCargoGlobal ["NVGoggles", 40]; _crate addItemCargoGlobal ["NVGoggles_INDEP", 40]; //TFAR _crate addItemCargoGlobal ["tf_anprc152", 100]; _crate addBackpackCargoGlobal ["tf_rt1523g", 5]; _crate addBackpackCargoGlobal ["tf_rt1523g_sage", 5]; _crate addBackpackCargoGlobal ["tf_rt1523g_big_rhs", 5]; //Uniforms _crate addItemCargoGlobal ["MEF_OD_WMARPAT_RM_LS", 10]; _crate addItemCargoGlobal ["U_B_Wetsuit", 10]; _crate addItemCargoGlobal ["MEF_Wood_MARPAT_LS", 15]; _crate addItemCargoGlobal ["MEF_Wood_IN_MARPAT_LS", 15]; _crate addItemCargoGlobal ["MEF_Wood_IN_MARPAT_RS", 15]; _crate addItemCargoGlobal ["MEF_Wood_MARPAT_RS", 15]; _crate addItemCargoGlobal ["MEF_Wood_MARPAT_TS", 15]; _crate addItemCargoGlobal ["U_B_HeliPilotCoveralls", 15]; _crate addItemCargoGlobal ["MEF_Wood_MARPAT_RM_RS", 15]; //Face _crate addItemCargoGlobal ["G_B_Diving", 20]; _crate addItemCargoGlobal ["G_Aviator", 15]; _crate addItemCargoGlobal ["G_Lowprofile", 15]; //Marine Headgear _crate addItemCargoGlobal ["H_HelmetB_light_black", 5]; _crate addItemCargoGlobal ["H_PilotHelmetHeli_O", 5]; _crate addItemCargoGlobal ["H_CrewHelmetHeli_O", 5]; _crate addItemCargoGlobal ["MEF_Woodland_Helmet_MICH", 15]; _crate addItemCargoGlobal ["MEF_Wood_Helmet_LWH", 15]; _crate addItemCargoGlobal ["MEF_Boonie_Wood", 15]; _crate addItemCargoGlobal ["MEF_Woodland_8Point", 15]; _crate addItemCargoGlobal ["H_HelmetCrew_I", 5]; _crate addItemCargoGlobal ["H_HelmetSpecB", 5]; //Marine Vests _crate addItemCargoGlobal ["V_RebreatherB", 20]; _crate addItemCargoGlobal ["MEF_Vest_Tan_Infantry", 15]; _crate addItemCargoGlobal ["MEF_Vest_Tan_Infantry_L", 15]; //Backpacks _crate addBackpackCargoGlobal ["MEF_Wood_Kitbag", 15]; _crate addBackpackCargoGlobal ["MEF_Wood_Assault", 15]; _crate addBackpackCargoGlobal ["MEF_Wood_Carryall", 15]; _crate addBackpackCargoGlobal ["MEF_TAN_Assault", 15]; _crate addBackpackCargoGlobal ["MEF_TAN_Carryall", 15]; _crate addBackpackCargoGlobal ["MEF_TAN_Kitbag", 15]; _crate addBackpackCargoGlobal ["B_Mortar_01_support_F", 1]; _crate addBackpackCargoGlobal ["B_Mortar_01_weapon_F", 1]; sleep 600; }; Edited July 17, 2015 by Mr-Blizzard Share this post Link to post Share on other sites