2 IF's and only 1 else..
#1

I currently have this login dialog, as an example:

if1(password not correct)
{
...
}
if2(box empty)
{
...
}
else
{
login
}

This wont work, I want to assign two "IF's" to one "ELSE". Currently the else wont work on IF2, when it wont match the criterias it still logs me in.
Reply
#2

Yes I tried else if, but it wont work. Whatever I enter when using "else if", it spawns me but wont load my user info. (wont send me the clientmessage in this case)


pawn Код:
if(strcmp(inputtext, parool, false) != 0)
                {
                    SendClientMessage(playerid, C_BLUE, "SERVER: Wrong password!");
                    ShowPlayerDialog(playerid, 3, DIALOG_STYLE_PASSWORD, "..:::Logging in:::..","{FF0000}Wrong password!", "Login", "Leave");
                }
                else if(!strlen(inputtext))
                {
                    SendClientMessage(playerid, C_BRED, "You entered an empty password!");
                    ShowPlayerDialog(playerid, 3, DIALOG_STYLE_PASSWORD, "..:::Logging in:::..","{FF0000}You entered an empty password!", "Login", "Leave");
                }
                else
                {
                    SendClientMessage(playerid, C_BLUE, "SERVER: You are logged in!");
                }
Reply
#3

........ nvm
Reply
#4

Quote:
Originally Posted by Jonny5
Посмотреть сообщение
its elseif not else if
What?

Quote:
Originally Posted by Dan.
Посмотреть сообщение
pawn Код:
if(strcmp(inputtext, parool, false) != 0)
                {
                    SendClientMessage(playerid, C_BLUE, "SERVER: Wrong password!");
                    ShowPlayerDialog(playerid, 3, DIALOG_STYLE_PASSWORD, "..:::Logging in:::..","{FF0000}Wrong password!", "Login", "Leave");
                }
                else if(!strlen(inputtext))
                {
                    SendClientMessage(playerid, C_BRED, "You entered an empty password!");
                    ShowPlayerDialog(playerid, 3, DIALOG_STYLE_PASSWORD, "..:::Logging in:::..","{FF0000}You entered an empty password!", "Login", "Leave");
                }
                else
                {
                    SendClientMessage(playerid, C_BLUE, "SERVER: You are logged in!");
                }
I don't see any function that loads player data in here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)