Jump to content
SkillerPenguin

createVehicle and MP compatibility in my case?

Recommended Posts

Hello!

 

I'm trying to make a mission where players are spawned in parachutes at the height of 220 meters.

 

However, I'm overlooking something super simple that's leading to a parachute being spawned on every person for every player on the server (eg 30 players on the server means 30 paras on each person on the server). 

I know it's something simple but I'm not going to figure this out within a reasonable time frame without external help.

 

 

Here's the script, placed in a player init. I've also tried a game logic angle with the player (non-MP compat unit), to no avail (obviously).

 

chute = "DEGA_T10_Parachute" createVehicle [0,0,0];
chute setPos [getPos this select 0, getPos this select 1, 220];
this moveIndriver chute;

 

Any help?

 

Also, a side quest: I'm trying to use an sqs script in Arma 3 multiplayer which I used to use in Arma 2 multiplayer, still works in Arma 3 single player but not multiplayer. Is there any go-to solution that would come to mind without me having to upload the script?

 

Thanks!

Share this post


Link to post
Share on other sites

Init lines are run for each object for each player, so your observation is correct. One method is to ensure it is only run in a single place. You use the moveInDriver command which requires the left argument to be local. So try this:

 

if (local this) then {
    chute = "DEGA_T10_Parachute" createVehicle [0,0,0];
    chute setPos [getPos this select 0, getPos this select 1, 220];
    this moveIndriver chute;
};

 

Share this post


Link to post
Share on other sites
7 hours ago, Muzzleflash said:

Init lines are run for each object for each player, so your observation is correct. One method is to ensure it is only run in a single place. You use the moveInDriver command which requires the left argument to be local. So try this:

 


if (local this) then {
    chute = "DEGA_T10_Parachute" createVehicle [0,0,0];
    chute setPos [getPos this select 0, getPos this select 1, 220];
    this moveIndriver chute;
};

 

 

Worked great! Thank you.

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

×