sigzegv Posted February 16, 2018 Posted February 16, 2018 Is there a way to get client count programmatically just after unpausing mission on multiplayer ? (my script is ran on mission start)
Grimes Posted February 17, 2018 Posted February 17, 2018 If you know the units the clients occupy it is a simple matter of local count = 0 for i = 1, #clientTbl do if Unit.getByName(clientTbl) then count = count + 1 end end The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
sigzegv Posted February 17, 2018 Author Posted February 17, 2018 I want to know how many clients are really connected, I don't want to just count the client slots
Grimes Posted February 18, 2018 Posted February 18, 2018 Unit.getByName() only returns for clients that are currently spawned in their aircraft. So it is a pretty effective count. If you wanted the number of clients connected to the server you have to use the server API for that. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Recommended Posts