Register error:
#1

pawn Код:
if(!(3 <= strlen(inputtext) <= 20))
                        return SendClientMessage(playerid, RED, "The password you supplied is either too short or too long.");
                        {
                            ShowPlayerDialog(playerid,30,DIALOG_STYLE_MSGBOX,"Error!","Please Enter A Password!","Ok","Quit");
                            return 1;
                        }
warning 225: unreachable code

What's wrong?
Reply
#2

You're returning values straight after the (if) statement.
Doing this:
pawn Код:
if(!(3 <= strlen(inputtext) <= 20)) return SendClientMessage(playerid, RED, "The password you supplied is either too short or too long.");
Will return the Client Message, and nothing else. You're stopping the function at that point. That means anything that's written later on will be ignored.

The correct method:
pawn Код:
if(!(3 <= strlen(inputtext) <= 20))
{
     // code...
     return whatever;

}
Reply
#3

Ops,my fault ..fixed,thanks.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)