Login Tries Help
#3

Quote:
Originally Posted by Kyance
Посмотреть сообщение
Here's my version.

pawn Код:
new LWarns[MAX_PLAYERS]; //Above all code, short for "LoginWarns"


/*blablablablablablablablblblbl OnDialogResponse blablblablblablbalbalabllb*/

case DIALOG_LOGIN:
        {
            if ( !response ) Kick ( playerid );
            else
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {

                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
                    PlayerInfo[playerid][pLoggedIn] = 1;
                   
                    ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,"Success!","You have successfully logged in!","Ok","");
                   
                   
                                //stuff here
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","{FFFFFF}You have entered an {FF9933}incorrect {FFFFFF}password.\nType your password below to login.","Login","Quit");
                    LWarns{ playerid }++; //Increases
                    if(LWarns{ playerid } == 1) //If he has failed 1x, he gets vvvv message
                    {
                        SendClientMessage(playerid, COLOR_ORANGE, "* Two more invalid logins and you will be kicked!");
                    }
                    if(LWarns{ playerid } == 2) //If he has failed 2x, he gets vvvvv message
                    {
                        SendClientMessage(playerid, COLOR_RED, "* One more invalid login and you will be kicked!");
                    }
                    if(LWarns{ playerid } == 3) //If he has failed 3x, he gets kicked.
                    {
                        new string[74], pName[MAX_PLAYERS];
                        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
                        SendClientMessage(playerid, COLOR_RED, "* You've been kicked for multiple failed logins!");
                        SetTimerEx("KickTimer", 150, false, "i", playerid);
                    }
                }
            }
        }


/*blablablblablblablblbl Kicktimer bblalablablblbl*/

forward KickTimer(playerid);
public KickTimer(playerid)
{
    Kick(playerid);
    return 1;
}
;d
Can you please edit my code
Reply


Messages In This Thread
Login Tries Help - by sonushan - 10.02.2014, 12:11
Re: Login Tries Help - by Kyance - 10.02.2014, 12:25
Re: Login Tries Help - by sonushan - 10.02.2014, 12:38
Re: Login Tries Help - by sonushan - 10.02.2014, 13:50
Re: Login Tries Help - by CuervO - 10.02.2014, 13:52
Re: Login Tries Help - by sonushan - 10.02.2014, 14:31

Forum Jump:


Users browsing this thread: 1 Guest(s)