Sign in to follow this  
Followers 0
[AI] Stalker

remove please.

2 posts in this topic

Posted (edited)

Edited - ran into issues - ignore.

Edited by [AI] Stalker
1 person likes this

Share this post


Link to post
Share on other sites

you can use this method as it allows to add things into vehicles as well as crates:

define item list with item,min,max

Quote

_ned_VehicleItems = [["U_NikosAgedBody",1,1], ["U_NikosBody",1,2], ["H_Cap_press",1,1],["H_StrawHat_dark",1,1], ["Exile_Item_EMRE",1,2], ["Exile_Item_PlasticBottleCoffee",1,2], ["ItemGPS",1,1], ["hgun_Rook40_F",1,2], ["hgun_ACPC2_F",1,1], ["9Rnd_45ACP_Mag",2,2], ["16Rnd_9x21_Mag",2,2]];

then load into whatever:

Quote

 clearMagazineCargoGlobal _vehicle;
clearWeaponCargoGlobal _vehicle;
clearItemCargoGlobal _vehicle;
{
_item = _x select 0;
_amount = _x select 1;
_randomAmount = _x select 2;
_amount = _amount + (random _randomAmount);
_itemType = _x call BIS_fnc_itemType;

if((_itemType select 0) == "Weapon") then {_vehicle addWeaponCargoGlobal [_item, _amount];};
if((_itemType select 0) == "Magazine") then {_vehicle addMagazineCargoGlobal [_item, _amount];};
if((_itemType select 0) == "Item") then {_vehicle addItemCargoGlobal [_item, _amount];};
if((_itemType select 0) == "Equipment") then {_vehicle addItemCargoGlobal [_item, _amount];};
if((_itemType select 0) == "Backpack") then {_vehicle addBackpackCargoGlobal [_item, _amount];};
}forEach _ned_VehicleItems;

in this case it was loaded into _vehicle but you could also do the normal _crate

it looks through the defined list then loads each object type in one after another and isn't slow so no issues waiting for loot to spawn etc, seems to work as well as normal item loading.

It should do basically the same thing as you are doing but may be a little smaller

1 person likes this

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.