The errors and warning are given because you have `else` twice. Take a look at the example below:
More about the command now. You use:
You should check if `id` is NOT equal to INVALID_PLAYER_ID. You use `playerid` in some arrays instead of `id`.
pawn Code:
CMD:stats(playerid, params[])
{
if (PlayerInfo[playerid][LoggedIn] == false) return SendClientMessage(playerid, COLOR_RED, "ERROR: Account must be registered in order to use commands.");
if (sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "Syntax: /stats <playerid>");
new id;
if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected");
new string[266], tname[MAX_PLAYER_NAME], registered[4], admrank[57], // increase 266 if text is cut
admin = PlayerInfo[id][AdminLevel],
kills = PlayerInfo[id][Kills],
deaths = PlayerInfo[id][Deaths],
score = PlayerInfo[id][Score],
money = GetPlayerMoney(id);
GetPlayerName(id, tname, sizeof(tname));
registered = (PlayerInfo[id][LoggedIn] == false) ? ("No") : ("Yes");
static const ranks_with_color[][] = {"", "{FFFF00}(Moderator)", "{008000}(Administrator)", "{3366FF}(Manager)"};
if (IsPlayerAdmin(id))
{
admrank = "{00FF00}Admin Level:{FF0000} RCON Admin\n";
}
else if (1 <= PlayerInfo[id][AdminLevel] <= 3)
{
format(admrank, sizeof(admrank), "{00FF00}Admin Level:{FFFFFF} %d %s\n", PlayerInfo[id][AdminLevel], ranks_with_color[PlayerInfo[id][AdminLevel]]);
}
format(string, sizeof(string), "{00FF00}Name:{FFFFFF} %s\n{00FF00}Registered:{FFFFFF} %s\n%s{00FF00}Kills:{FFFFFF} %d\n{00FF00}Deaths:{FFFFFF} %d\n{00FF00}Score:{FFFFFF} %d\n{00FF00}Money:{FFFFFF} %d", tname, registered, admrank, kills, deaths, score, money);
ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "{FFFFFF}Player's Statistics:", string, "Okay", "");
return 1;
}