• 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.

[Trigger] Highest Player number?

Status
Not open for further replies.
Level 16
Joined
Oct 12, 2008
Messages
1,570
A little question,

When player 1, 2, 3, 7, 8 and 9 are playing a game (it is not important at all what game)
How can i check the highest player number?
number of players wont work, since there are 6 players, but the highest is 9.

The best and quickest way of checking gets a big :thumbs_up: and + rep
xD Good luck!
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
That is not it =P
If player 1, 2, and 6 are playing, the trigger needs to tell me 6 is the highest player number
If 3, 6, and 8 are playing, the trigger needs to tell me 8 is the highest player number,,
Get it?
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
dude, why arent you just using your brain? He just told you the answer, and you event dont think about it!

Count the damn players in the group, he really said all, and this is not a big problem, i guess you are just lazy?! Change the way, your asking your questions, man, this really makes me angry! -.-
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
dude, why arent you just using your brain? He just told you the answer, and you event dont think about it!

Count the damn players in the group, he really said all, and this is not a big problem, i guess you are just lazy?! Change the way, your asking your questions, man, this really makes me angry! -.-

WTF? NO!
If players 1, 2 and 6 are playing, the number of players in the group is 3!
But i need the 6 (is the number of the highest player!!)
If players 3,4,5 and 9 are playing, the number of players in the group us 4!
But i need the 9, cause that is the highest player number!

i dont need the AMOUNT of players, but the HIGHEST PLAYER NR.!! READ THE NAME OF THE FRIGGIN POST!
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
anybody said anything about an amount,

you just have to use an integer variable !

For each player in the group
If integer_variable < PLayer number of Picked Player then
set integer_variable = Player Number of Picked Player
 
Level 9
Joined
Apr 3, 2008
Messages
700
Make loop

JASS:
local integer i=-1
loop
set i=i+1
If GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
set udg_HighestNumber=i
endif
exitwhen i==11
endloop


And Modify PlayerNumber every time player leave.
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Make loop

JASS:
local integer i=-1
loop
set i=i+1
If GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
set udg_HighestNumber=i
endif
exitwhen i==11
endloop


And Modify PlayerNumber every time player leave.

Now this is what i am talking about
That would be in GUI something like this? :
  • 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
        • Then - Actions
          • Set Highest = (Integer A)
        • Else - Actions
 
Status
Not open for further replies.
Top