• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

How to assess the number of playing players in the game?

Status
Not open for further replies.
Level 3
Joined
Feb 27, 2011
Messages
39
There is an event "Player - Leaves game", however what if the player never was there eg. the host started with a number of players below maximum? I would need to turn the number of players into a variable, is this possible?
"number of players in all players controlled by a user" gives a weird number of maximum user players from player properties minus 1 ??
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,206
Yes it is possible.
Firstly you need an integer global to keep track of this number.

Next you need to count all the players that have a slot state of "playing" and a map controler of "user".
Simply make the integer global equal to that. Everytime a player leaves you logically decriment it by 1.

It is important that they be bother playing and a user otherwise it may count AI players.
 
Status
Not open for further replies.
Top