ViktorReznov Posted July 2, 2017 Report Share Posted July 2, 2017 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 Link to comment Share on other sites More sharing options...
0 salival Posted July 2, 2017 Report Share Posted July 2, 2017 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 Link to comment Share on other sites More sharing options...
0 juandayz Posted July 2, 2017 Report Share Posted July 2, 2017 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 More sharing options...
0 ViktorReznov Posted July 3, 2017 Author Report Share Posted July 3, 2017 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 More sharing options...
0 salival Posted July 3, 2017 Report Share Posted July 3, 2017 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 More sharing options...
0 ViktorReznov Posted July 3, 2017 Author Report Share Posted July 3, 2017 9 hours ago, salival said: Well that makes more sense. if (typeOf (cursorTarget) in _myArray) then {systemChat "it's in the array!"}; Thank you! That solved my problem! see my next thread for a new one! *facepalm* Link to comment Share on other sites More sharing options...
Question
ViktorReznov
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
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now