• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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