Apoc's Airdrop Assistance - v1.4 Release

Re: Apoc's Airdrop Assistance - v1 Release

« Reply #15 posted: Apr 20, 2015, 06:43 PM »
Thx alot, this is awsome !!

Can you give a step by step guide to how do i make a "soldier kit" ? i mean, setting a crate to spawn things that i want to spawn, for exemple:

Sniper kit: Ghillie suit, Lynx, ammo, LRPS,  Laser designator
Infantry: Zafir, ammo, RCO, Bipod, Anti Tank, AT ammo

Thx for the help

Godzinhu,  Sure!  I'll take a stab at that.  I'll try and post something in a few hours when I'm home and have access to all of my files.

All,
I'm thinking about moving crate configuration into the script config file, for clarity and ease of use.  Since the fn_refillbox function is really just calling another function on the server to actually handle the work, it would make sense to just call that function directly from the addon/mod/thing instead of cluttering up a file designed to support the mission scripts.  Sooo, expect to see a V1.3 of this system soon.

Re: Apoc's Airdrop Assistance - v1 Release

« Reply #16 posted: Apr 20, 2015, 07:24 PM »
Godzinhu,  Sure!  I'll take a stab at that.  I'll try and post something in a few hours when I'm home and have access to all of my files.

All,
I'm thinking about moving crate configuration into the script config file, for clarity and ease of use.  Since the fn_refillbox function is really just calling another function on the server to actually handle the work, it would make sense to just call that function directly from the addon/mod/thing instead of cluttering up a file designed to support the mission scripts.  Sooo, expect to see a V1.3 of this system soon.

Awsome! i cant wait for it ! Tank you :)
  • Offline bolox
  • Mercenary
  • *****
  • Posts: 276

Re: Apoc's Airdrop Assistance - v1 Release

« Reply #17 posted: Apr 20, 2015, 10:22 PM »
Im using inidbi.
Im running this is on a gameserver with full ftp access,but i dont have access to the OS itsself.

Tests are made on my test server.I will run the test server tommorow after work and post the rpt file.
I am getting the confirmation message for sure,but after that i dont see any airdrop and i dont see money being deducted.Which i find strange because creampies airdrop work.Maybe i will try a vanilla version of stratis 1.1 to see if the problem lies with my old version of 1.0b.

Maybe if i add the comment  in clientcompile.sqf
Code: [Select]
fn_dropbox = "client\functions\fn_dropbox.sqf" call mf_compile;
fn_processBox = "client\functions\fn_processBox.sqf" call mf_compile;

will this help possibly? with this UN-commented  its probably conflcting somewhere ?


Thanks matey,will do those tests above,if no joy i will post my rpt file tommorow
Our 250 popular player rust server 1rule- Dont be a dick
www.nomercykillers.com

Re: Apoc's Airdrop Assistance - v1 Release

« Reply #18 posted: Apr 20, 2015, 10:46 PM »
Creampie's runs all client side, so a little different mechanics.

Once you hit OK on the confirm message, the client fires a command to the server to run a function with provided parameters.  The only thing that I can figure is there is a function that is being called server-side that has been modified or doesn't exist in your mission.  Possibly there is a variable on the player that you do not have, although the getVariables should use a default value then and not implode.

Re: Apoc's Airdrop Assistance - v1 Release

« Reply #19 posted: Apr 21, 2015, 12:10 AM »
hmmm that was weird i used the airdrop a lots of time here with no problem, but my last one didnt got anything, just letting you know :)

Re: Apoc's Airdrop Assistance - v1 Release

« Reply #20 posted: Apr 21, 2015, 02:20 AM »
hmmm that was weird i used the airdrop a lots of time here with no problem, but my last one didnt got anything, just letting you know :)

What box type was it?  There was an error in the v1 release which had a boxTypeName uncapitalized.  This caused the Sniper box to spawn with only kitbags in it or empty.

Update to latest version to have that fixed.

Re: Apoc's Airdrop Assistance - v1 Release

« Reply #21 posted: Apr 21, 2015, 02:22 AM »
Warning: Wall of Text Inbound

How to add new boxes to the Airdrop System:

1)  Come up with a stringItemName for your box, e.g.: "superAwesomeBox1"

2)   Now you need to add this in two places:
      2.1)   server\functions\fn_refillbox.sqf           --> This is where you define what is in the box
      2.2)   addons\APOC_Airdrop_Assistance\config.sqf   --> Here's where you add it to the airdrop menu


Adding Box Types to fn_refillbox.sqf
   So, here's some magic that the devs conjured up, and we're going to dip into that little pool.
   
   First, add a new case in the only switch structure in the file, just before the last " }; "
      
Code: [Select]
case "superAwesomeBox1":
{
};
   
   So now the switch command will have a new option when it goes a-searchin'
   However, inside our case, we need the variable _boxItems (array of arrays)
   So, now we'll have this:
      
Code: [Select]
case "superAwesomeBox1":
{
_boxItems = [
["type", ["itemClassName 1", "itemClassName 2"], Quantity1],
["type", ["itemClassName 3", "itemClassName 4"], Quantity2]
];
};

   Now, that array, inside of the _boxItems array has to be formatted just so.  The first part needs to
   be one of three types "wep", "itm", "mag", or "bac".  This tells the next function what type of items it is dealing with.
   You'll need to look up the configs to figure out what your item is classified as.  Look in the existing
   files for inspiration.
   
   Now what is unique, is that the array of classnames -->["itemClassName 1", "itemClassName 2"]<-- is used to
   generate a list of random things the box will have in it.  The number of random items from that list is
   determined by the Quantity1 integer that is at the end of the parent array.  So, if Quantity1 = 1 in our case
   we would end up with either 1 "itemClassName 1" or 1 "itemClassName 2".  If Quantity1=2, then we might have
   2 of "itemClassname 1", or 1&1, or 2 of "itemClassName 2".
   
   So there's also a magical 4th term in the "wep" category array- it is the number of magazines for each weapon
   that is added out of the array.
   
   Now, if you want specific items to spawn in a crate, you'll need to have separate lines for each item you want
   added in.  This is somewhat messy, but doable.
   
Adding Box Types to addons\...Airdrop...\config.sqf
   Here's an easy part.  You just need to add your new box type into the APOC_AA_SupOptions array of arrays
   
Code: [Select]
APOC_AA_SupOptions =
[
// ["stringItemName", "Crate Type for fn_refillBox ,Price," drop type"]
["Launchers", "mission_USLaunchers", 25000, "supply"],
["Assault Rifle", "mission_USSpecial", 10000, "supply"],
["Sniper Rifles", "airdrop_Snipers", 25000, "supply"],
["DLC Rifles", "airdrop_DLC_Rifles", 35000, "supply"],
["DLC LMGs", "airdrop_DLC_LMGs", 35000, "supply"],
["Super Awesome Box", "superAwesomeBox1",   1000000, "supply"],

//"Menu Text", "Crate Type", "Cost", "drop type"
["Food", "Land_Sacks_goods_F", 5000, "picnic"],
["Water", "Land_BarrelWater_F", 5000, "picnic"]
];
   
   So look at the line for the Super Awesome Box.  The first string is the text you want to see in the menu for the player.
   The second string the name of the box that you put into the fn_refillbox.sqf file.  The third part, the number, is the cost
   you want the box to cost.  The fourth needs to be "supply", for a multitude of reasons.
   
   With all of this, you should now have new options within the Airdrop Menus.  Good Luck!

Re: Apoc's Airdrop Assistance - v1 Release

« Reply #22 posted: Apr 21, 2015, 04:35 AM »
Code: [Select]
case "Start Kit":
{
_boxItems =
[
["vest", ["V_PlateCarrierGL_blk", "V_PlateCarrierGL_rgr", "V_PlateCarrierGL_mtp"], Quantity1],
["hat", ["H_HelmetLeaderO_ocamo", "H_HelmetLeaderO_oucamo"], Quantity1],
["item", ["ItemGPS"], Quantity1],
["item", ["Binocular", "Rangefinder"], Quantity1],
["item", ["B_Carryall_khk", "B_Carryall_mcamo", "B_Carryall_oli", "B_Carryall_oucamo"], Quantity1]
];
};

So i will get one carrier gl random, one helmet random, one gps, a random item (binoc or range), and a random backpack right ? my code is correct ?

Re: Apoc's Airdrop Assistance - v1 Release

« Reply #23 posted: Apr 21, 2015, 04:54 AM »
Code: [Select]
case "Start Kit":
{
_boxItems =
[
["vest", ["V_PlateCarrierGL_blk", "V_PlateCarrierGL_rgr", "V_PlateCarrierGL_mtp"], Quantity1],
["hat", ["H_HelmetLeaderO_ocamo", "H_HelmetLeaderO_oucamo"], Quantity1],
["item", ["ItemGPS"], Quantity1],
["item", ["Binocular", "Rangefinder"], Quantity1],
["item", ["B_Carryall_khk", "B_Carryall_mcamo", "B_Carryall_oli", "B_Carryall_oucamo"], Quantity1]
];
};

So i will get one carrier gl random, one helmet random, one gps, a random item (binoc or range), and a random backpack right ? my code is correct ?

No, not quite, bud.  In the instructions, I stated that the first term has to be either "wep", "itm", or "mag".  You need to revise your code to match that description.

Also, change Quantity1 to be an integer, in other words, just a number.  Any array for weapons should have a fourth value, and that will be how many mags for the weapon spawned from the array you want.

Re: Apoc's Airdrop Assistance - v1 Release

« Reply #24 posted: Apr 21, 2015, 05:17 AM »
Thx i think i have got it :)

also i have a new question, how do i create a new tab for the shop ?

i mean, when i acess "airdrop"

its shows for me Vehicle, Supply etc, how do i create a new tabe, like "tanks, or helis", i know that i can use tanks or helis on vehicles, but i want to separate, i hope for you understand me

Re: Apoc's Airdrop Assistance - v1 Release

« Reply #25 posted: Apr 21, 2015, 05:28 AM »
Thx i think i have got it :)

also i have a new question, how do i create a new tab for the shop ?

i mean, when i acess "airdrop"

its shows for me Vehicle, Supply etc, how do i create a new tabe, like "tanks, or helis", i know that i can use tanks or helis on vehicles, but i want to separate, i hope for you understand me

Well, that's quite a bit more complicated.  You have to modify every part of the code to add extra categories at the same level as what I'm using now.  Are you trying to replace the vehicle store with airdrops?

I'll have to play around with some settings, I might be able to make it so there are subcategories under Vehicles, but I'll have to do some testing this week to see how the code handles it.

Re: Apoc's Airdrop Assistance - v1 Release

« Reply #26 posted: Apr 21, 2015, 05:40 AM »
Nah im not tryng to make a store by airdrops, i dont want to kill my self tryng this xD, im just tryng to separate "vehicles" "guns" and "supplys".

Code: [Select]
case "Kit_Inicial":
{
_boxItems =
[
["itm", ["V_PlateCarrierGL_blk", "V_PlateCarrierGL_rgr", "V_PlateCarrierGL_mtp"], 1],
["itm", ["H_HelmetLeaderO_ocamo", "H_HelmetLeaderO_oucamo"], 1],
["itm", ["ItemGPS"], 1],
["itm", ["Binocular", "Rangefinder"], 1],
["itm", ["B_Carryall_khk", "B_Carryall_mcamo", "B_Carryall_oli", "B_Carryall_oucamo"], 1]
];
};

for some crazy reason when i try to call my kit its calling a diferent box

Re: Apoc's Airdrop Assistance - v1 Release

« Reply #27 posted: Apr 21, 2015, 05:47 AM »
Nah im not tryng to make a store by airdrops, i dont want to kill my self tryng this xD, im just tryng to separate "vehicles" "guns" and "supplys".

Code: [Select]
case "Kit_Inicial":
{
_boxItems =
[
["itm", ["V_PlateCarrierGL_blk", "V_PlateCarrierGL_rgr", "V_PlateCarrierGL_mtp"], 1],
["itm", ["H_HelmetLeaderO_ocamo", "H_HelmetLeaderO_oucamo"], 1],
["itm", ["ItemGPS"], 1],
["itm", ["Binocular", "Rangefinder"], 1],
["itm", ["B_Carryall_khk", "B_Carryall_mcamo", "B_Carryall_oli", "B_Carryall_oucamo"], 1]
];
};

for some crazy reason when i try to call my kit its calling a diferent box

I'd look at your server.rpt and see what the error is.  I'm pretty sure that binoc and rangefinders are classified as weapons.  Not sure about GPS.  Look for the same class names in other box layouts for ideas.

I'll take a crack at adding another layer to the menus to aid in making the list shorter if you have a lot of options.

Re: Apoc's Airdrop Assistance - v1 Release

« Reply #28 posted: Apr 21, 2015, 05:52 AM »
i think that the error is here
Code: [Select]
// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
// @file Version: 1.0
// @file Name: fn_refillbox.sqf  "fn_refillbox"
// @file Author: [404] Pulse , [404] Costlyy , [404] Deadbeat, AgentRev
// @file Created: 22/1/2012 00:00
// @file Args: [OBJECT (Weapons box that needs filling), STRING (Name of the fill to give to object)]

if (!isServer) exitWith {};

#define RANDOM_BETWEEN(START,END) (START + floor random ((END - START) + 1))

private ["_box", "_boxType", "_boxItems", "_item", "_qty", "_mag"];
_box = _this select 0;
_boxType = _this select 1;

_box allowDamage false; // No more fucking busted crates
_box setVariable ["A3W_inventoryLockR3F", true, true];

// Clear pre-existing cargo first
//clearBackpackCargoGlobal _box;
clearMagazineCargoGlobal _box;
clearWeaponCargoGlobal _box;
clearItemCargoGlobal _box;

if (_boxType == "mission_USSpecial2") then { _boxType = "mission_USSpecial" };

switch (_boxType) do
{
case "mission_USLaunchers":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
["wep", ["launch_RPG32_F", "launch_NLAW_F", "launch_Titan_short_F"], RANDOM_BETWEEN(3,5), RANDOM_BETWEEN(1,2)],
["wep", "launch_Titan_F", RANDOM_BETWEEN(1,2), RANDOM_BETWEEN(1,2)],
["mag", ["ClaymoreDirectionalMine_Remote_Mag", "SLAMDirectionalMine_Wire_Mag", "ATMine_Range_Mag", "DemoCharge_Remote_Mag", "SatchelCharge_Remote_Mag"], RANDOM_BETWEEN(3,8)]
];
};
case "mission_USSpecial":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
//["itm", "NVGoggles", 5],
["wep", ["Binocular", "Rangefinder"], RANDOM_BETWEEN(1,5)],
["itm", "Medikit", RANDOM_BETWEEN(1,3)],
["itm", "Toolkit", RANDOM_BETWEEN(0,1)],
["itm", ["optic_MRCO", "optic_Arco", "optic_Hamr", "optic_SOS"], RANDOM_BETWEEN(0,2)],
["itm", ["muzzle_snds_M", "muzzle_snds_H", "muzzle_snds_H_MG", "muzzle_snds_B", "muzzle_snds_acp"], RANDOM_BETWEEN(0,3)],
["wep", ["hgun_Pistol_heavy_01_F", "hgun_Pistol_heavy_01_MRD_F", "hgun_Pistol_heavy_02_F", "hgun_Pistol_heavy_02_Yorris_F"], RANDOM_BETWEEN(1,3), RANDOM_BETWEEN(3,5)],
["wep", ["arifle_MXM_F", "srifle_EBR_F", "srifle_DMR_01_DMS_F"], RANDOM_BETWEEN(1,3), RANDOM_BETWEEN(4,6)],
["wep", ["LMG_Mk200_F", "LMG_Zafir_F"], RANDOM_BETWEEN(1,3), RANDOM_BETWEEN(2,4)],
["mag", "30Rnd_556x45_Stanag", RANDOM_BETWEEN(4,8)],
["mag", "30Rnd_65x39_caseless_mag", RANDOM_BETWEEN(4,8)],
["mag", "30Rnd_65x39_caseless_green", RANDOM_BETWEEN(4,8)],
["mag", "9Rnd_45ACP_Mag", RANDOM_BETWEEN(1,5)]
];
};
case "mission_Main_A3snipers":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
["wep", ["srifle_LRR_LRPS_F", "srifle_LRR_camo_LRPS_F", "srifle_GM6_LRPS_F", "srifle_GM6_camo_LRPS_F"], RANDOM_BETWEEN(1,3), RANDOM_BETWEEN(4,6)],
["wep", ["srifle_EBR_F", "srifle_DMR_01_F"], RANDOM_BETWEEN(1,3), RANDOM_BETWEEN(4,6)],
["wep", ["Binocular", "Rangefinder"], RANDOM_BETWEEN(1,3)],
["itm", "optic_DMS", RANDOM_BETWEEN(1,2)]
];
};
case "mission_TOP_Sniper":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
["wep", ["srifle_LRR_SOS_F", "srifle_LRR_camo_SOS_F", "srifle_GM6_SOS_F", "srifle_GM6_camo_SOS_F"], RANDOM_BETWEEN(1,5), RANDOM_BETWEEN(4,6)],
["wep", ["srifle_EBR_F", "srifle_DMR_01_F"], RANDOM_BETWEEN(1,3), RANDOM_BETWEEN(4,6)],

["wep", "Rangefinder", RANDOM_BETWEEN(1,3)],
["itm", ["optic_DMS","optic_Nightstalker","optic_tws"], RANDOM_BETWEEN(1,5)]
];
};
case "mission_TOP_Gear1":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
["itm", ["V_RebreatherB", "V_PlateCarrierIAGL_dgtl", "V_TacVest_camo", "V_PlateCarrierGL_rgr"], RANDOM_BETWEEN(1,8)],
["itm", ["B_Carryall_mcamo", "B_Kitbag_mcamo"], RANDOM_BETWEEN(1,5)],
["itm", ["U_B_HeliPilotCoveralls","U_B_Wetsuit","U_B_CombatUniform_mcam_vest"], RANDOM_BETWEEN(1,4)],
["itm", ["H_HelmetCrew_B","H_CrewHelmetHeli_B","H_HelmetB_plain_blk","H_HelmetSpecB"], RANDOM_BETWEEN(1,5)]
];
};
case "airdrop_DLC_Rifles":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
["wep", ["srifle_DMR_03_multicam_F", "srifle_DMR_02_sniper_F", "srifle_DMR_05_hex_F", "srifle_DMR_04_Tan_F"], 4,4],
["itm", ["V_PlateCarrierIAGL_dgtl", "V_TacVest_camo", "V_PlateCarrierGL_rgr"], RANDOM_BETWEEN(4,8)],
["itm", ["B_Carryall_mcamo", "B_Kitbag_mcamo"], RANDOM_BETWEEN(2,5)],
["itm", ["bipod_01_F_blk", "bipod_02_F_hex"], 3],
["itm", ["optic_DMS","optic_AMS","optic_tws","optic_KHS_blk"], RANDOM_BETWEEN(3,5)],
["itm", ["muzzle_snds_B", "muzzle_snds_338_black", "muzzle_snds_338_sand", "muzzle_snds_93mmg"], RANDOM_BETWEEN(3,5)]
];
};
case "airdrop_DLC_LMGs":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
["wep", ["MMG_02_black_F", "MMG_02_camo_F","MMG_02_sand_F","MMG_01_hex_F","MMG_01_tan_F"], 4,4],
["itm", ["V_PlateCarrierIAGL_dgtl", "V_TacVest_camo", "V_PlateCarrierGL_rgr"], RANDOM_BETWEEN(1,8)],
["itm", ["B_Carryall_mcamo", "B_Kitbag_mcamo"], RANDOM_BETWEEN(2,5)],
["itm", ["bipod_01_F_blk", "bipod_02_F_hex"], 2],
["itm", ["optic_DMS","optic_AMS","optic_tws","optic_KHS_blk"], RANDOM_BETWEEN(3,5)],
["itm", ["muzzle_snds_338_black", "muzzle_snds_338_sand", "muzzle_snds_93mmg"], RANDOM_BETWEEN(3,5)]
];
};
case "airdrop_Snipers":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
["wep", ["srifle_LRR_LRPS_F", "srifle_LRR_camo_LRPS_F", "srifle_GM6_LRPS_F", "srifle_GM6_camo_LRPS_F"], RANDOM_BETWEEN(3,4), RANDOM_BETWEEN(6,8)],
["wep", ["srifle_EBR_F", "srifle_DMR_01_F"], RANDOM_BETWEEN(2,3), RANDOM_BETWEEN(6,8)],
["wep", ["Binocular", "Rangefinder"], RANDOM_BETWEEN(1,3)],
["itm", ["B_Carryall_mcamo", "B_Kitbag_mcamo"], RANDOM_BETWEEN(2,5)],
["itm", ["optic_DMS","optic_AMS","optic_tws","optic_KHS_blk"], RANDOM_BETWEEN(5,8)]
];
};
};
case "airdrop_DLC_Rifles":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
["wep", ["srifle_DMR_03_multicam_F", "srifle_DMR_02_sniper_F", "srifle_DMR_05_hex_F", "srifle_DMR_04_Tan_F"], 2,4],
["itm", ["V_RebreatherB", "V_PlateCarrierIAGL_dgtl", "V_TacVest_camo", "V_PlateCarrierGL_rgr"], RANDOM_BETWEEN(1,8)],
["itm", ["B_Carryall_mcamo", "B_Kitbag_mcamo"], RANDOM_BETWEEN(2,5)],
["itm", ["bipod_01_F_blk", "bipod_02_F_hex"], 3]
];
};
case "airdrop_DLC_LMGs":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
["wep", ["MMG_02_black_F", "MMG_01_hex_F"], 2,5],
["itm", ["V_RebreatherB", "V_PlateCarrierIAGL_dgtl", "V_TacVest_camo", "V_PlateCarrierGL_rgr"], RANDOM_BETWEEN(1,8)],
["itm", ["B_Carryall_mcamo", "B_Kitbag_mcamo"], RANDOM_BETWEEN(2,5)],
["itm", ["bipod_01_F_blk", "bipod_02_F_hex"], 2]
];
};
case "Kit_Inicial":
{
_boxItems =
[
["itm", ["V_PlateCarrierGL_blk", "V_PlateCarrierGL_rgr", "V_PlateCarrierGL_mtp"], 1],
["itm", ["H_HelmetLeaderO_ocamo", "H_HelmetLeaderO_oucamo"], 1],
["itm", ["ItemGPS"], 1],
["itm", ["Binocular", "Rangefinder"], 1],
["itm", ["B_Carryall_khk", "B_Carryall_mcamo", "B_Carryall_oli", "B_Carryall_oucamo"], 1]
];
};
[_box, _boxItems] call processItems;


Here is the config too:

Code: [Select]

//Configuration for Airdrop Assistance
//Author: Apoc

APOC_AA_coolDownTime = 10; //Expressed in sec

APOC_AA_VehOptions =
[ // ["Menu Text", ItemClassname, Price, "Drop Type"]
["Quadbike (Civilian)", "C_Quadbike_01_F", 900, "vehicle"],
["Offroad", "C_Offroad_01_F", 1650, "vehicle"],
["Strider", "I_MRAP_03_F", 6000, "vehicle"],
["HEMTT Fuel", "B_Truck_01_fuel_F", 13500, "vehicle"],
["HEMTT Repair", "B_Truck_01_Repair_F", 18750, "vehicle"],
["HEMTT Ammo", "B_Truck_01_ammo_F", 41250, "vehicle"],
["M2A4 Slammer HMG", "B_MBT_01_TUSK_F", 75000, "vehicle"],
["MH-9 Hummingbird", "B_Heli_Light_01_F", 7500, "vehicle"]
];

APOC_AA_SupOptions =
[// ["stringItemName", "Crate Type for fn_refillBox ,Price," drop type"]
["Launchers", "mission_USLaunchers", 25000, "supply"],
["Assault Rifle", "mission_USSpecial", 10000, "supply"],
["Sniper Rifles", "airdrop_Snipers", 25000, "supply"],
["DLC Rifles", "airdrop_DLC_Rifles", 35000, "supply"],
["DLC LMGs", "airdrop_DLC_LMGs", 35000, "supply"],
["Kit inicial", "Kit_Inicial", 1410, "supply"],

//"Menu Text", "Crate Type", "Cost", "drop type"
["Comida 50x", "Land_Sacks_goods_F", 5000, "picnic"],
["Agua 50x", "Land_BarrelWater_F", 5000, "picnic"]
];

Re: Apoc's Airdrop Assistance - v1 Release

« Reply #29 posted: Apr 21, 2015, 06:10 AM »
ok i got good new, some of my itens are spawned on my box now after some fix on the file, but the carryall didnt spawned, it spawned 2 kitbag(mtp) instead of my carryall

[edit] Yea i dont have idea why its spawning 2 kitbags instead of my carryall, here is the new code:

Code: [Select]

// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
// @file Version: 1.0
// @file Name: fn_refillbox.sqf  "fn_refillbox"
// @file Author: [404] Pulse , [404] Costlyy , [404] Deadbeat, AgentRev
// @file Created: 22/1/2012 00:00
// @file Args: [OBJECT (Weapons box that needs filling), STRING (Name of the fill to give to object)]

if (!isServer) exitWith {};

#define RANDOM_BETWEEN(START,END) (START + floor random ((END - START) + 1))

private ["_box", "_boxType", "_boxItems", "_item", "_qty", "_mag"];
_box = _this select 0;
_boxType = _this select 1;

_box allowDamage false; // No more fucking busted crates
_box setVariable ["A3W_inventoryLockR3F", true, true];

// Clear pre-existing cargo first
//clearBackpackCargoGlobal _box;
clearMagazineCargoGlobal _box;
clearWeaponCargoGlobal _box;
clearItemCargoGlobal _box;

if (_boxType == "mission_USSpecial2") then { _boxType = "mission_USSpecial" };

switch (_boxType) do
{
case "mission_USLaunchers":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
["wep", ["launch_RPG32_F", "launch_NLAW_F", "launch_Titan_short_F"], RANDOM_BETWEEN(3,5), RANDOM_BETWEEN(1,2)],
["wep", "launch_Titan_F", RANDOM_BETWEEN(1,2), RANDOM_BETWEEN(1,2)],
["mag", ["ClaymoreDirectionalMine_Remote_Mag", "SLAMDirectionalMine_Wire_Mag", "ATMine_Range_Mag", "DemoCharge_Remote_Mag", "SatchelCharge_Remote_Mag"], RANDOM_BETWEEN(3,8)]
];
};
case "mission_USSpecial":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
//["itm", "NVGoggles", 5],
["wep", ["Binocular", "Rangefinder"], RANDOM_BETWEEN(1,5)],
["itm", "Medikit", RANDOM_BETWEEN(1,3)],
["itm", "Toolkit", RANDOM_BETWEEN(0,1)],
["itm", ["optic_MRCO", "optic_Arco", "optic_Hamr", "optic_SOS"], RANDOM_BETWEEN(0,2)],
["itm", ["muzzle_snds_M", "muzzle_snds_H", "muzzle_snds_H_MG", "muzzle_snds_B", "muzzle_snds_acp"], RANDOM_BETWEEN(0,3)],
["wep", ["hgun_Pistol_heavy_01_F", "hgun_Pistol_heavy_01_MRD_F", "hgun_Pistol_heavy_02_F", "hgun_Pistol_heavy_02_Yorris_F"], RANDOM_BETWEEN(1,3), RANDOM_BETWEEN(3,5)],
["wep", ["arifle_MXM_F", "srifle_EBR_F", "srifle_DMR_01_DMS_F"], RANDOM_BETWEEN(1,3), RANDOM_BETWEEN(4,6)],
["wep", ["LMG_Mk200_F", "LMG_Zafir_F"], RANDOM_BETWEEN(1,3), RANDOM_BETWEEN(2,4)],
["mag", "30Rnd_556x45_Stanag", RANDOM_BETWEEN(4,8)],
["mag", "30Rnd_65x39_caseless_mag", RANDOM_BETWEEN(4,8)],
["mag", "30Rnd_65x39_caseless_green", RANDOM_BETWEEN(4,8)],
["mag", "9Rnd_45ACP_Mag", RANDOM_BETWEEN(1,5)]
];
};
case "mission_Main_A3snipers":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
["wep", ["srifle_LRR_LRPS_F", "srifle_LRR_camo_LRPS_F", "srifle_GM6_LRPS_F", "srifle_GM6_camo_LRPS_F"], RANDOM_BETWEEN(1,3), RANDOM_BETWEEN(4,6)],
["wep", ["srifle_EBR_F", "srifle_DMR_01_F"], RANDOM_BETWEEN(1,3), RANDOM_BETWEEN(4,6)],
["wep", ["Binocular", "Rangefinder"], RANDOM_BETWEEN(1,3)],
["itm", "optic_DMS", RANDOM_BETWEEN(1,2)]
];
};
case "mission_TOP_Sniper":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
["wep", ["srifle_LRR_SOS_F", "srifle_LRR_camo_SOS_F", "srifle_GM6_SOS_F", "srifle_GM6_camo_SOS_F"], RANDOM_BETWEEN(1,5), RANDOM_BETWEEN(4,6)],
["wep", ["srifle_EBR_F", "srifle_DMR_01_F"], RANDOM_BETWEEN(1,3), RANDOM_BETWEEN(4,6)],

["wep", "Rangefinder", RANDOM_BETWEEN(1,3)],
["itm", ["optic_DMS","optic_Nightstalker","optic_tws"], RANDOM_BETWEEN(1,5)]
];
};
case "mission_TOP_Gear1":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
["itm", ["V_RebreatherB", "V_PlateCarrierIAGL_dgtl", "V_TacVest_camo", "V_PlateCarrierGL_rgr"], RANDOM_BETWEEN(1,8)],
["itm", ["B_Carryall_mcamo", "B_Kitbag_mcamo"], RANDOM_BETWEEN(1,5)],
["itm", ["U_B_HeliPilotCoveralls","U_B_Wetsuit","U_B_CombatUniform_mcam_vest"], RANDOM_BETWEEN(1,4)],
["itm", ["H_HelmetCrew_B","H_CrewHelmetHeli_B","H_HelmetB_plain_blk","H_HelmetSpecB"], RANDOM_BETWEEN(1,5)]
];
};
case "airdrop_DLC_Rifles":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
["wep", ["srifle_DMR_03_multicam_F", "srifle_DMR_02_sniper_F", "srifle_DMR_05_hex_F", "srifle_DMR_04_Tan_F"], 4,4],
["itm", ["V_PlateCarrierIAGL_dgtl", "V_TacVest_camo", "V_PlateCarrierGL_rgr"], RANDOM_BETWEEN(4,8)],
["itm", ["B_Carryall_mcamo", "B_Kitbag_mcamo"], RANDOM_BETWEEN(2,5)],
["itm", ["bipod_01_F_blk", "bipod_02_F_hex"], 3],
["itm", ["optic_DMS","optic_AMS","optic_tws","optic_KHS_blk"], RANDOM_BETWEEN(3,5)],
["itm", ["muzzle_snds_B", "muzzle_snds_338_black", "muzzle_snds_338_sand", "muzzle_snds_93mmg"], RANDOM_BETWEEN(3,5)]
];
};
case "airdrop_DLC_LMGs":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
["wep", ["MMG_02_black_F", "MMG_02_camo_F","MMG_02_sand_F","MMG_01_hex_F","MMG_01_tan_F"], 4,4],
["itm", ["V_PlateCarrierIAGL_dgtl", "V_TacVest_camo", "V_PlateCarrierGL_rgr"], RANDOM_BETWEEN(1,8)],
["itm", ["B_Carryall_mcamo", "B_Kitbag_mcamo"], RANDOM_BETWEEN(2,5)],
["itm", ["bipod_01_F_blk", "bipod_02_F_hex"], 2],
["itm", ["optic_DMS","optic_AMS","optic_tws","optic_KHS_blk"], RANDOM_BETWEEN(3,5)],
["itm", ["muzzle_snds_338_black", "muzzle_snds_338_sand", "muzzle_snds_93mmg"], RANDOM_BETWEEN(3,5)]
];
};
case "airdrop_Snipers":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
["wep", ["srifle_LRR_LRPS_F", "srifle_LRR_camo_LRPS_F", "srifle_GM6_LRPS_F", "srifle_GM6_camo_LRPS_F"], RANDOM_BETWEEN(3,4), RANDOM_BETWEEN(6,8)],
["wep", ["srifle_EBR_F", "srifle_DMR_01_F"], RANDOM_BETWEEN(2,3), RANDOM_BETWEEN(6,8)],
["wep", ["Binocular", "Rangefinder"], RANDOM_BETWEEN(1,3)],
["itm", ["B_Carryall_mcamo", "B_Kitbag_mcamo"], RANDOM_BETWEEN(2,5)],
["itm", ["optic_DMS","optic_AMS","optic_tws","optic_KHS_blk"], RANDOM_BETWEEN(5,8)]
];
};
case "airdrop_DLC_Rifles":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
["wep", ["srifle_DMR_03_multicam_F", "srifle_DMR_02_sniper_F", "srifle_DMR_05_hex_F", "srifle_DMR_04_Tan_F"], 2,4],
["itm", ["V_RebreatherB", "V_PlateCarrierIAGL_dgtl", "V_TacVest_camo", "V_PlateCarrierGL_rgr"], RANDOM_BETWEEN(1,8)],
["itm", ["B_Carryall_mcamo", "B_Kitbag_mcamo"], RANDOM_BETWEEN(2,5)],
["itm", ["bipod_01_F_blk", "bipod_02_F_hex"], 3]
];
};
case "airdrop_DLC_LMGs":
{
_boxItems =
[
// Item type, Item class(es), # of items, # of magazines per weapon
["wep", ["MMG_02_black_F", "MMG_01_hex_F"], 2,5],
["itm", ["V_RebreatherB", "V_PlateCarrierIAGL_dgtl", "V_TacVest_camo", "V_PlateCarrierGL_rgr"], RANDOM_BETWEEN(1,8)],
["itm", ["B_Carryall_mcamo", "B_Kitbag_mcamo"], RANDOM_BETWEEN(2,5)],
["itm", ["bipod_01_F_blk", "bipod_02_F_hex"], 2]
];
};
case "Kit_Inicial":
{
_boxItems =
[
["wep", ["Binocular", "Rangefinder"], 1],
["itm", ["V_PlateCarrierGL_blk", "V_PlateCarrierGL_rgr", "V_PlateCarrierGL_mtp"], 1],
["itm", ["H_HelmetLeaderO_ocamo", "H_HelmetLeaderO_oucamo"], 1],
["itm", ["ItemGPS"], 1],
["itm", ["B_Carryall_khk", "B_Carryall_mcamo", "B_Carryall_oli", "B_Carryall_oucamo"], 1]
];
};
};
[_box, _boxItems] call processItems;



[Edit2]
Yea i dont know why its happening... the carryal never drop but its always spawns 2 kitbags wtfff ><