• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Count number of players @_@

Status
Not open for further replies.
Level 3
Joined
Mar 30, 2007
Messages
26
Okie, yet another simple question:
How do you count the number of playing players in the game, excluding computer players?

Current Action:
Set (DifficultyInteger) = (Number of players in (All players matching (((Matching Player) slot status equal to (is playing.)))

The only problem is it counts computer players. Help me, I'm so dizzy @_@
 
Level 14
Joined
Jan 15, 2007
Messages
349
There are two ways to count all players who are playing and who are no computers.

First Way:
  • Count1
    • Events
      • <Your Event>
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) slot status) Equal to Is playing
              • ((Player((Integer A))) controller) Equal to User
            • Then - Actions
              • Set CountInteger = (CountInteger + 1)
            • Else - Actions
Second Way:
  • Count2
    • Events
      • <Your Event>
    • Conditions
    • Actions
      • Set CountInteger = (Number of players in (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing))))
I hope I helped you!
 
Status
Not open for further replies.
Top