Jump to content
jajavst

need help with: remoteExec doMove

Recommended Posts

Hi everyone,

 

I am making a MP police mission to play on a server and I want to be able to call a tow truck.

I have this code to call the tow truck with a doMove order and it works in SP but not in MP.

 

this addaction ["<t color='#ff0000'>call towtruck</t>", { towtruck doMove getPosATL MGI157; }, [],1,false,true,"","_this distance _target < 2"];   
  
  // MGI157 is the name of the car I called the tow truck from

I have this code to return the tow truck to the starting location and it also doesn't work in MP but it does work in SP.

this addaction ["<t color='#ff0000'>dismiss towtruck</t>", { towtruck doMove (getMarkerPos "towtruck west"); }, [],1,false,true,"","_this distance _target < 2"];              

 

I tried to make code with remoteExec but it didn't work.

 

To call the truck:

this addaction ["<t color='#ff0000'>call towtruck</t>", { [towtruck, [getPosATL MGI157]] remoteExec ["doMove"]; }, [],1,false,true,"","_this distance _target < 2"];   //does not work

To return the truck:

this addaction ["<t color='#ff0000'>dismiss towtruck</t>", { [towtruck, [getMarkerPos "towtruck west"]] remoteExec ["doMove"]; }, [],1,false,true,"","_this distance _target < 2"];     //does not work
  

 

 

Does someone know a way to make it work with remoteExec?

 

 

 

 

Share this post


Link to post
Share on other sites

You're close, try changing 

[towtruck, [getPosATL MGI157]] remoteExec ["doMove"];

into 

[towtruck, getPosATL MGI157] remoteExec ["doMove", towtruck];

 

Share this post


Link to post
Share on other sites

thank you very much!!

It worked in the editor so I think it will also work when I test it on the server

 

I paste the code below.

 

to call the truck

this addaction ["<t color='#ff0000'>call towtruck</t>", { [towtruck, getPosATL MGI157] remoteExec ["doMove", towtruck]; }, [],1,false,true,"","_this distance _target < 2"]; 

to return the truck

this addaction ["<t color='#ff0000'>dismiss towtruck</t>", { [towtruck, getMarkerPos "towtruck west"] remoteExec ["doMove", towtruck]; }, [],1,false,true,"","_this distance _target < 2"];

 

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

×