humpabry 5 Report post Posted September 20, 2015 if (isServer) then { _vehicle_99 = objNull; if (true) then{ _this = createVehicle ["B_CargoNet_01_ammo_F", [22506.4,20058.8,0], [], 0, "CAN_COLLIDE"]; _vehicle_99 = _this; _this setDir 20; _this setVariable ["permaLoot",true]; clearWeaponCargoGlobal _this; clearMagazineCargoGlobal _this; _this addItemCargoGlobal [""]; _this addItemCargoGlobal [""]; };}; this code ofc with the _this addItemCargoGlobal [""]; filled in with right items dont seem to spawn me any box. can someone pls tell me what should be changed or let me know how to spawn boxes..wanting to add loot boxes to ai city. ty Share this post Link to post Share on other sites
READTHESCROLL 203 Report post Posted September 21, 2015 +1 working on the same thing 1 Share this post Link to post Share on other sites
SLB2k11 212 Report post Posted September 21, 2015 I want to make them for shops, to buy, for a bigger storage room in the base 1 Share this post Link to post Share on other sites
TheCreep3r 4 Report post Posted October 10, 2015 i added this to the existing vehicle classes in the mission.sqm and i get the box boot no lootclass Item101 { position[]={23834.248,5.23,16089.85}; azimut=-36.197243; id=101; side="EMPTY"; vehicle="Exile_Container_Safe"; skill=0.60000002; init="this addmagazinecargo [""20Rnd_762x51_Mag"",5]; this addmagazinecargo [""5Rnd_127x108_APDS_Mag"",5]; this addmagazinecargo [""7Rnd_408_Mag"",5]; this addmagazinecargo [""10Rnd_338_Mag"",5]; this addmagazinecargo [""10Rnd_127x54_Mag"",5]; this addmagazinecargo [""10Rnd_93x64_DMR_05_Mag"",5]; this additemcargo [""SatchelCharge_Remote_Mag"",1];"; };even tried addmagazineCargoGlobal. Share this post Link to post Share on other sites
r0fus 30 Report post Posted October 10, 2015 you need a clearItemCargoGlobal as well.And how do you run the script? 1 Share this post Link to post Share on other sites
TheCreep3r 4 Report post Posted October 15, 2015 tried these to no avail1st adding this to the vehicle classes already in the mission.sqm class Item100 { position[]={14559.784,17.91,16761.285}; id=100; side="EMPTY"; vehicle="Exile_Container_Safe"; skill=0.60000002; init="clearWeaponCargoGlobal this; clearMagazineCargoGlobal this; clearItemCargoGlobal this; this addmagazinecargo [""20Rnd_762x51_Mag"",5];"; }; };safe appears but no loot2nd i added this to a crate.sqf in the mission.pbo added by @humpabryif (isServer) then { _vehicle_99 = objNull; if (true) then{ _this = createVehicle ["B_CargoNet_01_ammo_F", [22506.4,20058.8,0], [], 0, "CAN_COLLIDE"]; _vehicle_99 = _this; _this setDir 20; _this setVariable ["permaLoot",true]; clearWeaponCargoGlobal _this; clearMagazineCargoGlobal _this; _this addItemCargoGlobal [""]; _this addItemCargoGlobal [""]; };};and ran it from init.sqf like this[] execVM "crate.sqf"; again safe appears but no loot and 3rd added a crate.sqf to mission pbo with this (found on armaholics)if (isServer) exitWith {};_position = _this select 0;_radius = _this select 1;_amount = _this select 2;_refreshTime = _this select 3;_crates = [];while {true} do { for "_a" from 1 to _amount do { _crate = createVehicle ["Exile_Container_Safe", _position, [], _radius, "NONE"]; _crates pushBack _crate; }; { clearWeaponCargoGlobal _x; clearMagazineCargoGlobal _x; clearItemCargoGlobal _x; clearBackPackCargoGlobal _x; //Start modifying here _x addWeaponCargoGlobal ["arifle_MX_F", 5]; _x addWeaponCargoGlobal ["arifle_MXM_F", 5]; _x addMagazineCargoGlobal ["30Rnd_65x39_caseless_mag", 40]; _x addItemCargoGlobal ["ItemRadio", 5]; _x addItemCargoGlobal ["ItemMap", 5]; //Stop modifying here } forEach _crates; sleep (_refreshTime - 30); hint "The crates will be refreshed in 30 seconds!"; sleep 30; {deleteVehicle _x} forEach _crates;};and ran it from init.sqf like this[<Position>, <Radius>, <Amount>, <Refresh time>] execVM "crate.sqf";example : [14569.606,16751.447,17.91, 2, 1, 300] execVM "crate.sqf";and with this no safe but crate refresh message shows up : The crates will be refreshed in 30 seconds!and error log shows thisBad conversion: array10:05:16 Error in expression <or "_a" from 1 to _amount do {_crate = createVehicle ["Exile_Container_Safe", _>10:05:16 Error position: <createVehicle ["Exile_Container_Safe", _>10:05:16 Error 0 elements provided, 3 expected10:05:16 File mpmissions\__CUR_MP.Altis\crate.sqf, line 9if anyone knows how to get it right or knows a way of spawning custom loot boxes i would be grateful, Thanks. Share this post Link to post Share on other sites
r0fus 30 Report post Posted October 15, 2015 (edited) What I did was make a file in a new folder where I add my static objects and crates and call that file from init.sqf.First a crate file example.Crate1.sqf in exile.Altis\addons:if (isServer) then { _box0 = objNull; if (true) then { _this = createVehicle ["Box_IND_WpsSpecial_F", [16093.6,16919.8,0.0], [], 0, "CAN_COLLIDE"]; _box0 = _this; _this setDir -2.0; _this setVariable ["permaLoot",true]; clearweaponcargoGlobal _this; clearmagazinecargoGlobal _this; clearItemCargoGlobal _this; _this addItemCargoGlobal ["Exile_Item_MetalBoard", 5]; _this addWeaponCargoGlobal ["srifle_DMR_04_F",2]; _this addMagazineCargoGlobal ["Exile_Magazine_Battery",5]; }; }; Then a file to call the crate/static objects from.custom.sqf also in addons:call compileFinal preprocessFileLineNumbers "addons\crate1.sqf";Then include that file in init.sqf like this:[] execVM "addons\custom.sqf"; Nothing fancy but it works for me and all I have to do when updating the server is copy the files over. Edited October 15, 2015 by r0fus Error... 3 Share this post Link to post Share on other sites
TMHackSaW 63 Report post Posted October 15, 2015 What I did was make a file in a new folder where I add my static objects and crates and call that file from init.sqf.First a crate file example.Crate1.sqf in exile.Altis\addons:_box0 = objNull; if (true) then { _this = createVehicle ["Box_IND_WpsSpecial_F", [16093.6,16919.8, [], 0, "CAN_COLLIDE"]; _box0 = _this; _this setDir -2.0; _this setVariable ["permaLoot",true]; clearweaponcargoGlobal _this; clearmagazinecargoGlobal _this; clearItemCargoGlobal _this; _this addItemCargoGlobal ["Exile_Item_MetalBoard", 5]; _this addWeaponCargoGlobal ["srifle_DMR_04_F",2]; _this addMagazineCargoGlobal ["Exile_Magazine_Battery",5]; };Then a file to call the crate/static objects from.custom.sqf also in addons:call compileFinal preprocessFileLineNumbers "addons\crate1.sqf";Then include that file in init.sqf like this:[] execVM "addons\custom.sqf"; Nothing fancy but it works for me and all I have to do when updating the server is copy the files over.where do you put the spawn coords? [16093.6,16919.8]It has only X and Y? 1 Share this post Link to post Share on other sites
r0fus 30 Report post Posted October 15, 2015 (edited) Ah yes. Managed to mess that one up while editing. Should be [X,Y,Z] in the createVehicle line. Tho if you are placing the crate on the ground you dont need the Z coordinate. Edited October 15, 2015 by r0fus Typo 1 Share this post Link to post Share on other sites
D__GTHE REAPER 2 Report post Posted October 15, 2015 Thank you r0Fus will try it now. Share this post Link to post Share on other sites