SA-MP Forums Archive
Dialog login - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dialog login (/showthread.php?tid=501899)



Dialog login - DerickClark - 21.03.2014

Line: else

pawn Код:
error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
pawn Код:
case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    new pname[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, pname, sizeof(pname));
                    new Message[256];
                    format(Message, sizeof(Message), "%s joined!", ReturnName(playerid));
                    SendClientMessageToAll(-1, Message);
                }
                else
                {
                    FailLogin[playerid]++;
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
                }
                else
                FailLogin[playerid]++;
                {
                   if(FailLogin[playerid] == MAX_FAIL_LOGINS)
                   {
                     Kick(playerid);
                   }
                }
                return 1;
            }
        }
    }



Re: Dialog login - Unte99 - 21.03.2014

I think this is your problem.

pawn Код:
else
FailLogin[playerid]++;
{



Re: Dialog login - UnknownOwner - 21.03.2014

Код:
case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    new pname[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, pname, sizeof(pname));
                    new Message[256];
                    format(Message, sizeof(Message), "%s joined!", ReturnName(playerid));
                    SendClientMessageToAll(-1, Message);
                }
                else
                {
                    FailLogin[playerid]++;
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
                }
                else
                {
                FailLogin[playerid]++;
                {
                   if(FailLogin[playerid] == MAX_FAIL_LOGINS)
                   {
                     Kick(playerid);
                   }
                }
             }
                return 1;
            }
        }
    }



Re: Dialog login - DerickClark - 21.03.2014

Quote:
Originally Posted by Unte99
Посмотреть сообщение
I think this is your problem.

pawn Код:
else
FailLogin[playerid]++;
{
yes. tryin to put else when the player fail the logins


Re: Dialog login - DerickClark - 23.03.2014

3 days.


Re: Dialog login - Equuuuin0X - 23.03.2014

Try this.

pawn Код:
case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    new pname[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, pname, sizeof(pname));
                    new Message[256];
                    format(Message, sizeof(Message), "%s joined!", ReturnName(playerid));
                    SendClientMessageToAll(-1, Message);
                }
                else
                {
                    FailLogin[playerid]++;
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
                    if(FailLogin[playerid] == MAX_FAIL_LOGINS)
                    {
                    Kick(playerid;
                    }
                }
                return 1;
            }
        }
    }



Re: Dialog login - DerickClark - 23.03.2014

Quote:
Originally Posted by Equuuuin0X
Посмотреть сообщение
Try this.

pawn Код:
case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    new pname[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, pname, sizeof(pname));
                    new Message[256];
                    format(Message, sizeof(Message), "%s joined!", ReturnName(playerid));
                    SendClientMessageToAll(-1, Message);
                }
                else
                {
                    FailLogin[playerid]++;
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
                    if(FailLogin[playerid] == MAX_FAIL_LOGINS)
                    {
                    Kick(playerid;
                    }
                }
                return 1;
            }
        }
    }
Nvm, I got it worked.