Jump to content
Sign in to follow this  
logan83

Condition All Mp Players

Recommended Posts

Hi Again mates, i need to know if i can use any form in multiplayer like "player" in single player.... i try to explain my self better

Single Player Mode:

Player distance Car <= 50 // This condition only run in Sp right?

ok i want the same, but in MP and with all the player that are playing the mision in that moment... but not all at the same time... i need the condition can be triggered by any of the fifty player, but cant Be "by side"... any suggestion

Share this post


Link to post
Share on other sites

also works in mp

"player" is the local player

on dedicated i think "player" is null

Share this post


Link to post
Share on other sites

I did not tested what I wrote, but according to the wiki units page you should be able to get all the players (as an array) doing this :

player in units group player

As I wrote, I can't test at the moment, so tell us if it works or not ;)

Share this post


Link to post
Share on other sites

Array of players in an MP game

MPplayers = [];
{ if (isPlayer _x) then { MPplayers set [count MPplayers, _x] }; }foreach playableUnits;

Array of MP players who are within 50m of the car.

MPplayers = [];
{ if ((isPlayer _x) && (_x distance Car <= 50) ) then { MPplayers set [count MPplayers, _x] }; }foreach playableUnits;

Couple of examples, your statement confuses me 'all but not at same time'. If the above is not what you want then player still works just make sure the code where your using player is client side.

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  

×