Why is the error message to working?
#1

pawn Код:
case DIALOG_Password: {
            if(! Response) {
                Kick(PlayerID);
                return true;
            }
           
            if(3 > strlen(Input) > 100) {
                if(3 > strlen(Input)) {
                    SendMessageToPlayer(PlayerID, ""Embed_White"Invalid password, passwords must contain more than 3 characters.");
                    DialogShowForPlayer(PlayerID, "Password", "Invalid password, passwords must contain more than 3 characters.");
                } else {
                    SendMessageToPlayer(PlayerID, ""Embed_White"Invalid password, passwords must contain less than 100 characters.");
                    DialogShowForPlayer(PlayerID, "Password", "Invalid password, passwords must contain less than 100 characters.");
                }
            } else {
                SetPlayerPassword(PlayerID, Input);
                SendMessageToPlayer(PlayerID, ""Embed_White"You've successfully registered!");
                SetPlayerRegistration(PlayerID, (GetPlayerRegistration(PlayerID) + 1));
                PutPlayerInRegistration(PlayerID);
            }
            return true;
        }
Custom Callback:
PlayerRespondedToDialog(PlayerID, DialogID, Response = false, Input = "");

Custom Functions:
SendMessageToPlayer(PlayerID, Message[], {Float,_}:...);
DialogShowForPlayer(PlayerID, Name[], Error[] = "");
SetPlayerPassword(PlayerID, Password[]);
SetPlayerRegistration(PlayerID, RegistrationID);
GetPlayerRegistration(PlayerID);
PutPlayerInRegistration(PlayerID);

Okay so you don't say I have my function names and/or variables wrong, I've provided a list of the functions you see in the code above.

The problem:
Quote:

if(3 > strlen(Input) > 100) {

Doesn't seem to be working. When I go in-game and leave the field blank, it says I successfully registered... Which is bad.
Can anyone tell what I'm doing wrong?
Reply
#2

I tried
Код:
if(3 > strlen(Input) > 100)
It didnt work.

Use
pawn Код:
if(3 > strlen(Input) ||  strlen(Input) > 100)
Reply
#3

Hm

3 < strlen(Input) < 100

Usually works, I wonder why it didn't this time.
Thanks, you helped me solve it.
Reply
#4

Quote:
Originally Posted by Sniper Kitty
Посмотреть сообщение
Hm

3 < strlen(Input) < 100

Usually works, I wonder why it didn't this time.
Thanks, you helped me solve it.
In your first post you had:
"if(3 > strlen(Input) > 100) { "
what means that if you enter over 100 character it only work.
What you want even to achieve with this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)