What is wrong?
#1

Alright, so this is my dialog for my login screen, but I cannot seem to get it to work properly, it says every password is invalid.

pawn Код:
if(strlen(inputtext) >= 1)
                {
                    INI_ParseFile(UserPath(playerid), "LoadUserData_%s", .bExtra = true, .extra = playerid);
                    if(strlen(inputtext) == pInfo[playerid][Password])
                    {
                        pInfo[playerid][Authenticated] = 1;
                        SpawnPlayer(playerid);
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, 0xFF0000FF, "ERROR: Invalid Password!");
                        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "Login", "Login", "Login", "Cancel");
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, 0xFF0000FF, "ERROR: No password was entered!");
                    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "Login", "Login", "Login", "Cancel");
                    return 1;
                }
Reply
#2

Learn what a function does first, before attempting to create a script with it.

https://sampwiki.blast.hk/wiki/Strlen
https://sampwiki.blast.hk/wiki/Strcmp
Reply
#3

INI_ParseFile(UserPath(playerid), "LoadUserData_%s", .bExtra = true, .extra = playerid);

do you load pInfo[playerid][Password] when parsing?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)