Jump to content
Sign in to follow this  
delta3d

RemoteExec Looking For String

Recommended Posts

Hi,

I'm using 

remoteExec [cutText[_msg,'BLACK FADED'],_clientID];

but when I try to run it, it says

|#|remoteExec [cutText[_msg,'BLACK FADED'],_clientID];
Error Type Any, expected String

any ideas?

 
It still runs fine, just I still get the error because cutText[_msg,'BLACK FADED'] is classed as Any instead of a String.

Share this post


Link to post
Share on other sites

 

Hi,

I'm using 

remoteExec [cutText[_msg,'BLACK FADED'],_clientID];

but when I try to run it, it says

|#|remoteExec [cutText[_msg,'BLACK FADED'],_clientID];
Error Type Any, expected String

any ideas?

 
It still runs fine, just I still get the error because cutText[_msg,'BLACK FADED'] is classed as Any instead of a String.

 

Your syntax is way off: https://community.bistudio.com/wiki/remoteExec

Maybe try something like:

 

[0, [_msg,'BLACK FADED']] remoteExec ["cutText", _clientID];
  • Like 1

Share this post


Link to post
Share on other sites

try to do this:

{cutText[_msg,'BLACK FADED'];} remoteExec ["bis_fnc_call", _clientID]; 

UPD: or sample from KK :)

  • Like 1

Share this post


Link to post
Share on other sites

Hi guys, thanks for the replies.

Tried both of those, there are no error messages but there is no message displayed

 

Edit: I should probably add I am doing this for a custom command in infiSTAR so formatting is a bit weird, I need to use ' instead of " because the code is contained already in 

code = "
code;
goes;
here;
";

Share this post


Link to post
Share on other sites
[0, ["lalalalala",'BLACK FADED']] remoteExec ["cutText", 0];

This works for me just fine

  • Like 1

Share this post


Link to post
Share on other sites

Not sure why it isn't working.

 

There are no errors, I'm just assuming it is failing to send it to anyone? I've tried using 0 at the end for targeting everyone but nothing happens.

Share this post


Link to post
Share on other sites

Not sure why it isn't working.

 

There are no errors, I'm just assuming it is failing to send it to anyone? I've tried using 0 at the end for targeting everyone but nothing happens.

Have you tried to do it in another mission? Maybe, trouble in your code in mission.

Share this post


Link to post
Share on other sites
if you want to do it with your custom function and not a "command" you need to have the function defined on the target client

 

e.g. in your mission init.sqf do

 



fnc_cutTexT = compileFinal "cutText[_this,'BLACK FADED'];";


 

then you don't need to remoteExec as it doesn't need to be scheduled, you can remoteExecCall the function

 



INPUT remoteExecCall ['function',target];


 

->



'this is my text' remoteExecCall ['fnc_cutTexT',_clientID];


 

 

now if your cfg RemoteExec looks like this:



class CfgRemoteExec
{
class Functions
{
mode = 1;
jip = 0;
class fnc_AdminReq { allowedTargets=2; };
class ExileServer_system_network_dispatchIncomingMessage { allowedTargets=2; };
};
class Commands
{
mode=0;
jip=0;
};
};


 

you need to change it to something like this:



class CfgRemoteExec
{
class Functions
{
mode = 1;
jip = 0;
class fnc_cutTexT { allowedTargets=1; }; // 1 means: can target clients only
class fnc_AdminReq { allowedTargets=2; };
class ExileServer_system_network_dispatchIncomingMessage { allowedTargets=2; };
};
class Commands
{
mode=0;
jip=0;
};
};


 

then you will have it working :)

  • Like 1

Share this post


Link to post
Share on other sites

Thanks infiSTAR, didn't think you'd end up responding hehe!

I'll try it later today :)

  • Like 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
Sign in to follow this  

×