Jump to content
Sign in to follow this  
MalkContent

publicVariableClient in OnPlayerConnected event - how to? :/

Recommended Posts

I am trying to use publicVariableClient in an OnPlayerConnected event.

Sadly I need the "clientID" for this and OnPlayerConnected only hands you the sessionID(_id), uniqueID(_uid) and the playername(_name) of the connected client :/

Any ideas how I would go about doing this?

Share this post


Link to post
Share on other sites
_clientId = -1;
{
  if (getPlayerUID _x == _uid) exitWith
  {
     _clientId = owner _x;
  };
} forEach allUnits;

Share this post


Link to post
Share on other sites

many thanks, I thought it would work, but apparently this does not work for any player except the first to join. for all subsequent ones _clientId remains -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
Sign in to follow this  

×