Jump to content
Sign in to follow this  
dimdic

How to check if an array is empty ??

Recommended Posts

Hi there !! The command assignedVehicleRole may return:

[] - Not assigned to any vehicle

["Driver"] - Assigned as driver

["Cargo"] - Assigned as cargo

["Turret", [turret path]] - Assigned to a turret

(http://community.bistudio.com/wiki/assignedVehicleRole)

E.g. _RoleArray=assignedVehicleRole player

With which code can i check if the returned array is empty??? Is there any way to check this, except from using the command count ? E.g.

_RoleArray=assignedVehicleRole player;

if (isNull _RoleArray) then { hint 'empty'}; //isNull _RoleArray doesn't work !!

Share this post


Link to post
Share on other sites

Perhaps:

_test = _RoleArray select 0;
if (isNil "_test") then {hint "empty"};

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  

×