1. Hello everybody,

    I would like some help on me problem, please.

     local EventFrame = CreateFrame("Frame")
     local teamName, teamSize, teamRating, teamPlayed, teamWins, seasonTeamPlayed, seasonTeamWins, playerPlayed, seasonPlayerPlayed, teamRank, playerRating, bg_red, bg_green, bg_blue, emblem, emblem_red, emblem_green, emblem_blue, border, border_red, border_green, border_blue = GetArenaTeam(1)
     EventFrame:RegisterEvent("PLAYER_LOGIN")
     EventFrame:SetScript("OnEvent", function(self,event,...)
            ChatFrame1:AddMessage("xd" ..teamName);
            ChatFrame1:AddMessage("lol");
     end)
    

    My variables are all init at 0 and when i try to print teamName that print nothing at all.

    Thank you.

    Hello everybody,

    I would like some help on me problem, please.

     local EventFrame = CreateFrame("Frame")
     local teamName, teamSize, teamRating, teamPlayed, teamWins, seasonTeamPlayed, seasonTeamWins, playerPlayed, seasonPlayerPlayed, teamRank, playerRating, bg_red, bg_green, bg_blue, emblem, emblem_red, emblem_green, emblem_blue, border, border_red, border_green, border_blue = GetArenaTeam(1)
     EventFrame:RegisterEvent("PLAYER_LOGIN")
     EventFrame:SetScript("OnEvent", function(self,event,...)
          ChatFrame1:AddMessage("xd" ..teamName);
          ChatFrame1:AddMessage("lol");
     end)
    

    My variables are all init at 0 and when i try to print teamName that print nothing at all.

    Thank you.

    A few things: most game information is not truly available until after PLAYER_LOGIN, that's why you normally see this pattern. There's no reason to pre-fetch the information (which is wrong) and then print it later. Fetch it when it is needed and you know you can get it.

    Let's start with something simple:

     EventFrame = CreateFrame("Frame")
     local function onEvent(self, event, ...)
       if event == "PLAYER_LOGIN" then
         local teamName = GetArenaTeam(1)
         print("Team name is: " .. tostring(teamName))
       end
     end)
     EventFrame:SetScript("OnEvent", onEvent)
     EventFrame:RegisterEvent("PLAYER_LOGIN")
     -- Depending on when you run this code, especially if this is a load on demand addon
     -- the PLAYER_LOGIN event may have already fired. You can run it manually in that
     -- case.
     if IsLoggedIn() then
       onEvent(EventFrame, "PLAYER_LOGIN")
     end
    

    Thank you for you'r answer.

    Yes it seems just logical I don't know why I didn't thought about that

    Thanks you a lot I'll try this right now

    Hi again,

    I tried to get my arena infos very very late, when I go in combat, to be sure that I could get arenas informations but thats still dont work :(

     local EventFrame = CreateFrame("Frame")
     local teamName, Size
     EventFrame:RegisterEvent("PLAYER_ENTER_COMBAT")
     EventFrame:SetScript("OnEvent", function(self,event,...)
            teamName, Size = GetArenaTeam(2)
            ChatFrame1:AddMessage("Arena book is ready, ".. Size..".")
     end)
    

    That isn't the 'go into combat event'. That is PLAYER_REGEN_DISABLED, but even that is not 100%. Why not one of the arena events, such as ARENA_TEAM_ROSTER_UPDATE?

    Hi, i tried what you said, but it still doest work I wonder if this function is not broken.

    That seems unlikely, given that the UI uses it.

    I found a solution, i just used ARENATEAMUPDATE Thank you a lot.