Jump to content
Sign in to follow this  
GregRUS

Players list array?

Recommended Posts

Is there a players list array command?

like list players or list west... ?

Share this post


Link to post
Share on other sites

just note that playableUnits will be all units that are playable, not all units that is players.

if you have 10 playable units, command will return them even if you have only 5 players active.

Share this post


Link to post
Share on other sites

And that it doesn't work in the single player editor. It will always be an empty array.

To ease testing you can do this in init.sqf:

if !ismultiplayer then { playableunits = switchableunits };

Share this post


Link to post
Share on other sites

@ Shuko

argh dont overwrite BI sqf commands..

Instead do something like this:

//init.sqf

if (isNil "paramsArray") then
{
AAS_EditorModeSP = true;
};

//any script
if (AAS_EditorModeSP) then
{
MyTag_PlayableUnits = switchableUnits;
}
else
{
MyTag_PlayableUnits = playableUnits;
};

Share this post


Link to post
Share on other sites

Overwriting works fine. Simple and helps test MP scripts in SP editor without hassle. Write scripts using playableunits, use above code for testing, delete for release (isn't even necessary). No need for double entry when there is a list already.

Share this post


Link to post
Share on other sites

Other people's can will rely on SQF commands to work correctly. There is no good reason to break the scripting engine.

Share this post


Link to post
Share on other sites

I'm sure you can give us an example how this breaks something.

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  

×