Jump to content
Casio91Fin

Read all players in coop

Recommended Posts

SP_AllPlayers = allUnits select {isPlayer _x};  This works on the server side, but only 80%

SP_AllPlayers = allUnits select {isPlayer _x && {!(_x isKindOf "HeadlessClient_F")}}; <<< This doesn't work on the MP side why? (working SP) or have I forgotten something?

Needs some sort of the same type that would read the players in server.

Share this post


Link to post
Share on other sites

allPlayers Dead or alive.

 

BIS_fnc_ListPlayers   is exactly same as :   (allUnits + allDead) select {isPlayer _x} //  no added value!

 

At least you could reduce that by:

(playableUnits + switchableUnits) select {isPlayer _x};  I'm rather sure these commands skip the Headless clients and there is no need to search among all non-playable units!

  • Like 1

Share this post


Link to post
Share on other sites
48 minutes ago, engima said:

Exactly the same, except for that allPlayers command seems to be a bit unteliable in the beginning of hosted games, according to notes in wiki:

 

https://community.bistudio.com/wiki/allPlayers

 

I repeat:

BIS_fnc_ListPlayers   is exactly same as :   (allUnits + allDead) select {isPlayer _x} //  no added value! You can check that easily in function viewer.

 

So, you have choice between isPlayer inconsistency (red warning) and allPlayers little delay if Hosted game.

Share this post


Link to post
Share on other sites

Ok, good piece of information. I have not really looked into it since I learned and confirmed that BIS_fnc_ListPlayers seems to always work.

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

×