Jump to content

Recommended Posts

Hello everyone. I am trying to make a Multiplayer mission where people have to get teleported into a vehicle. 

I got a Blackfish called "unit1" flying, and I want every player in the server to be teleported into that vehicle.

I have tried many different command but nothing seems to work. I thought "moveInCargo" should work, but that only works on local units, not remote units. 

 

Things that I tried: 

{_x action ["getInCargo", unit1]} foreach allPlayers
Player1 moveInCargo [unit1, 1];
Player2 moveInCargo [unit1, 2];
Player3 moveInCargo [unit1, 3];
Player4 moveInCargo [unit1, 4];
Player5 moveInCargo [unit1, 5];
Player6 moveInCargo [unit1, 6];

Whatever I try, only me (The host) gets teleported into the vehicle. Other players don't.

Does someone know how to make this work?

Share this post


Link to post
Share on other sites

Use remoteExec with moveInCargo if u execute it server side.

sent from mobile using Tapatalk

Share this post


Link to post
Share on other sites

I think something like this could work:

[Player1, [unit1, 1]] remoteExec ["moveInCargo", Player1] ;
[Player1, [unit1, 2]] remoteExec ["moveInCargo", Player2] ;
[Player1, [unit1, 3]] remoteExec ["moveInCargo", Player3] ;
[Player1, [unit1, 4]] remoteExec ["moveInCargo", Player4] ;

 

or better in one line just like this:

[_unit1, {player moveInCargo _this}] remoteExec ["call", 0];

 

Share this post


Link to post
Share on other sites
23 hours ago, sarogahtyp said:

I think something like this could work:


[Player1, [unit1, 1]] remoteExec ["moveInCargo", Player1] ;
[Player1, [unit1, 2]] remoteExec ["moveInCargo", Player2] ;
[Player1, [unit1, 3]] remoteExec ["moveInCargo", Player3] ;
[Player1, [unit1, 4]] remoteExec ["moveInCargo", Player4] ;

 

or better in one line just like this:


[_unit1, {player moveInCargo _this}] remoteExec ["call", 0];

 

Okay, il try it out thnx

Share this post


Link to post
Share on other sites

You don't need to multiply network exchange:

 

{

  _x spawn {

    _plyr = _this;

    waitUntil {isplayer _plyr};

    _plyr moveincargo unit1

  }

} forEach playableUnits;

Share this post


Link to post
Share on other sites

{_x moveincargo unit1} foreach allplayers;

Pretty simple one

Share this post


Link to post
Share on other sites
3 hours ago, MKD3-FHI said:

{_x moveincargo unit1} foreach allplayers;

Pretty simple one

That's not what intended. allPlayers depends on the moment you run the code and doesn't make difference between JIP and already playing guys!

Share this post


Link to post
Share on other sites

 

On 4/20/2017 at 6:27 PM, Luckyas said:

and I want every player in the server to be teleported into that vehicle.

 


Why wouldnt you mention it was JIP dependent then?

Outline exactly what you want or you wont get the correct answer.

 

//Initplayerlocal.sqf
fn_teleport = {

	if (didJIP) then { player moveincargo unit1};

};

//Wherever you want
[] remoteExec ["fn_teleport", allPlayers];

 

  • 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

×