Problem comand /contract : unreachable code
#8

Quote:
Originally Posted by Mandrakke
Посмотреть сообщение
"unreachable code" error occurs when you put an "return" before the end of the function, you have not pasted ALL your OnPlayerCommandText, but you can fix it by yourself just checking for all "returns" in to your code and seeing if it is outside of an condition.
I've pasted ALL fron OnPlayerCommandText,all to the fisrt command,but the comand:
pawn Код:
if(strcmp(cmd,"/portable",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
            {
                if(ConnectedToPC[playerid] == 255)
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "{FFFFFF}[{4FD359}Hard2Games{FFFFFF}]: Ai deconectat Laptop-ul.");
                    ConnectedToPC[playerid] = 0;
                    return 1;
                }
                GetPlayerName(playerid, sendername, sizeof(sendername));
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "{FFFFFF}[{4FD359}Hard2Games{FFFFFF}]: Laptop-ul este Pornit.");
                SendClientMessage(playerid, COLOR_GREEN, "{FFFFFF}|------|{FF0000} Hitman Agency {FFFFFF}|------|{FF0000}");
                SendClientMessage(playerid, COLOR_YELLOW2, "");
                SendClientMessage(playerid, COLOR_YELLOW2, "{00A6FF}>>{FFFFFF} News");
                SendClientMessage(playerid, COLOR_YELLOW2, "{00A6FF}>>{FFFFFF} Contracts");
                SendClientMessage(playerid, COLOR_YELLOW2, "{00A6FF}>>{FFFFFF} Givehit");
                SendClientMessage(playerid, COLOR_YELLOW2, "{00A6FF}>>{FFFFFF} Ranks");
                SendClientMessage(playerid, COLOR_YELLOW2, "{00A6FF}>>{FFFFFF} Logout");
                SendClientMessage(playerid, COLOR_GREEN, "{FFFFFF}|------|{FF0000} Hitman Agency {FFFFFF}|------|{FF0000}");
                ConnectedToPC[playerid] = 255;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "{FFFFFF}[{4FD359}Hard2Games{FFFFFF}]: Ne pare rau, dar nu faci parte din factiunea Hitman Agency.");
            }
        }
        return 1;
    }
It has the problem:
pawn Код:
55006:     if(strcmp(cmd,"/portable",true)==0)
warning 225: unreachable code
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)