Jump to content

Recommended Posts

u0o8wB4.pngfuusCeE.pngWlpgLF5.png

REFDoQK.png

GF Auto Loot Airdrops Script - Mod

by

 

GEORGE FLOROS [GR]

 

 

Description:

GF Auto Loot Airdrops , will detect the enabled Mods , without editing lists,for loot.
You are free to do anything but i would like to give me Credits for this!
Simple and easy to use and adapt .
Have Fun !

 


Installation / Usage:

For usage instructions and information of how to use the GF Auto Loot Airdrops Script please refer to the included documentation and/or example mission.

Place in your mission the files . There is everything included , in the initServer.sqf , to copy paste in your mission.

https://community.bistudio.com/wiki/SQF_syntax
Don't try to open this with the simple notepad.

For everything that is with comment // in front or between /*
means that it is disabled , so there is no need to delete the extra lines.

You can open this ex:
with notepad++
https://notepad-plus-plus.org/

and also use the extra pluggins
(this way will be better , it will give also some certain colors to be able to detect ex. problems )
http://www.armaholic.com/page.php?id=8680

or use any other program for editing .

For the Compilation List of my GF Scripts , you can search in:

https://forums.bohemia.net/forums/topic/215850-compilation-list-of-my-gf-scripts/

 


Notes:

GF Auto Loot Airdrops , will detect the enabled Mods , without editing lists,for loot.
There are 4 options available :
1 = Load every Mod + Bohemia Loot , 2 = Load every Mod - No Bohemia Loot ,
3 = Load Bohemia Loot Only , 4 = Custom items only.
Custom arrays can be used as well.
There are Blacklist Zones available , 5 from default and
a safe distanse from players.
This is the new reedited version of the previous GF Airdrops script.
More information inside the GF_Auto_Loot_Airdrops.sqf
There is also included a mod version , posible to unpack and edit.

 


Credits and Thanks to :

Thanks to All script contributors
Thanks to everyone who tries to do the best for this game!
Thanks to BIS for such a great platform .
Thanks to BIS Community and BIS Community Forums .
Thanks to Armaholic Community and Forums .

 

 

Changelog:

v1.0


Forum topic:
- Armaholic forums http://www.armaholic.com/forums.php?m=posts&q=40315

 

 

Armaholic

GF Auto Loot Airdrops Script - Mod

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Hello George ! Hope your doing well.
I see you working on a ''dynamic simulation''. I did understand that this might save some FPS for the player.
So I'm asking you: will you add the dynamic simulation to this script when ennemies is spawend and maybe the auto loot crash too ?

One thing with the Auto loot airdrops is that I'm looking for a way to set the airdrops not far from the player.

I did modifie this line: Line 60 : ''GF_ALA_Distanse_from_Players            = 300;        //    Add here the distance from players''
Instead of 300 I put 10. But unfortunatly the airdrops continu to spawn far from the player.

 

Thank you !

  • Like 1

Share this post


Link to post
Share on other sites
5 hours ago, MisterOth said:

will you add the dynamic simulation to this script when ennemies is spawend and maybe the auto loot crash too ?

 

Yes this actually must be added in every script that is including units, as an extra available option.

For the distance , is about a safe distance from the spawn and it's not refering on the spawn distance.

 

in order to

 

line: 403 _Pos = [] call BIS_fnc_randomPos;

to this for SP :

ex: 500m distance from player

_Pos = [[[position player, 500]],[]] call BIS_fnc_randomPos;

else if you are playng in MP with more than one player ,

then the code below will select a player on random :

 

# delete this from 106 :

GF_ALA_allPlayers = allUnits select {isPlayer _x && {!(_x isKindOf "HeadlessClient_F")}};

 

add this in line 403 : ( this is better and so else it will randomize the player )

GF_ALA_allPlayers = [];
{if (isPlayer _x) then{GF_ALA_allPlayers pushBack _x;};}forEach playableUnits;
GF_ALA_allPlayer_Random = selectrandom GF_ALA_allPlayers;

and then the same code as above , you can also add instead of 500 :

_Pos = [[[position player, 250 + random 250]],[]] call BIS_fnc_randomPos;

 

First of all i want to finish with the Population Scripts and once the are done , i 'll try to update these scripts as well !

 

So try the changes and tell me !

  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you. It worked perfectly !

 

Also good luck with the Population script and all your work.

  • Thanks 1

Share this post


Link to post
Share on other sites
9 minutes ago, MisterOth said:

Population script

 

Thank you very much MisterOth , i'm fixing the position scripts and it will be soon complete !

  • Like 1

Share this post


Link to post
Share on other sites
On 2/28/2019 at 6:06 PM, GEORGE FLOROS GR said:

else if you are playng in MP with more than one player ,

then the code below will select a player on random :

 

# delete this from 106 :


GF_ALA_allPlayers = allUnits select {isPlayer _x && {!(_x isKindOf "HeadlessClient_F")}};

  

add this in line 403 : ( this is better and so else it will randomize the player )


GF_ALA_allPlayers = [];
{if (isPlayer _x) then{GF_ALA_allPlayers pushBack _x;};}forEach playableUnits;
GF_ALA_allPlayer_Random = selectrandom GF_ALA_allPlayers;

and then the same code as above , you can also add instead of 500 :


_Pos = [[[position player, 250 + random 250]],[]] call BIS_fnc_randomPos;

  

First of all i want to finish with the Population Scripts and once the are done , i 'll try to update these scripts as well !

 

So try the changes and tell me !

 

Hello! @GEORGE FLOROS GR

 

I'm trying to modify a mission to bring this airdrop script to it.

 

The script works fine but when I try to modify it with what you comment above for MP (to make the airdrop spawn near players) it doesn't work.

 

¿Can you help me to make it work?

 

I can give you the pbo mission if you need it.

  • Like 1

Share this post


Link to post
Share on other sites

Hello @Desperta Ferro !

 

Is it working generally , or just when you edited this ? because i think that so else it doesn't work properly due to the "waituntil" update , as the most of my scripts.

 

Share this post


Link to post
Share on other sites

Thanks for your reply @GEORGE FLOROS GR

 

It seems to work well, I hear the plane sound and I see the mark of the airdrop on the map. But when I edited it doesn't work.

 

The problem is that in this mission you spawn in an area and if you leave the area you are automatically teleported inside the area, thats why I want to spawn the airdrop near the players.

 

I am going to send you a pm with the mission files via drive. If you can take a look at it I would appreciate it. Or if you know other script for auto loot airdrop that works in 2020.

 

Thanks!

  • Like 1

Share this post


Link to post
Share on other sites
37 minutes ago, Desperta Ferro said:

want to spawn the airdrop near the players.

 

Try :

Spoiler




//________________  Author : GEORGE FLOROS [GR] ___________ 23.12.18 _____________ 


/*
________________ GF Auto Loot Airdrops Script - Mod	________________

https://forums.bohemia.net/forums/topic/220962-gf-auto-loot-airdrops-script-mod/

Please keep the Credits or add them to your Diary

https://community.bistudio.com/wiki/SQF_syntax
Don't try to open this with the simple notepad.
For everything that is with comment  //  in front  or between /*
means that it is disabled , so there is no need to delete the extra lines.

You can open this ex:
with notepad++
https://notepad-plus-plus.org/

and also use the extra pluggins
(this way will be better , it will give also some certain colors to be able to detect ex. problems )
http://www.armaholic.com/page.php?id=8680

or use any other program for editing .

For the Compilation List of my GF Scripts , you can search in:
https://forums.bohemia.net/forums/topic/215850-compilation-list-of-my-gf-scripts/
*/


diag_log "//________________ GF_Auto_Loot_Airdrops initializing _____________";


//________________ Settings ________________
//________________ Set true or false  ________________

GF_ALA_Systemchat_info					= true;		
GF_ALA_Hintsilent_info					= true;
GF_ALA_diag_log_info					= true;
GF_ALA_Debug 							= true;


GF_ALA_next_drop_in_sec    				= 900;       
GF_ALA_height_of_drop      				= 500;    
   
GF_ALA_Number							= 5;		//	Number of the Airdrops
GF_ALA_Number_random					= 5;		//	+ random 5 Airdrops

GF_ALA_Spawned_Items_Number    			= 10;
GF_ALA_Spawned_Items_Number_random    	= 10;


//GF_ALA_Select	-->	1 = Load every Mod + Bohemia Items , 2 = Load every Mod - No Bohemia Items , 3 = Load Bohemia Items Only , 4 = Custom items only
GF_ALA_Select 							= 1;					

GF_ALA_Distanse_from_Players			= 300;		//	Add here the distance from players

GF_ALA_Create_Markers					= true;		//	Create a Marker for the Airdrops	

GF_ALA_Spawn_Enemy						= true;		//	Spawn Enemy at the site
GF_ALA_Enemy_Side						= east;		//	This is for Normal Spawn and EOS , NOT for the DAC units

GF_ALA_Squad_Members					= 5;		//	+ floor random 5 below
GF_ALA_Squad_Members_random				= 5;

GF_ALA_set_AiSkill						= 0.50;
GF_ALA_set_AiSkill_random				= 0.50;

GF_ALA_Patrol_distance 					= 100;		//	The distance for BIS_fnc_taskPatrol
GF_ALA_Patrol_distance_random 			= 250;	

//	Type_of_Cargo_array - can be any object or vehicle
Type_of_Cargo_array = [
	"B_supplyCrate_F",
	"I_CargoNet_01_ammo_F"
	];




//________________	Enemy Array 	________________

GF_ALA_Pool_Infantry = [
	"O_G_officer_F","O_G_Soldier_SL_F","O_G_Soldier_TL_F","O_G_medic_F","O_G_engineer_F","O_G_Soldier_exp_F","O_G_Soldier_GL_F",
	"O_G_Soldier_M_F","O_G_Soldier_LAT_F","O_G_Soldier_A_F","O_G_Soldier_F","O_G_Soldier_lite_F","O_G_Sharpshooter_F",
	"O_G_Soldier_universal_F"
	];
	
	
	
if (GF_ALA_Systemchat_info) then {
systemchat "GF Auto Loot Airdrops Script initializing";			
};	


GF_ALA_allPlayers = allUnits select {isPlayer _x && {!(_x isKindOf "HeadlessClient_F")}};
GF_ALA_centerPosition = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");
GF_ALA_size = worldsize;




//________________	Array 	________________

/*
//________________	GF_ALA_Binocular_and_Nvg_array	Binocular and Nvg slot 	________________

It might be needed , to add also the mods , that you want to blacklist , in the GF_ALA_Assignable_Items_Mod_Blacklist
in case that the GF_ALA_Attachments_array , generates also items from the blacklisted mods.
To check this , uncomment the line that you will find below (in case : % ) , depending the selection GF_ALA_Select

copyToClipboard str GF_ALA_Binocular_and_Nvg_array; 

then run the mission and it will copy the generated array , then ctrl + v to paste the array.

The "mcc_sandbox_a3" mod will generate items that they are not Binocular or Nvg.
*/

GF_ALA_Binocular_and_Nvg_array_Mod_Blacklist = [
	"mcc_sandbox_a3",
	"CUP_Weapons"		//	Example
	];

	//________________	GF_ALA_Assignable_Items_Mod_Blacklist 	________________

GF_ALA_Vehicle_array_Mod_Blacklist = [
	"mcc_sandbox_a3",
	"@CUP_Vehicles"		//	Example
	];
	
//________________	case	________________
	
_Array_Loaded = false;
_Select_items_Loaded = false;

private ["_items_case"];

switch (GF_ALA_Select) do {
							

case 1 : {

//________________	Load every Mod + Bohemia items	________________

GF_ALA_primaryWeapon_array = ("getNumber (_x >> 'type') isEqualTo 1 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_secondaryWeapon_array = ("getNumber (_x >> 'type') isEqualTo 4 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_handgunWeapon_array = ("getNumber (_x >> 'type') isEqualTo 2 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_Magazines_array = ("getNumber (_x >> 'scope') isEqualTo 2 && getNumber (_x >> 'type') in [256,16,2*256,3*256,6*256]"configClasses (configFile >> "CfgMagazines")) apply {configName _x};

GF_ALA_Uniform_array = ("getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 801 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_Vests_array = ("getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 701 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_Headgear_array = ("getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 605 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_Backpacks_array = ("getNumber (_x >> 'isbackpack') isEqualTo 1 && getNumber (_x>> 'scope') >1 && getNumber (_x>> 'maximumLoad') != 0" configClasses (configfile >> "CfgVehicles")) apply {configName _x};
GF_ALA_Goggles_array = ("getNumber (_x >> 'scope') > 1" configClasses (configfile >> "CfgGlasses")) apply {configName _x};

GF_ALA_Items_array = ("getNumber (_x >> 'type') isEqualTo 4096 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_Attachments_array = ("getNumber (_x >> 'type') isEqualTo 131072 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};

GF_ALA_Binocular_and_Nvg_array = (
	"getNumber ( _x >> 'scope' ) isEqualTo 2	
	&& getNumber ( _x >> 'type' ) in [ 131072, 4096 ]
	&& getNumber ( _x >> 'ItemInfo' >> 'type' ) in [ 0 , 616 ] 
	"configClasses (configfile >> "CfgWeapons")
	) apply {configName _x};
	//	copyToClipboard str GF_ALA_Binocular_and_Nvg_array; 


//________________	Airdrops Vehicle	________________

GF_ALA_Vehicle = ("
	getNumber (_x >> 'scope') >= 1 
	&& ((configName _x isKindof 'Helicopter') or (configName _x isKindof 'plane'))
	&& (!(configName _x isKindof 'ParachuteBase')) 
	&& (!(configName _x isKindof 'UAV'))
	&& (!(configName _x isKindof 'B_UAV_01_F'))
	&& (!(configName _x isKindof 'O_UAV_01_F'))
	&& (!(configName _x isKindof 'I_UAV_01_F'))	
	&& (!(configName _x isKindof 'B_T_UAV_03_F'))
	&& (!(configName _x isKindof 'B_T_UAV_03_dynamicLoadout_F')) 
	&& (!(configName _x isKindof 'UAV_06_base_F'))
	&& (!(configName _x isKindof 'C_IDAP_UAV_01_F'))
	" configClasses (configFile >> "CfgVehicles")) apply {configName _x};
	//	copyToClipBoard str GF_ALA_Vehicle;	//	uncomment to copy
	
	
_items_case = "Load every Mod + Bohemia items";
_Select_items_Loaded = true;
};


case 2 : {

//________________	Load every Mod / No Bohemia items	________________

GF_ALA_primaryWeapon_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'type') isEqualTo 1 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_secondaryWeapon_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'type') isEqualTo 4 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_handgunWeapon_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'type') isEqualTo 2 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_Magazines_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'scope') isEqualTo 2 && getNumber (_x >> 'type') in [256,16,2*256,3*256,6*256]"configClasses (configFile >> "CfgMagazines")) apply {configName _x};

GF_ALA_Uniform_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 801 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_Vests_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 701 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_Headgear_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 605 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_Backpacks_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'isbackpack') isEqualTo 1 && getNumber (_x>> 'scope') >1 && getNumber (_x>> 'maximumLoad') != 0" configClasses (configfile >> "CfgVehicles")) apply {configName _x};
GF_ALA_Goggles_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'scope') > 1" configClasses (configfile >> "CfgGlasses")) apply {configName _x};

GF_ALA_Items_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'type') isEqualTo 4096 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_Attachments_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'type') isEqualTo 131072 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};

GF_ALA_Binocular_and_Nvg_array = (
	"(!(getText( _x >> 'author' ) == 'Bohemia Interactive'))
	&& getNumber ( _x >> 'scope' ) isEqualTo 2	
	&& getNumber ( _x >> 'type' ) in [ 131072, 4096 ]
	&& getNumber ( _x >> 'ItemInfo' >> 'type' ) in [ 0 , 616 ] 
	"configClasses (configfile >> "CfgWeapons")
	) apply {configName _x};
	//	copyToClipboard str GF_ALA_Binocular_and_Nvg_array; 


//________________	Airdrops Vehicle	________________

GF_ALA_Vehicle = ("
	(!(getText( _x >> 'author' ) == 'Bohemia Interactive'))
	&& getNumber (_x >> 'scope') >= 1 
	&& ((configName _x isKindof 'Helicopter') or (configName _x isKindof 'plane'))
	&& (!(configName _x isKindof 'ParachuteBase')) 
	&& (!(configName _x isKindof 'UAV'))
	&& (!(configName _x isKindof 'B_UAV_01_F'))
	&& (!(configName _x isKindof 'O_UAV_01_F'))
	&& (!(configName _x isKindof 'I_UAV_01_F'))	
	&& (!(configName _x isKindof 'B_T_UAV_03_F'))
	&& (!(configName _x isKindof 'B_T_UAV_03_dynamicLoadout_F')) 
	&& (!(configName _x isKindof 'UAV_06_base_F'))
	&& (!(configName _x isKindof 'C_IDAP_UAV_01_F'))
	" configClasses (configFile >> "CfgVehicles")) apply {configName _x};
	//	copyToClipBoard str GF_ALA_Vehicle;	//	uncomment to copy
	
	
_items_case = "Load every Mod - No Bohemia items";
_Select_items_Loaded = true;	
};


case 3 : {

//________________	Bohemia items Only	________________

GF_ALA_primaryWeapon_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'type') isEqualTo 1 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_secondaryWeapon_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'type') isEqualTo 4 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_handgunWeapon_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'type') isEqualTo 2 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_Magazines_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'scope') isEqualTo 2 && getNumber (_x >> 'type') in [256,16,2*256,3*256,6*256]"configClasses (configFile >> "CfgMagazines")) apply {configName _x};

GF_ALA_Uniform_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 801 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_Vests_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 701 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_Headgear_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 605 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_Backpacks_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'isbackpack') isEqualTo 1 && getNumber (_x>> 'scope') >1 && getNumber (_x>> 'maximumLoad') != 0" configClasses (configfile >> "CfgVehicles")) apply {configName _x};
GF_ALA_Goggles_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'scope') > 1" configClasses (configfile >> "CfgGlasses")) apply {configName _x};

GF_ALA_Items_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'type') isEqualTo 4096 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
GF_ALA_Attachments_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'type') isEqualTo 131072 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};

GF_ALA_Binocular_and_Nvg_array = (
	"getText( _x >> 'author' ) == 'Bohemia Interactive'
	&& (!(getText( _x >> 'DLC' ) in GF_ALA_Binocular_and_Nvg_array_Mod_Blacklist))
	&& getNumber ( _x >> 'scope' ) isEqualTo 2	
	&& getNumber ( _x >> 'type' ) in [ 131072, 4096 ]
	&& getNumber ( _x >> 'ItemInfo' >> 'type' ) in [ 0 , 616 ] 
	"configClasses (configfile >> "CfgWeapons")
	) apply {configName _x};
	//	copyToClipboard str GF_ALA_Binocular_and_Nvg_array; 


//________________	Airdrops Vehicle	________________

GF_ALA_Vehicle = ("
	getText( _x >> 'author' ) == 'Bohemia Interactive'
	&& (!(getText( _x >> 'DLC' ) in GF_ALA_Vehicle_array_Mod_Blacklist))
	&& getNumber (_x >> 'scope') >= 1 
	&& ((configName _x isKindof 'Helicopter') or (configName _x isKindof 'plane'))
	&& (!(configName _x isKindof 'ParachuteBase')) 
	&& (!(configName _x isKindof 'UAV'))
	&& (!(configName _x isKindof 'B_UAV_01_F'))
	&& (!(configName _x isKindof 'O_UAV_01_F'))
	&& (!(configName _x isKindof 'I_UAV_01_F'))	
	&& (!(configName _x isKindof 'B_T_UAV_03_F'))
	&& (!(configName _x isKindof 'B_T_UAV_03_dynamicLoadout_F')) 
	&& (!(configName _x isKindof 'UAV_06_base_F'))
	&& (!(configName _x isKindof 'C_IDAP_UAV_01_F'))
	" configClasses (configFile >> "CfgVehicles")) apply {configName _x};
	//	copyToClipBoard str GF_ALA_Vehicle;	//	uncomment to copy
	
	
_items_case = "Load Bohemia items Only";
_Select_items_Loaded = true;	
};


case 4 : {

/*
//________________	Custom items only	________________
It is posible to add everything to one array and the code below will manage the spawn , 
GF_ALA_cfgArray = [];
But then delete the arrays and their count below
*/

//	add the classnames	ex:
GF_ALA_primaryWeapon_array  = ["arifle_MX_SW_F"];
GF_ALA_secondaryWeapon_array = ["launch_NLAW_F"];
GF_ALA_handgunWeapon_array = ["hgun_P07_F"];
GF_ALA_Magazines_array = ["100Rnd_65x39_caseless_mag","16Rnd_9x21_Mag"];
GF_ALA_Uniform_array = ["U_B_CombatUniform_mcam_tshirt"];
GF_ALA_Vests_array = ["V_PlateCarrier2_rgr"];
GF_ALA_Headgear_array = ["H_HelmetB_grass"];
GF_ALA_Backpacks_array = ["B_AssaultPack_mcamo"];
GF_ALA_Goggles_array = ["G_Combat"];
GF_ALA_Items_array = ["FirstAidKit"];
GF_ALA_Attachments_array = ["acc_pointer_IR"];
GF_ALA_Binocular_and_Nvg_array = ["NVGoggles"];


//________________	Airdrops Vehicle Custom array	________________
//	If you want the wreck models , search for the line below , to comment the following :
//	_Vehicle setVectorUp [_banked,0,0]; //box is banked 90 degrees to the right

GF_ALA_Vehicle = [
	"Plane_Fighter_03_wreck_F",
	"Land_UWreck_Heli_Attack_02_F",
	"Land_Wreck_Heli_Attack_02_F",
	"Land_Wreck_Plane_Transport_01_F",
	"Plane_Fighter_01_wreck_F",
	"Plane_Fighter_02_wreck_F",
	"Plane_Fighter_04_wreck_F"
];


_items_case = "Custom items only";
_Select_items_Loaded = true;	
};


};


//________________	_Array_Loaded	________________

waituntil {_Select_items_Loaded};
_Array_Loaded = true;

if (GF_ALA_Hintsilent_info) then {
hintsilent format ["%1",_items_case]; 
};

if (GF_ALA_diag_log_info) then {
diag_log format ["%1",_items_case]; 
};


GF_ALA_cfgArray = 
	GF_ALA_primaryWeapon_array 
	+ GF_ALA_secondaryWeapon_array 
	+ GF_ALA_handgunWeapon_array
	+ GF_ALA_Magazines_array
	+ GF_ALA_Uniform_array
	+ GF_ALA_Vests_array
	+ GF_ALA_Headgear_array
	+ GF_ALA_Backpacks_array
	+ GF_ALA_Goggles_array
	+ GF_ALA_Items_array
	+ GF_ALA_Attachments_array
	+ GF_ALA_Binocular_and_Nvg_array;

waituntil {_Array_Loaded};


private ["_marker","_x","_a","_Pos"];

_x = 0;
_a = 0;	

//________________ Number of the Airdrops	________________

for "_x" from 0 to GF_ALA_Number + random GF_ALA_Number_random do {

_drop_in_sec = time + GF_ALA_next_drop_in_sec;
waitUntil {time > _drop_in_sec};   

_a = _a + 1;

//________________ Find Airdrops Position	________________

GF_ALA_allPlayers = [];
{if (isPlayer _x) then{GF_ALA_allPlayers pushBack _x;};}forEach playableUnits;
GF_ALA_allPlayer_Random = selectrandom GF_ALA_allPlayers;
_Pos = [[[position GF_ALA_allPlayer_Random, 50]],[]] call BIS_fnc_randomPos;
	


//________________ Sound of plane flying above ________________
//    https://community.bistudio.com/wiki/Arma_3:_SoundFiles
//    playSound3D ["A3\Sounds_F\ambient\battlefield\battlefield_jet1.wss", _Cargo];
_Plane_sound = [
"GF_ALA_Plane_1","GF_ALA_Plane_2","GF_ALA_Plane_3"
]call BIS_fnc_selectRandom;
publicVariable _Plane_sound;
_Plane_sound remoteExec ["playSound"];


//________________ Cargo ________________

_parachute = createVehicle ["B_Parachute_02_F",_Pos, [], 0, "FLY"];
waituntil{!isNull _parachute};
_parachute setPosATL [getPosATL _parachute select 0, getPosATL _parachute select 1, GF_ALA_height_of_drop];

_Cargo_array = selectRandom Type_of_Cargo_array;     
_Cargo = createVehicle [_Cargo_array, position _parachute, [], 0, 'NONE'];    
waituntil{!isNull _Cargo};
_Cargo attachTo [_parachute,[0,0,0]];
_Cargo enableSimulation false;


//________________	clear _Cargo	________________

clearItemCargoGlobal _Cargo;
clearWeaponCargoGlobal _Cargo;
clearMagazineCargoGlobal _Cargo;


//________________	Spawn Loot 	________________ 
		
for "_i" from 1 to GF_ALA_Spawned_Items_Number + random GF_ALA_Spawned_Items_Number_random do {

//________________	Position of the loot at the Airdrops	________________			

_Loot_Pos = _Pos getPos [
			4 + random 20,	//	distance
			random 360	
			];
			
private ["_Loot","_Item","_magazines","_Item_magazines","_getText","_Color","_Marker","_Text"];


//________________	_Loot	________________

private ["_Loot","_Item","_magazines","_Item_magazines","_getText","_Color","_Marker","_Text"];
	
	_Item = selectRandom GF_ALA_cfgArray;
	_getText = getText (configFile >> "cfgVehicles" >> _Item >> "vehicleClass");	
	
	
	_Loot = _Cargo;
	_Color = "Default";	//	https://community.bistudio.com/wiki/CfgMarkerColors_Arma_3
	_Text =  "Empty";
	
	
	//	https://forums.bohemia.net/forums/topic/193019-can-i-detect-all-pistols-from-cfgweapons/?tab=comments#comment-3072020
	_type = [0,1,2,4,16,256,4096,131072];	 
	
	if (
	(getNumber (configFile >> "CfgWeapons" >> _item >> "ItemInfo" >> "type") in _type)
	or (getNumber (configFile >> "CfgWeapons" >> _item >> "type") in _type)
	or (getNumber (configFile >> "CfgWeapons" >> _item >> "ItemInfo" >> "type") in [ 0 , 616 ])
	or (isClass (configFile >> "CfgGlasses" >> _Item))
	or (isClass (configFile >> "CfgMagazines" >> _Item))
	 
	) then {
	
		
switch true do {
		
//________________	Gear	________________
	
case(getNumber (configFile >> "CfgWeapons" >> _item >> "ItemInfo" >> "type") == 801) : {
	_Loot addItemCargoGlobal [ _Item, 1 ];
	_Color = "ColorGUER";_Text = "Uniforms";};
	
case(getNumber (configFile >> "CfgWeapons" >> _item >> "ItemInfo" >> "type") == 701) : {
	_Loot addItemCargoGlobal [ _Item, 1 ];
	_Color = "ColorKhaki";_Text = "Vests";};
		
case(getNumber (configFile >> "CfgWeapons" >> _item >> "ItemInfo" >> "type") == 605) : {
	_Loot addItemCargoGlobal [ _Item, 1 ];
	_Color = "ColorGreen";_Text = "Headgear";};
		
case(_getText isEqualTo "Backpacks") : {
	_Loot addBackPackCargoGlobal [ _Item, 1 ];
	_Color = "ColorBrown";_Text = "Backpacks";};
		
case(isClass (configFile >> "CfgGlasses" >> _Item)) : {
	_Loot addItemCargoGlobal [ _Item, 1 ];
	_Color = "colorCivilian";_Text = "Glasses";};
	
	
//________________	Weapons	________________
	
case(getNumber (configFile >> "CfgWeapons" >> _item >> "type") == 1) : {
	_Loot addWeaponCargoGlobal [ _Item, 1 ];
	private _magazines = getArray (configFile >> "CfgWeapons" >> _Item >> "magazines");
	private _Item_magazines = selectRandom _magazines;
	_Loot addMagazineCargoGlobal [_Item_magazines, round (1 + random 2)];
	_Color = "ColorEAST";_Text = "WeaponsPrimary";};
		
case(getNumber (configFile >> "CfgWeapons" >> _item >> "type") == 2) : {
	_Loot addWeaponCargoGlobal [ _Item, 1 ];
	private _magazines = getArray (configFile >> "CfgWeapons" >> _Item >> "magazines");
	private _Item_magazines = selectRandom _magazines;
	_Loot addMagazineCargoGlobal [_Item_magazines, round (1 + random 2)];
	_Color = "ColorPink";_Text = "HandGuns";};	
		
case(getNumber (configFile >> "CfgWeapons" >> _item >> "type") == 4) : {
	_Loot addWeaponCargoGlobal [ _Item, 1 ];
	private _magazines = getArray (configFile >> "CfgWeapons" >> _Item >> "magazines");
	private _Item_magazines = selectRandom _magazines;
	_Loot addMagazineCargoGlobal [_Item_magazines, round (1 + random 2)];
	_Color = "ColorOrange";_Text = "WeaponsSecondary";};

case(isClass (configFile >> "CfgMagazines" >> _Item)) : {
	_Loot addMagazineCargoGlobal [ _Item, round (1 + random 2)];
	_Color = "colorRed";_Text =  "Mags";};

case(getNumber (configFile >> "CfgWeapons" >> _item >> "ItemInfo" >> "type") == 616): {
	_Loot addItemCargoGlobal [ _Item, 1 ];
	_Color = "ColorBlue";_Text = "Nvg";};
	
case(getNumber (configFile >> "CfgWeapons" >> _item >> "type") == 4096) : {
	_Loot addItemCargoGlobal [ _Item, 1 ];
	_Color = "ColorWEST";_Text = "Items";};		

case(getNumber (configFile >> "CfgWeapons" >> _item >> "type") == 131072) : {
	_Loot addItemCargoGlobal [ _Item, 1 ];
	_Color = "ColorWhite";_Text = "Weapon Attachments";};	
	
case(getNumber (configFile >> "CfgWeapons" >> _item >> "type") == 0) : {
	_Loot addItemCargoGlobal [ _Item, 1 ];
	_Color = "colorBLUFOR";_Text = "Inventory Items";};
	
};

	} else {
	
	_Loot addItemCargoGlobal [ _Item, 1 ];
	_Color = "colorBLUFOR";_Text = "Inventory Items";	
	};

				
};			

			

//________________ Type of Chemlight and Smoke ________________
_Chemlight1 = "Chemlight_red" createVehicle (position _Cargo);
_Chemlight1 attachTo [_Cargo, [0,0.5,-0.4]];
_Chemlight2 = "Chemlight_red" createVehicle (position _Cargo);
_Chemlight2 attachTo [_Cargo, [0,-0.5,-0.4]];
_Smoke = "SmokeShellRed" createVehicle (position _Cargo);
_Smoke attachTo [_Cargo, [0,0,0]];


waitUntil {getPos _Cargo select 2 < 4};
_vel = velocity _Cargo;
_Cargo setVelocity _vel;

waitUntil {getPos _Cargo select 2 < 0};
playSound3D ["a3\sounds_f\weapons\Flare_Gun\flaregun_1_shoot.wss",_Cargo];
           
detach _Cargo;
_parachute disableCollisionWith _Cargo;   

_time = time + 6;
waitUntil {time > _time};       
if (!isNull _parachute) then {deleteVehicle _parachute};
_Cargo enableSimulation true;

		
//________________	Spawn a Group at the Airdrops	________________

if (GF_ALA_Spawn_Enemy) then {

//    systemchat "GF_ALA_Spawn_Enemy";

_Pos_Spawn =  [[[_Pos, 50 + random 250]],["water"]] call BIS_fnc_randomPos;
_Group = createGroup GF_ALA_Enemy_Side;

for "_x" from 0 to (GF_ALA_Squad_Members + floor random GF_ALA_Squad_Members_random) do {

_unit = _Group createunit [selectRandom GF_ALA_Pool_Infantry,_Pos_Spawn,[],0,"None"];
[_unit] JoinSilent _Group;
(leader _Group) setSkill GF_ALA_set_AiSkill + random GF_ALA_set_AiSkill_random;
};
[_Group,_Pos,GF_ALA_Patrol_distance + random GF_ALA_Patrol_distance_random] call BIS_fnc_taskPatrol;
};


//________________	GF_ALA_Debug	________________
	
if (GF_ALA_Create_Markers) then {

	_Marker_Number_Pos = format ["%1",_Pos];
	_Marker_Pos = createMarker [_Marker_Number_Pos,_Pos];		
	_Marker_Pos setMarkerShape "ICON"; 
	_Marker_Pos setMarkerType "mil_marker"; 
	_Marker_Pos setMarkerColor "ColorUNKNOWN"; 
	_Marker_Pos setMarkerText format ["Airdrop : %1",_a];	
	_Marker_Pos setMarkerSize [1,1]; 		
};	


};


if (GF_ALA_Systemchat_info) then {
systemchat "GF_Auto_Loot_Airdrops Script initialized";			
};	

diag_log "//________________ GF_Auto_Loot_Airdrop Script initialized ________________";

 

 

Share this post


Link to post
Share on other sites

It didn't work...

 

I've set this  GF_ALA_next_drop_in_sec                    = 60;    for testing.

  • Like 1

Share this post


Link to post
Share on other sites
Spoiler




//________________  Author : GEORGE FLOROS [GR] ___________ 23.12.18 _____________ 


/*
________________ GF Auto Loot Airdrops Script - Mod	________________

https://forums.bohemia.net/forums/topic/220962-gf-auto-loot-airdrops-script-mod/

Please keep the Credits or add them to your Diary

https://community.bistudio.com/wiki/SQF_syntax
Don't try to open this with the simple notepad.
For everything that is with comment  //  in front  or between /*
means that it is disabled , so there is no need to delete the extra lines.

You can open this ex:
with notepad++
https://notepad-plus-plus.org/

and also use the extra pluggins
(this way will be better , it will give also some certain colors to be able to detect ex. problems )
http://www.armaholic.com/page.php?id=8680

or use any other program for editing .

For the Compilation List of my GF Scripts , you can search in:
https://forums.bohemia.net/forums/topic/215850-compilation-list-of-my-gf-scripts/
*/


diag_log "//________________ GF_Auto_Loot_Airdrops initializing _____________";


//________________ Settings ________________
//________________ Set true or false  ________________

GF_ALA_Systemchat_info					= true;		
GF_ALA_Hintsilent_info					= true;
GF_ALA_diag_log_info					= true;
GF_ALA_Debug 							= true;


GF_ALA_next_drop_in_sec    				= 20;       
GF_ALA_height_of_drop      				= 500;    
   
GF_ALA_Number							= 5;		//	Number of the Airdrops
GF_ALA_Number_random					= 5;		//	+ random 5 Airdrops

GF_ALA_Spawned_Items_Number    			= 10;
GF_ALA_Spawned_Items_Number_random    	= 10;


//GF_ALA_Select	-->	1 = Load every Mod + Bohemia Items , 2 = Load every Mod - No Bohemia Items , 3 = Load Bohemia Items Only , 4 = Custom items only
GF_ALA_Select 							= 1;					

GF_ALA_Distanse_from_Players			= 100;		//	Add here the distance from players

GF_ALA_Create_Markers					= true;		//	Create a Marker for the Airdrops	

GF_ALA_Spawn_Enemy						= true;		//	Spawn Enemy at the site
GF_ALA_Enemy_Side						= east;		//	This is for Normal Spawn and EOS , NOT for the DAC units

GF_ALA_Squad_Members					= 5;		//	+ floor random 5 below
GF_ALA_Squad_Members_random				= 5;

GF_ALA_set_AiSkill						= 0.50;
GF_ALA_set_AiSkill_random				= 0.50;

GF_ALA_Patrol_distance 					= 100;		//	The distance for BIS_fnc_taskPatrol
GF_ALA_Patrol_distance_random 			= 250;	

//	Type_of_Cargo_array - can be any object or vehicle
Type_of_Cargo_array = [
	"B_supplyCrate_F",
	"I_CargoNet_01_ammo_F"
	];




//________________	Enemy Array 	________________

GF_ALA_Pool_Infantry = [
	"O_G_officer_F","O_G_Soldier_SL_F","O_G_Soldier_TL_F","O_G_medic_F","O_G_engineer_F","O_G_Soldier_exp_F","O_G_Soldier_GL_F",
	"O_G_Soldier_M_F","O_G_Soldier_LAT_F","O_G_Soldier_A_F","O_G_Soldier_F","O_G_Soldier_lite_F","O_G_Sharpshooter_F",
	"O_G_Soldier_universal_F"
	];
	
	
	
if (GF_ALA_Systemchat_info) then {
systemchat "GF Auto Loot Airdrops Script initializing";			
};	


GF_ALA_allPlayers = allUnits select {isPlayer _x && {!(_x isKindOf "HeadlessClient_F")}};
GF_ALA_centerPosition = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");
GF_ALA_size = worldsize;




//________________	Array 	________________

/*
//________________	GF_ALA_Binocular_and_Nvg_array	Binocular and Nvg slot 	________________

It might be needed , to add also the mods , that you want to blacklist , in the GF_ALA_Assignable_Items_Mod_Blacklist
in case that the GF_ALA_Attachments_array , generates also items from the blacklisted mods.
To check this , uncomment the line that you will find below (in case : % ) , depending the selection GF_ALA_Select

copyToClipboard str GF_ALA_Binocular_and_Nvg_array; 

then run the mission and it will copy the generated array , then ctrl + v to paste the array.

The "mcc_sandbox_a3" mod will generate items that they are not Binocular or Nvg.
*/

GF_ALA_Binocular_and_Nvg_array_Mod_Blacklist = [
	"mcc_sandbox_a3",
	"CUP_Weapons"		//	Example
	];

	//________________	GF_ALA_Assignable_Items_Mod_Blacklist 	________________

GF_ALA_Vehicle_array_Mod_Blacklist = [
	"mcc_sandbox_a3",
	"@CUP_Vehicles"		//	Example
	];
	
//________________	case	________________
	
_Array_Loaded = false;
_Select_items_Loaded = false;

private ["_items_case"];

switch (GF_ALA_Select) do {


case 1 : {

	//________________	Load every Mod + Bohemia items	________________

	GF_ALA_primaryWeapon_array = ("getNumber (_x >> 'type') isEqualTo 1 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_secondaryWeapon_array = ("getNumber (_x >> 'type') isEqualTo 4 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_handgunWeapon_array = ("getNumber (_x >> 'type') isEqualTo 2 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_Magazines_array = ("getNumber (_x >> 'scope') isEqualTo 2 && getNumber (_x >> 'type') in [256,16,2*256,3*256,6*256]"configClasses (configFile >> "CfgMagazines")) apply {configName _x};

	GF_ALA_Uniform_array = ("getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 801 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_Vests_array = ("getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 701 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_Headgear_array = ("getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 605 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_Backpacks_array = ("getNumber (_x >> 'isbackpack') isEqualTo 1 && getNumber (_x>> 'scope') >1 && getNumber (_x>> 'maximumLoad') != 0" configClasses (configfile >> "CfgVehicles")) apply {configName _x};
	GF_ALA_Goggles_array = ("getNumber (_x >> 'scope') > 1" configClasses (configfile >> "CfgGlasses")) apply {configName _x};

	GF_ALA_Items_array = ("getNumber (_x >> 'type') isEqualTo 4096 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_Attachments_array = ("getNumber (_x >> 'type') isEqualTo 131072 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};

	GF_ALA_Binocular_and_Nvg_array = (
		"getNumber ( _x >> 'scope' ) isEqualTo 2	
		&& getNumber ( _x >> 'type' ) in [ 131072, 4096 ]
		&& getNumber ( _x >> 'ItemInfo' >> 'type' ) in [ 0 , 616 ] 
		"configClasses (configfile >> "CfgWeapons")
		) apply {configName _x};
		//	copyToClipboard str GF_ALA_Binocular_and_Nvg_array; 


	//________________	Airdrops Vehicle	________________

	GF_ALA_Vehicle = ("
		getNumber (_x >> 'scope') >= 1 
		&& ((configName _x isKindof 'Helicopter') or (configName _x isKindof 'plane'))
		&& (!(configName _x isKindof 'ParachuteBase')) 
		&& (!(configName _x isKindof 'UAV'))
		&& (!(configName _x isKindof 'B_UAV_01_F'))
		&& (!(configName _x isKindof 'O_UAV_01_F'))
		&& (!(configName _x isKindof 'I_UAV_01_F'))	
		&& (!(configName _x isKindof 'B_T_UAV_03_F'))
		&& (!(configName _x isKindof 'B_T_UAV_03_dynamicLoadout_F')) 
		&& (!(configName _x isKindof 'UAV_06_base_F'))
		&& (!(configName _x isKindof 'C_IDAP_UAV_01_F'))
		" configClasses (configFile >> "CfgVehicles")) apply {configName _x};
		//	copyToClipBoard str GF_ALA_Vehicle;	//	uncomment to copy
		
		
	_items_case = "Load every Mod + Bohemia items";
	_Select_items_Loaded = true;
};


case 2 : {

	//________________	Load every Mod / No Bohemia items	________________

	GF_ALA_primaryWeapon_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'type') isEqualTo 1 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_secondaryWeapon_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'type') isEqualTo 4 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_handgunWeapon_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'type') isEqualTo 2 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_Magazines_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'scope') isEqualTo 2 && getNumber (_x >> 'type') in [256,16,2*256,3*256,6*256]"configClasses (configFile >> "CfgMagazines")) apply {configName _x};

	GF_ALA_Uniform_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 801 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_Vests_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 701 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_Headgear_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 605 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_Backpacks_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'isbackpack') isEqualTo 1 && getNumber (_x>> 'scope') >1 && getNumber (_x>> 'maximumLoad') != 0" configClasses (configfile >> "CfgVehicles")) apply {configName _x};
	GF_ALA_Goggles_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'scope') > 1" configClasses (configfile >> "CfgGlasses")) apply {configName _x};

	GF_ALA_Items_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'type') isEqualTo 4096 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_Attachments_array = ("(!(getText( _x >> 'author' ) == 'Bohemia Interactive')) && getNumber (_x >> 'type') isEqualTo 131072 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};

	GF_ALA_Binocular_and_Nvg_array = (
		"(!(getText( _x >> 'author' ) == 'Bohemia Interactive'))
		&& getNumber ( _x >> 'scope' ) isEqualTo 2	
		&& getNumber ( _x >> 'type' ) in [ 131072, 4096 ]
		&& getNumber ( _x >> 'ItemInfo' >> 'type' ) in [ 0 , 616 ] 
		"configClasses (configfile >> "CfgWeapons")
		) apply {configName _x};
		//	copyToClipboard str GF_ALA_Binocular_and_Nvg_array; 


	//________________	Airdrops Vehicle	________________

	GF_ALA_Vehicle = ("
		(!(getText( _x >> 'author' ) == 'Bohemia Interactive'))
		&& getNumber (_x >> 'scope') >= 1 
		&& ((configName _x isKindof 'Helicopter') or (configName _x isKindof 'plane'))
		&& (!(configName _x isKindof 'ParachuteBase')) 
		&& (!(configName _x isKindof 'UAV'))
		&& (!(configName _x isKindof 'B_UAV_01_F'))
		&& (!(configName _x isKindof 'O_UAV_01_F'))
		&& (!(configName _x isKindof 'I_UAV_01_F'))	
		&& (!(configName _x isKindof 'B_T_UAV_03_F'))
		&& (!(configName _x isKindof 'B_T_UAV_03_dynamicLoadout_F')) 
		&& (!(configName _x isKindof 'UAV_06_base_F'))
		&& (!(configName _x isKindof 'C_IDAP_UAV_01_F'))
		" configClasses (configFile >> "CfgVehicles")) apply {configName _x};
		//	copyToClipBoard str GF_ALA_Vehicle;	//	uncomment to copy
		
		
	_items_case = "Load every Mod - No Bohemia items";
	_Select_items_Loaded = true;	
};


case 3 : {

	//________________	Bohemia items Only	________________

	GF_ALA_primaryWeapon_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'type') isEqualTo 1 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_secondaryWeapon_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'type') isEqualTo 4 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_handgunWeapon_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'type') isEqualTo 2 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_Magazines_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'scope') isEqualTo 2 && getNumber (_x >> 'type') in [256,16,2*256,3*256,6*256]"configClasses (configFile >> "CfgMagazines")) apply {configName _x};

	GF_ALA_Uniform_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 801 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_Vests_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 701 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_Headgear_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 605 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_Backpacks_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'isbackpack') isEqualTo 1 && getNumber (_x>> 'scope') >1 && getNumber (_x>> 'maximumLoad') != 0" configClasses (configfile >> "CfgVehicles")) apply {configName _x};
	GF_ALA_Goggles_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'scope') > 1" configClasses (configfile >> "CfgGlasses")) apply {configName _x};

	GF_ALA_Items_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'type') isEqualTo 4096 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};
	GF_ALA_Attachments_array = ("getText( _x >> 'author' ) == 'Bohemia Interactive' && getNumber (_x >> 'type') isEqualTo 131072 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons")) apply {configName _x};

	GF_ALA_Binocular_and_Nvg_array = (
		"getText( _x >> 'author' ) == 'Bohemia Interactive'
		&& (!(getText( _x >> 'DLC' ) in GF_ALA_Binocular_and_Nvg_array_Mod_Blacklist))
		&& getNumber ( _x >> 'scope' ) isEqualTo 2	
		&& getNumber ( _x >> 'type' ) in [ 131072, 4096 ]
		&& getNumber ( _x >> 'ItemInfo' >> 'type' ) in [ 0 , 616 ] 
		"configClasses (configfile >> "CfgWeapons")
		) apply {configName _x};
		//	copyToClipboard str GF_ALA_Binocular_and_Nvg_array; 


	//________________	Airdrops Vehicle	________________

	GF_ALA_Vehicle = ("
		getText( _x >> 'author' ) == 'Bohemia Interactive'
		&& (!(getText( _x >> 'DLC' ) in GF_ALA_Vehicle_array_Mod_Blacklist))
		&& getNumber (_x >> 'scope') >= 1 
		&& ((configName _x isKindof 'Helicopter') or (configName _x isKindof 'plane'))
		&& (!(configName _x isKindof 'ParachuteBase')) 
		&& (!(configName _x isKindof 'UAV'))
		&& (!(configName _x isKindof 'B_UAV_01_F'))
		&& (!(configName _x isKindof 'O_UAV_01_F'))
		&& (!(configName _x isKindof 'I_UAV_01_F'))	
		&& (!(configName _x isKindof 'B_T_UAV_03_F'))
		&& (!(configName _x isKindof 'B_T_UAV_03_dynamicLoadout_F')) 
		&& (!(configName _x isKindof 'UAV_06_base_F'))
		&& (!(configName _x isKindof 'C_IDAP_UAV_01_F'))
		" configClasses (configFile >> "CfgVehicles")) apply {configName _x};
		//	copyToClipBoard str GF_ALA_Vehicle;	//	uncomment to copy
		
		
	_items_case = "Load Bohemia items Only";
	_Select_items_Loaded = true;	
};


case 4 : {

	/*
	//________________	Custom items only	________________
	It is posible to add everything to one array and the code below will manage the spawn , 
	GF_ALA_cfgArray = [];
	But then delete the arrays and their count below
	*/

	//	add the classnames	ex:
	GF_ALA_primaryWeapon_array  = ["arifle_MX_SW_F"];
	GF_ALA_secondaryWeapon_array = ["launch_NLAW_F"];
	GF_ALA_handgunWeapon_array = ["hgun_P07_F"];
	GF_ALA_Magazines_array = ["100Rnd_65x39_caseless_mag","16Rnd_9x21_Mag"];
	GF_ALA_Uniform_array = ["U_B_CombatUniform_mcam_tshirt"];
	GF_ALA_Vests_array = ["V_PlateCarrier2_rgr"];
	GF_ALA_Headgear_array = ["H_HelmetB_grass"];
	GF_ALA_Backpacks_array = ["B_AssaultPack_mcamo"];
	GF_ALA_Goggles_array = ["G_Combat"];
	GF_ALA_Items_array = ["FirstAidKit"];
	GF_ALA_Attachments_array = ["acc_pointer_IR"];
	GF_ALA_Binocular_and_Nvg_array = ["NVGoggles"];


	//________________	Airdrops Vehicle Custom array	________________
	//	If you want the wreck models , search for the line below , to comment the following :
	//	_Vehicle setVectorUp [_banked,0,0]; //box is banked 90 degrees to the right

	GF_ALA_Vehicle = [
		"Plane_Fighter_03_wreck_F",
		"Land_UWreck_Heli_Attack_02_F",
		"Land_Wreck_Heli_Attack_02_F",
		"Land_Wreck_Plane_Transport_01_F",
		"Plane_Fighter_01_wreck_F",
		"Plane_Fighter_02_wreck_F",
		"Plane_Fighter_04_wreck_F"
	];


	_items_case = "Custom items only";
	_Select_items_Loaded = true;
};


};


//________________	_Array_Loaded	________________

waituntil {_Select_items_Loaded};
_Array_Loaded = true;

if (GF_ALA_Hintsilent_info) then {
hintsilent format ["%1",_items_case]; 
};

if (GF_ALA_diag_log_info) then {
diag_log format ["%1",_items_case]; 
};


GF_ALA_cfgArray = 
	GF_ALA_primaryWeapon_array 
	+ GF_ALA_secondaryWeapon_array 
	+ GF_ALA_handgunWeapon_array
	+ GF_ALA_Magazines_array
	+ GF_ALA_Uniform_array
	+ GF_ALA_Vests_array
	+ GF_ALA_Headgear_array
	+ GF_ALA_Backpacks_array
	+ GF_ALA_Goggles_array
	+ GF_ALA_Items_array
	+ GF_ALA_Attachments_array
	+ GF_ALA_Binocular_and_Nvg_array;

waituntil {_Array_Loaded};


private ["_marker","_x","_a","_Pos"];

_x = 0;
_a = 0;	

//________________ Number of the Airdrops	________________

for "_x" from 0 to GF_ALA_Number + random GF_ALA_Number_random do {

_drop_in_sec = time + GF_ALA_next_drop_in_sec;
waitUntil {time > _drop_in_sec};   

_a = _a + 1;

//________________ Find Airdrops Position	________________

GF_ALA_allPlayers = allUnits select {isPlayer _x && {!(_x isKindOf "HeadlessClient_F")}};
GF_ALA_allPlayer_Random = selectrandom GF_ALA_allPlayers;
_Pos = [[[position GF_ALA_allPlayer_Random, GF_ALA_Distanse_from_Players]],[]] call BIS_fnc_randomPos;
	


//________________ Sound of plane flying above ________________
//    https://community.bistudio.com/wiki/Arma_3:_SoundFiles
//    playSound3D ["A3\Sounds_F\ambient\battlefield\battlefield_jet1.wss", _Cargo];
_Plane_sound = [
"GF_ALA_Plane_1","GF_ALA_Plane_2","GF_ALA_Plane_3"
]call BIS_fnc_selectRandom;
publicVariable _Plane_sound;
_Plane_sound remoteExec ["playSound"];


//________________ Cargo ________________

_parachute = createVehicle ["B_Parachute_02_F",_Pos, [], 0, "FLY"];
waituntil{!isNull _parachute};
_parachute setPosATL [getPosATL _parachute select 0, getPosATL _parachute select 1, GF_ALA_height_of_drop];

_Cargo_array = selectRandom Type_of_Cargo_array;     
_Cargo = createVehicle [_Cargo_array, position _parachute, [], 0, 'NONE'];    
waituntil{!isNull _Cargo};
_Cargo attachTo [_parachute,[0,0,0]];
_Cargo enableSimulation false;


//________________	clear _Cargo	________________

clearItemCargoGlobal _Cargo;
clearWeaponCargoGlobal _Cargo;
clearMagazineCargoGlobal _Cargo;


//________________	Spawn Loot 	________________ 

for "_i" from 1 to GF_ALA_Spawned_Items_Number + random GF_ALA_Spawned_Items_Number_random do {


private ["_Loot","_Item","_magazines","_Item_magazines","_getText","_Color","_Marker","_Text"];


//________________	_Loot	________________

private ["_Loot","_Item","_magazines","_Item_magazines","_getText","_Color","_Marker","_Text"];
	
	_Item = selectRandom GF_ALA_cfgArray;
	_getText = getText (configFile >> "cfgVehicles" >> _Item >> "vehicleClass");	
	
	
	_Loot = _Cargo;
	_Color = "Default";	//	https://community.bistudio.com/wiki/CfgMarkerColors_Arma_3
	_Text =  "Empty";
	
	
	//	https://forums.bohemia.net/forums/topic/193019-can-i-detect-all-pistols-from-cfgweapons/?tab=comments#comment-3072020
	_type = [0,1,2,4,16,256,4096,131072];	 
	
	if (
	(getNumber (configFile >> "CfgWeapons" >> _item >> "ItemInfo" >> "type") in _type)
	or (getNumber (configFile >> "CfgWeapons" >> _item >> "type") in _type)
	or (getNumber (configFile >> "CfgWeapons" >> _item >> "ItemInfo" >> "type") in [ 0 , 616 ])
	or (isClass (configFile >> "CfgGlasses" >> _Item))
	or (isClass (configFile >> "CfgMagazines" >> _Item))
	 
	) then {
	
		
switch true do {
		
//________________	Gear	________________
	
case(getNumber (configFile >> "CfgWeapons" >> _item >> "ItemInfo" >> "type") == 801) : {
	_Loot addItemCargoGlobal [ _Item, 1 ];
	_Color = "ColorGUER";_Text = "Uniforms";};
	
case(getNumber (configFile >> "CfgWeapons" >> _item >> "ItemInfo" >> "type") == 701) : {
	_Loot addItemCargoGlobal [ _Item, 1 ];
	_Color = "ColorKhaki";_Text = "Vests";};
		
case(getNumber (configFile >> "CfgWeapons" >> _item >> "ItemInfo" >> "type") == 605) : {
	_Loot addItemCargoGlobal [ _Item, 1 ];
	_Color = "ColorGreen";_Text = "Headgear";};
		
case(_getText isEqualTo "Backpacks") : {
	_Loot addBackPackCargoGlobal [ _Item, 1 ];
	_Color = "ColorBrown";_Text = "Backpacks";};
		
case(isClass (configFile >> "CfgGlasses" >> _Item)) : {
	_Loot addItemCargoGlobal [ _Item, 1 ];
	_Color = "colorCivilian";_Text = "Glasses";};
	
	
//________________	Weapons	________________
	
case(getNumber (configFile >> "CfgWeapons" >> _item >> "type") == 1) : {
	_Loot addWeaponCargoGlobal [ _Item, 1 ];
	private _magazines = getArray (configFile >> "CfgWeapons" >> _Item >> "magazines");
	private _Item_magazines = selectRandom _magazines;
	_Loot addMagazineCargoGlobal [_Item_magazines, round (1 + random 2)];
	_Color = "ColorEAST";_Text = "WeaponsPrimary";};
		
case(getNumber (configFile >> "CfgWeapons" >> _item >> "type") == 2) : {
	_Loot addWeaponCargoGlobal [ _Item, 1 ];
	private _magazines = getArray (configFile >> "CfgWeapons" >> _Item >> "magazines");
	private _Item_magazines = selectRandom _magazines;
	_Loot addMagazineCargoGlobal [_Item_magazines, round (1 + random 2)];
	_Color = "ColorPink";_Text = "HandGuns";};	
		
case(getNumber (configFile >> "CfgWeapons" >> _item >> "type") == 4) : {
	_Loot addWeaponCargoGlobal [ _Item, 1 ];
	private _magazines = getArray (configFile >> "CfgWeapons" >> _Item >> "magazines");
	private _Item_magazines = selectRandom _magazines;
	_Loot addMagazineCargoGlobal [_Item_magazines, round (1 + random 2)];
	_Color = "ColorOrange";_Text = "WeaponsSecondary";};

case(isClass (configFile >> "CfgMagazines" >> _Item)) : {
	_Loot addMagazineCargoGlobal [ _Item, round (1 + random 2)];
	_Color = "colorRed";_Text =  "Mags";};

case(getNumber (configFile >> "CfgWeapons" >> _item >> "ItemInfo" >> "type") == 616): {
	_Loot addItemCargoGlobal [ _Item, 1 ];
	_Color = "ColorBlue";_Text = "Nvg";};
	
case(getNumber (configFile >> "CfgWeapons" >> _item >> "type") == 4096) : {
	_Loot addItemCargoGlobal [ _Item, 1 ];
	_Color = "ColorWEST";_Text = "Items";};		

case(getNumber (configFile >> "CfgWeapons" >> _item >> "type") == 131072) : {
	_Loot addItemCargoGlobal [ _Item, 1 ];
	_Color = "ColorWhite";_Text = "Weapon Attachments";};	
	
case(getNumber (configFile >> "CfgWeapons" >> _item >> "type") == 0) : {
	_Loot addItemCargoGlobal [ _Item, 1 ];
	_Color = "colorBLUFOR";_Text = "Inventory Items";};
	
};

	} else {
	
	_Loot addItemCargoGlobal [ _Item, 1 ];
	_Color = "colorBLUFOR";_Text = "Inventory Items";	
	};


};			



//________________ Type of Chemlight and Smoke ________________
_Chemlight1 = "Chemlight_red" createVehicle (position _Cargo);
_Chemlight1 attachTo [_Cargo, [0,0.5,-0.4]];
_Chemlight2 = "Chemlight_red" createVehicle (position _Cargo);
_Chemlight2 attachTo [_Cargo, [0,-0.5,-0.4]];
_Smoke = "SmokeShellRed" createVehicle (position _Cargo);
_Smoke attachTo [_Cargo, [0,0,0]];


waitUntil {getPos _Cargo select 2 < 4};
_vel = velocity _Cargo;
_Cargo setVelocity _vel;

waitUntil {getPos _Cargo select 2 < 0};
playSound3D ["a3\sounds_f\weapons\Flare_Gun\flaregun_1_shoot.wss",_Cargo];
           
detach _Cargo;
_parachute disableCollisionWith _Cargo;   

_time = time + 6;
waitUntil {time > _time};       
if (!isNull _parachute) then {deleteVehicle _parachute};
_Cargo enableSimulation true;

		
//________________	Spawn a Group at the Airdrops	________________

if (GF_ALA_Spawn_Enemy) then {

	//    systemchat "GF_ALA_Spawn_Enemy";

	_Pos_Spawn =  [[[_Pos, 50 + random 250]],["water"]] call BIS_fnc_randomPos;
	_Group = createGroup GF_ALA_Enemy_Side;

	for "_x" from 0 to (GF_ALA_Squad_Members + floor random GF_ALA_Squad_Members_random) do {

		_unit = _Group createunit [selectRandom GF_ALA_Pool_Infantry,_Pos_Spawn,[],0,"None"];
		[_unit] JoinSilent _Group;
		(leader _Group) setSkill GF_ALA_set_AiSkill + random GF_ALA_set_AiSkill_random;
	};
	[_Group,_Pos,GF_ALA_Patrol_distance + random GF_ALA_Patrol_distance_random] call BIS_fnc_taskPatrol;
};


//________________	GF_ALA_Debug	________________
	
if (GF_ALA_Create_Markers) then {

	_Marker_Number_Pos = format ["%1",_Pos];
	_Marker_Pos = createMarker [_Marker_Number_Pos,_Pos];		
	_Marker_Pos setMarkerShape "ICON"; 
	_Marker_Pos setMarkerType "mil_marker"; 
	_Marker_Pos setMarkerColor "ColorUNKNOWN"; 
	_Marker_Pos setMarkerText format ["Airdrop : %1",_a];	
	_Marker_Pos setMarkerSize [1,1]; 		
};	


};


if (GF_ALA_Systemchat_info) then {
systemchat "GF_Auto_Loot_Airdrops Script initialized";			
};	

diag_log "//________________ GF_Auto_Loot_Airdrop Script initialized ________________";

 

Share this post


Link to post
Share on other sites
1 hour ago, Desperta Ferro said:

It works!! Thank you, you are the best 😁

 

Thank you very much @Desperta Ferro and since you like it you can click a like there up ! :wave:

  • Like 1

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

×