Jump to content
th3gingergamer

Removing group information from _this

Recommended Posts

I have been trying to remove the group information from the caller part of '_this ' e.g. "B Alpha 1-1:1".

I am trying to use splitString to split the string when it gets to a bracket as the whole string returned is "B Alpha 1-1:1 (Username)"

The code I have so far is

_caller = (_this select 1);
_caller splitString "(";
Hint format["%1  is an absolute idiot!",_caller select 1]; 

The error I get is about splitString expecting a string but receiving an object.

I tried looking up a way to change an object to a string but had no luck.

I'm extremely new to SQF (I started learning today) and any help with this would be appreciated.

 

Share this post


Link to post
Share on other sites
1 minute ago, pierremgi said:

_caller = str (_this select 1);  I guess.

I now get "Error Generic error in expression" with no useful information

Share this post


Link to post
Share on other sites

could you send the result of _caller? Perhaps , there is no "(", so not sure _caller can be split.

Share this post


Link to post
Share on other sites

The error I'm getting is that _caller is an object and not a string and splitString can only split a string.

The result of _caller though is "B Alpha 1-1:1 (My Name)".

Share this post


Link to post
Share on other sites

And you just want the name in the brackets?

_caller = name (_this select 0);

  • Thanks 1

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

×