Jump to content
Sign in to follow this  
Blueblood

Checking for an ACE backpack

Recommended Posts

I've had a look around for this but I can't seem to find anything about this, I need a way to check if a player has an ACE backpack. I've used the "unitBackpack" command but it will always return a Null Object for ACE backpacks.

The reason I need this is for a Fallujah FOB, I'm adding the action to load-up the players backpack with either Light Medical Gear (For non medics) or Full Medical Gear (For medics)

I know how to actually add the items but I don't want any script errors whenever someone tries to use it without a backpack. Here is the script:

private ["_player","_loadouttype","_player"];

_player = _this select 0;

if (HERE IS WHERE I NEED TO CHECK IF THE PLAYER HAS A BACKPACK, EITHER WITH CODE IN HERE OR WITH A VARIABLE) exitWith{hint "You have no backpack!";};

_loadouttype = _this select 3;

If (_loadouttype == 1) then
{
   sleep 3;
[_player, "ACE_epinephrine", 2] call ACE_fnc_PackMagazine;
[_player, "ACE_Morphine", 2] call ACE_fnc_PackMagazine;
[_player, "ACE_LargeBandage", 3] call ACE_fnc_PackMagazine;	
[_player, "ACE_Bandage", 5] call ACE_fnc_PackMagazine;
[_player, "ACE_Medkit", 1] call ACE_fnc_PackMagazine;
[_player, "ACE_Tourniquet", 1] call ACE_fnc_PackMagazine; 

   hint "Light Medical Gear Loaded!";
};

If (_loadouttype == 2) then
{
   sleep 3;
[_player, "ACE_epinephrine", 10] call ACE_fnc_PackMagazine;
[_player, "ACE_Morphine", 10] call ACE_fnc_PackMagazine;
[_player, "ACE_LargeBandage", 10] call ACE_fnc_PackMagazine;	
[_player, "ACE_Bandage", 15] call ACE_fnc_PackMagazine;
[_player, "ACE_Medkit", 5] call ACE_fnc_PackMagazine;
[_player, "ACE_Tourniquet", 2] call ACE_fnc_PackMagazine; 

   hint "Full Medical Gear Loaded!";
};

Any help would be greatly appreciated, Thanks in advance!

Share this post


Link to post
Share on other sites

Thanks man! The Function Index will be very useful!

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  

×