• 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] GetPlayerSlotState() in GUI

Status
Not open for further replies.
Level 6
Joined
Jun 30, 2006
Messages
230
As I've mentioned in several posts, I've been trying to convert anything I can to GUI for readability and so that anyone can edit it whether they know JASS or not.

I'm trying to create two forces, Alliance and Horde, but only add the players who are playing, to do this you use GetPlayerSlotState().

In JASS it is easy:
JASS:
function Forces takes nothing returns nothing
    local integer c = 0
    set udg_Alliance = CreateForce()
    set udg_Horde = CreateForce()
    loop
        exitwhen c > 4
        if ( GetPlayerSlotState(Player(c)) == PLAYER_SLOT_STATE_PLAYING ) then
            call ForceAddPlayer( udg_Alliance, Player(c) )
        endif
        if ( GetPlayerSlotState(Player(c + 5)) == PLAYER_SLOT_STATE_PLAYING ) then
            call ForceAddPlayer( udg_Horde, Player(c + 5) )
        endif
        set c = c + 1
    endloop
endfunction

But for GUI, I cannot find a way to see if the player is playing or not. Is this not possible?
 
Status
Not open for further replies.
Top