Not adding player to force...

Reaction score
341
I Have this simple loop, that works perfect.... UNLESS! I add a simple ForceAddPlayer(players, Player(i)). Here's the code

JASS:
//
    loop
        exitwhen i > 7
            if GetPlayerController(Player(i)) == MAP_CONTROL_USER then
            if GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
                call SetPlayerState(Player(i), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(Player(i), PLAYER_STATE_RESOURCE_GOLD) + 10)
                set udg_PG2 = udg_PG2 + 1
                call CreateUnitAtLoc(Player(i), 'h000', GetStartLocationLoc(GetPlayerStartLocation(Player(i))), 0)
                call ForceAddPlayer(Player(i), players) // Here's the line
                    if (GetLocalPlayer() == Player(i)) then
                        call ClearSelection()
                        call SelectUnit(bj_lastCreatedUnit, true)
                        call PanCameraToTimed(GetUnitX(bj_lastCreatedUnit) -50, GetUnitY(bj_lastCreatedUnit) -50, 0)
                    endif
            endif
            endif
            set i = i + 1
    endloop



EDIT : Nevermind, i just forgot to initialize the group.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top