xjoker_ 25 Posted May 6, 2019 Hello. Let's say in my mission, at any time, clients need to get the number of players that have a specific variable assigned. What method is the best (mostly for network traffic) between when players connect, the server assign a random var (A, B, or C) to them using _unit setVariable ["var","A",true]; // A, B or C And clients can get the number of players like that : _nbA = {_x getVariable ["var",""] isEqualTo "A"} count playableUnits; or when players connect, the server increments a variable (and do the opposite when players disconnect) like nbA = nbA + 1; publicVariable "nbA"; nbA = nbA - 1; publicVariable "nbA"; And clients can access the var like that hint str nbA; hint str nbB; hint str nbC; Share this post Link to post Share on other sites
gc8 970 Posted May 6, 2019 I think the publicVariable implementation is fastest because when you use setvariable with public variable true the setvariable is set on all clients including JIP clients. Share this post Link to post Share on other sites
Dedmen 2588 Posted May 7, 2019 21 hours ago, gc8 said: because when you use setvariable with public variable true the setvariable is set on all clients including JIP clients. That's exactly what publicVariable does too. 22 hours ago, xjoker_ said: Let's say in my mission, at any time, clients need to get the number of players that have a specific variable assigned. I think one could probably make a better solution if we knew what you are actually trying to do. The second variant is better because you have just one variable that will have to be redistributed to all clients, instead of one per client. 2 Share this post Link to post Share on other sites
gc8 970 Posted May 7, 2019 2 minutes ago, Dedmen said: That's exactly what publicVariable does too. yeah I meant 3 publicvariables are better than transmitting all the player variables for each client 1 Share this post Link to post Share on other sites