Author: Champ-1
Author Website:

Requirements: No addons required

Version: 1.3

Short description: With this script you will be able to fill and refill containers with chosen category of items, randomize amount of items in container as well as spawn certain categories with predefined chance.

Date: 2014-04-26 08:51


Comments: (0)
Rating:



 



Categorized Crate Filler Script

by
Champ-1


Description:
With this script you will be able to fill and refill containers with chosen category of items, randomize amount of items in container as well as spawn certain categories with predefined chance.


Installation / Usage:
1. Place "CrateFiller.sqf" in you mission folder.
2. Create any container (box or vehicle) in mission editor and add this to it's Init line:
nul = [this] execVM "CrateFiller.sqf";
3. Edit categories in "CrateFiller.sqf" to add whatever you want (see examples below).

Edit Array for each category to customize crate content for your liking:
_CATEGORY_NAME = [Amount of items, Additional random amount, Probability of appearance];
Examples:
_he_nades = [20,10,70];
Will spawn 20-30 HE underbarrel grenades, 20-30 frag grenades and 20-30 mini grenades with 70% chance for every type of grenades.
_at_mines = [0,5,100];
Will spawn 0-5 AT mines and 0-5 M6 SLAM mines with 100% chance.

All items categories:
//WEAPONS
_B_rifles = [0,0,100];
_B_rifles_black = [0,0,100];
_B_lmg = [0,0,100];
_B_m_rifles = [0,0,100];
_B_pdw = [0,0,100];

_O_rifles = [0,0,100];
_O_lmg = [0,0,100];
_O_m_rifles = [0,0,100];
_O_pdw = [0,0,100];

_I_rifles = [0,0,100];
_I_lmg = [0,0,100];
_I_m_rifles = [0,0,100];
_I_pdw = [0,0,100];

_amfib_rifle = [0,0,100];
_m320_rifle = [0,0,100];
_gm6_rifle = [0,0,100];

//AMMO
_ammo = [0,0,100];
_tracer = [0,0,100];
_lmg_ammo = [0,0,100];
_lmg_tracer = [0,0,100];
_m_ammo = [0,0,100];
_sp_ammo = [0,0,100];
_amfib_ammo = [0,0,100];
_pdw_ammo = [0,0,100];

//LAUNCHERS
_NLAW_launcher = [0,0,100];
_RPG_launcher = [0,0,100];
_Titan_launcher = [0,0,100];
_AA_launcher = [0,0,100];
_launch_ammo = [0,0,100];
_aa_ammo = [0,0,100];

//NADES
_he_nades = [0,0,100];
_3rnd_he_nades = [0,0,100];
_smoke = [0,0,100];
_3rnd_smoke = [0,0,100];
_B_ir_nades = [0,0,100];
_O_ir_nades = [0,0,100];
_I_ir_nades = [0,0,100];

//EXPLOSIVES
_at_mines = [0,0,100];
_ap_mines = [0,0,100];
_exp_charges = [0,0,100];
_satch_charges = [0,0,100];

//ATTACHMENTS
_optics = [0,0,100];
_sp_optics = [0,0,100];
_suprs = [0,0,100];
_attach = [0,0,100];

//OTHER ITEMS
_items = [0,0,100];
_basic_items = [0,0,100];
_kits = [0,0,100];
_firstaid = [0,0,100];
_rngfinder = [0,0,100];
_ldesignator = [0,0,100];
_B_uav_term = [0,0,100];
_O_uav_term = [0,0,100];
_I_uav_term = [0,0,100];

//BACKPACKS
_B_backpack_160 = [0,0,100];
_B_backpack_200 = [0,0,100];
_B_backpack_320 = [0,0,100];

_O_backpack_240 = [0,0,100];
_O_backpack_320 = [0,0,100];

_I_backpack_240 = [0,0,100];
_I_backpack_320 = [0,0,100];

_parachute = [0,0,100];

//HEADGEAR
_B_ech_headgear = [0,0,100];
_B_ech_light_headgear = [0,0,100];
_B_sf_headgear = [0,0,100];
_B_crew_headgear = [0,0,100];
_B_heli_pilot_headgear = [0,0,100];
_B_pilot_headgear = [0,0,100];
_B_cap_headgear = [0,0,100];

_O_protector_headgear = [0,0,100];
_O_crew_headgear = [0,0,100];
_O_heli_pilot_headgear = [0,0,100];
_O_pilot_headgear = [0,0,100];
_O_cap_headgear = [0,0,100];

_I_mich_headgear = [0,0,100];
_I_crew_headgear = [0,0,100];
_I_heli_pilot_headgear = [0,0,100];
_I_pilot_headgear = [0,0,100];
_I_cap_headgear = [0,0,100];

//UNIFORM
_B_uniform = [0,0,100];
_B_tshirt_uniform = [0,0,100];
_B_recon_uniform = [0,0,100];
_B_ghillie_uniform = [0,0,100];
_B_wetsuit_uniform = [0,0,100];
_B_heli_pilot_uniform = [0,0,100];
_B_pilot_uniform = [0,0,100];

_O_uniform = [0,0,100];
_O_ghillie_uniform = [0,0,100];
_O_wetsuit_uniform = [0,0,100];
_O_heli_pilot_uniform = [0,0,100];
_O_pilot_uniform = [0,0,100];

_I_uniform = [0,0,100];
_I_tshirt_uniform = [0,0,100];
_I_ghillie_uniform = [0,0,100];
_I_wetsuit_uniform = [0,0,100];
_I_heli_pilot_uniform = [0,0,100];
_I_pilot_uniform = [0,0,100];

//VESTS
_B_vest_60 = [0,0,100];
_B_vest_100 = [0,0,100];
_B_vest_120 = [0,0,100];
_B_rebreather = [0,0,100];

_O_vest_60 = [0,0,100];
_O_vest_100 = [0,0,100];
_O_vest_120 = [0,0,100];
_O_rebreather = [0,0,100];

_I_vest_60 = [0,0,100];
_I_vest_100 = [0,0,100];
_I_vest_120 = [0,0,100];
_I_rebreather = [0,0,100]; 


License:
Feel free to modify, fix, do whatever. I don't care.


Changelog:
v1.3
- new: option to create a local crate with content personal for every client

v1.26
- new: ability to refill crate when player joining game in progress

v1.25
- new: ability to multiply crate content by players count on the server
- new: added some new items

v1.21
- new: option to return container to it's original spawn position after refill

v1.2
- fix: optimized code for easier editing

v1.1
- fix: MP compatibility

v1.0
- first release


Forum topic:
- BI forums




Enable javascript to be able to download from Armaholic please!



Tags: Ammo,   Box,   Crate