• 🏆 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!

[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