Jump to content
Sign in to follow this  
Graz

Counting number of items/magazines in an objects inventory

Recommended Posts

I'm trying to add a vehicle spawning function into an RPG server.

I've got 2 items and a script

Laptop, with an addaction to run "spawnlada.sqf"

A create called BYbox

I was hoping to begin with a condition for the box that checks that the required items are put into. Is there any way to count items as a condition?

Something like:

//Spawnlada.sqf

//prevent tampering

BYbox setVehicleLock "LOCKED";

//This is where I get stuck

//Define arrays

_wheels =
//command to count inventory?//
"itemWheel"

//create BYbox _haveitems?

//Does BYbox have "itemEngine" && ( _wheel > 4)

//This is where I get stuck

if _haveitems = 1 then

{

BYbox Removemagazine "itemEngine";

BYbox Removemagazine "itemWheel";

BYbox Removemagazine "itemWheel";

BYbox Removemagazine "itemWheel";

BYbox Removemagazine "itemWheel";

[ ] exec "makelada.sqs";

}

//open for business!

BYbox setVehicleLock "UNLOCKED";

I've been on this for a few hours, does anyone know of any solutions?

Share this post


Link to post
Share on other sites

Wow thanks,

so I can use _Boneyardinventory = [bYbox] call BIS_fnc_invString;

What's the best way to check the array for the item? There's no query commands coming to mind!

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  

×