Jump to content
Sign in to follow this  
santafee

Check if AV8 has specific type of ammo

Recommended Posts

AMMO of a specific TYPE*! (sry i forgot in the title)

Should be simple, whats the syntax.....

Trigger goes of if AV8 has <=0 Ammo of 6Rnd_Mk82.

Other Ammo of the Plane doesnt matter. thanks..!

Share this post


Link to post
Share on other sites

You're looking for "6Rnd_GBU12_AV8B".

Trigger condition:

((magazines name_of_your_plane) find "6Rnd_GBU12_AV8B") > -1

As long as the result is bigger than "-1" there are still bombs available. If "-1" all bombs are gone.

Regards,

VictorFarbau

Share this post


Link to post
Share on other sites

Thanks i tried that, but i need to check a empty plane from beginning, cause i get in later. Also i really need this ammo "6Rnd_Mk82"; cause its the laserguided bombs. However, if i use the condition in the trigger and im not in the plane at the start, the trigger allready goes off...?

Its working now, i did something wrong, thanks!

Edited by Himmelsfeuer

Share this post


Link to post
Share on other sites

just in case it helps here is a repair/ refuel and rearm script from evolution that I modded to include changingthe bombs on the two types of harrier - might be some useful syntax for you

in mission - a trigger

		class Item2
	{
		position[]={9819.918945,139.994995,9996.560547};
		a=620.000000;
		b=250.000000;
		rectangular=1;
		activationBy="ANY";
		age="UNKNOWN";
		text="airport";
		name="AirportIn";
		class Effects
		{
		};
	};

in mainthreadc, which is called from sinit which is a trigger that checks simply "is server"

for [{_loop=0}, {_loop<1}, {_loop=_loop}] do
{
[] call BIS_EVO_Repair;
sleep 1.011;
//etc
};

BIS_EVO_Repair = 
{
_vec = (vehicle player);
_type = typeOf vehicle player;
//	hintsilent format["Type: %1",(_type)];

if(getDammage _vec > 0 or fuel _vec < 0.98 and not (_vec isKindOf "Man")) then
{
	_inrepairzone = (_vec in list AirportIn);
	if((_vec in list AirportIn) and _vec != player and speed _vec > -2 and speed _vec < 2 and position _vec select 2 < 2.0 and (local _vec)) then
	{
		 titleText [localize "STR_M04t83", "PLAIN DOWN",0.3];//Servicing
		 for [{_loop2=0}, {_loop2<1}, {_loop2=_loop2}] do
		 {
		    sleep 0.200;	    		    
		    if (getDammage _vec > 0) then {_vec setDammage ((getDammage _vec)-0.0125);};
		    if (Fuel _vec < 1) then {_vec setFuel ((Fuel _vec)+0.0125);};
		    if (getDammage _vec == 0 and Fuel _vec == 1) then {_loop2=1;};
		    if(_vec != vehicle player or speed _vec < -2 or speed _vec > 2 or position _vec select 2 > 2.0) then {_loop2=1;titleText [localize "STR_M04t84", "PLAIN DOWN",0.3];};
		    _dam = (getDammage _vec)*100;
		    _ful = (Fuel _vec)*100;
		    hint format["Damage: %1\nFuel: %2",Round _dam,Round _ful];
		};
		_vec setVehicleAmmo 1;	
			if(_type == "AV8B") then 
			{
			_weapons = weapons _vec;
			_vec removeMagazine "2Rnd_Maverick_A10";
			_vec removeMagazine "2Rnd_Maverick_A10";
			_vec removeMagazine "2Rnd_Maverick_A10";
			_vec addMagazine "2Rnd_Maverick_A10";
			_vec addMagazine "2Rnd_Maverick_A10";
			_vec addMagazine "2Rnd_Maverick_A10";
			if(not ("MaverickLauncher" in _weapons)) then {_vec addweapon "MaverickLauncher"};
			_vec removeMagazine "4Rnd_Sidewinder_AV8B";
			_vec addMagazine "4Rnd_Sidewinder_AV8B";
			if(not ("SidewinderLaucher" in _weapons)) then {_vec addweapon "SidewinderLaucher"};
			_vec removeMagazine "192Rnd_57mm";
			_vec addMagazine "192Rnd_57mm";
			if(not ("57mmLauncher" in _weapons)) then {_vec addweapon "57mmLauncher"};
			};			
			if(_type == "AV8B2") then 
			{
			_weapons = weapons _vec;
			_vec removeMagazine "8Rnd_Hellfire";
			_vec addMagazine "8Rnd_Hellfire";
			if(not ("HellfireLauncher" in _weapons)) then {_vec addweapon "HellfireLauncher"};
			_vec removeMagazine "14Rnd_FFAR";
			_vec removeMagazine "14Rnd_FFAR";
			_vec addMagazine "14Rnd_FFAR";
			_vec addMagazine "14Rnd_FFAR";
			};
			if(_type == "A10") then 
			{
			_weapons = weapons _vec;
			_vec removeMagazine "6Rnd_Mk82";
			_vec addMagazine "6Rnd_Mk82";
			if(not ("Mk82BombLauncher_6" in _weapons)) then {_vec addweapon "Mk82BombLauncher_6"};
			_vec removeMagazine "1350Rnd_30mmAP_A10";
			_vec removeMagazine "1350Rnd_30mmAP_A10";
			_vec addMagazine "1350Rnd_30mmAP_A10";
			_vec addMagazine "1350Rnd_30mmAP_A10";
			_vec removeMagazine "2Rnd_Maverick_A10";
			_vec removeMagazine "2Rnd_Maverick_A10";
			_vec addMagazine "2Rnd_Maverick_A10";
			_vec addMagazine "2Rnd_Maverick_A10";
			if(("FFARLauncher_14" in _weapons)) then {_vec removeweapon "FFARLauncher_14"};
			_vec removeMagazine "14Rnd_FFAR";
			_vec removeMagazine "38Rnd_FFAR";
			_vec removeMagazine "38Rnd_FFAR";
			_vec addMagazine "38Rnd_FFAR";
			_vec addMagazine "38Rnd_FFAR";
			if(not ("FFARLauncher" in _weapons)) then {_vec addweapon "FFARLauncher"};
			};

	};
};
};

for GBU's you can add them like this

				_vec removeMagazine "6Rnd_GBU12_AV8B";
			_vec removeMagazine "6Rnd_GBU12_AV8B";
			_vec removeMagazine "6Rnd_GBU12_AV8B";
			_vec addMagazine "6Rnd_GBU12_AV8B";
			_vec addMagazine "6Rnd_GBU12_AV8B";
			_vec addMagazine "6Rnd_GBU12_AV8B";
			if(not ("BombLauncher" in _weapons)) then {_vec addweapon "BombLauncher"};

now wehenevryou get into a harrier or A10 at theairbase, you get repaired, refueled and re-armed, only each aircraft gets a custom loadout

Edited by eggbeast

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
Sign in to follow this  

×