Jump to content
  • 0

arrays and cursortarget


ViktorReznov

Question

5 answers to this question

Recommended Posts

  • 0
Just now, ViktorReznov said:

Trying to figure out how to return a classname from an array with cursortarget. blowing my mind, losing my hair. any help much appreciated tyvm

_obj = cursorTarget;
_txt = format["%1", _obj];
titleText [_txt,"PLAIN DOWN"]; titleFadeOut 4;

 

Link to comment
Share on other sites

  • 0
6 hours ago, salival said:

I don't quite understand what you mean, but here's what I translated:

To get a classnames (typeOf) from cursorTarget I use this:

_className = typeOf (cursorTarget);

I don't know what you mean by an array though

I have a predefined array ie myArray = ["classname1","classname2"];

how to detect when my cursortarget is one of those classnames in myArray?

Link to comment
Share on other sites

  • 0
47 minutes ago, ViktorReznov said:

I have a predefined array ie myArray = ["classname1","classname2"];

how to detect when my cursortarget is one of those classnames in myArray?

Well that makes more sense.

if (typeOf (cursorTarget) in _myArray) then {systemChat "it's in the array!"};

 

Link to comment
Share on other sites

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
  • Advertisement
  • Discord

×
×
  • Create New...