Why doesn't this work?

static bool HandleMmrCommand(ChatHandler* handler, const char* args)
{
Player* player = handler->GetSession()->GetPlayer();

    uint16 mmr;
    {

if(ArenaTeam *getmmr = sArenaTeamMgr->GetArenaTeamById(player->GetArenaTeamId(2))) // <---- assuming mistake is here?
mmr = getmmr->GetMember(player->GetGUID())->MatchMakerRating;
else
mmr = 1500;
return mmr;
}
handler->PSendSysMessage(“Your Mmr is: %u.”, mmr);
return true;
}
Doesn’t return mmr, command does absolutely nothing? Regardless if the player has a team or not.

Anyone know? I’m sure its a retarded mistake…

static bool HandleMmrCommand(ChatHandler* handler, const char* args)
{
Player* player = handler->GetSession()->GetPlayer();

uint16 mmr;
if(ArenaTeam *getmmr = sArenaTeamMgr->GetArenaTeamById(player->GetArenaTeamId(2)))
    mmr = getmmr->GetMember(player->GetGUID())->MatchMakerRating;
else
    mmr = 1500;
handler->PSendSysMessage("Your Mmr is: %u.", mmr);
return true;

}
This is your code:

static bool HandleMmrCommand(ChatHandler* handler, const char* args)
{
Player* player = handler->GetSession()->GetPlayer();

uint16 mmr;
{
    if(ArenaTeam *getmmr = sArenaTeamMgr->GetArenaTeamById(player->GetArenaTeamId(2)))
        mmr = getmmr->GetMember(player->GetGUID())->MatchMakerRating;
    else
        mmr = 1500; 
    return mmr; // <---- mistake is probably here
}
handler->PSendSysMessage("Your Mmr is: %u.", mmr);
return true;

}

Reason:

You get the value, then return.

return stops the whole function and since you dont do anything really except get values, it has no real effect.

im embarassed not sure how i didnt catch that… knew it was something with that