SA-MP Forums Archive
need little help wich login system - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: need little help wich login system (/showthread.php?tid=274012)



need little help wich login system - doreto - 04.08.2011

PROBLEM FIXED


Re: need little help wich login system - doreto - 04.08.2011

anyone ?


Re : need little help wich login system - Soumi - 04.08.2011

When you register an account check if it creates a .ini files in your scriptfiles folder. if yes tell me if the password is saved in that file.


Re: need little help wich login system - doreto - 04.08.2011

yea i register on scriptfiles folder i make folder called Users i see my name but when i try to login like restart login and repeat


Re : need little help wich login system - Soumi - 04.08.2011

The password you entered to register is correct?


Re: need little help wich login system - doreto - 04.08.2011

yea 100% i upload pic you can see and second its see i press login and 3-th say again login


AW: need little help wich login system - samtey - 04.08.2011

U mean: He wants to login and to login and to login? Take mine, oldie!

PHP код:
    public OnDialogResponse(playeriddialogidresponselistiteminputtext[]) {
        switch(
dialogid) {
            case 
DIALOG_REGISTER: {
                if(!
response) return Kick(playerid);
                if(
response) {
                    if(!
strlen(inputtext)) return ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT""WHITE"Registering...",""RED"You have entered an invalid password.\n"WHITE"Type your password below to register a new account.","Register","Quit");
                    if(
INI_Open(getINI(playerid))) {
                        
INI_WriteString("Password",inputtext);
                        
INI_WriteInt("Cash"0);
                        
INI_WriteInt("Admin"0);
                        
INI_WriteInt("Score"0);
                        
INI_Save();
                        
INI_Close();
                        
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT,""WHITE"Login",""WHITE"Type your password below to login.","Login","Quit");
                    }
                }
            } case 
DIALOG_LOGIN: {
                if(!
response) return Kick playerid );
                if(
response) {
                    if(!
strlen(inputtext)) return ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT""WHITE"Login",""RED"You have entered an invalid password.\n"WHITE"Type your password below to login.","Login","Quit");
                    if(
INI_Open(getINI(playerid))) {
                        
INI_ReadString(PlayerInfo[playerid][pPass],"Password",20);
                        if(
strcmp(inputtext,PlayerInfo[playerid][pPass],false)) {
                            
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT""WHITE"Login",""RED"You have entered an incorrect password.\n"WHITE"Type your password below to login.","Login","Quit");
                        }
                        
GivePlayerMoneyplayeridINI_ReadInt"Cash" ) );
                        
PlayerInfo[playerid][pAdmin] = INI_ReadInt("Admin");
                        
SetPlayerScoreplayeridINI_ReadInt"Score" ) );
                        
INI_Close();
                    }
                }
            }
        }
        return 
1;
    } 



Re : need little help wich login system - Soumi - 04.08.2011

Try this:

Код:
case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {

                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an invalid password.\n"WHITE"Type your password below to login.","Login","Quit");

                if(INI_Open(getINI(playerid))) {
                INI_ReadString(PlayerInfo[playerid][pPass],"Password",20);

                if(strcmp(inputtext,PlayerInfo[playerid][pPass],false)) {
                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an incorrect password.\n"WHITE"Type your password below to login.","Login","Quit");
                }

                PlayerInfo[playerid][pAdmin] = INI_ReadInt("Admin");
                GivePlayerMoney( playerid, INI_ReadInt( "Cash" ) );
                PlayerInfo[playerid][pKills] = INI_ReadInt("Kills");
                PlayerInfo[playerid][pDeaths] = INI_ReadInt("Deaths");
                
                INI_Close();
                }
            }
        }
    }
    return 1;
}



AW: need little help wich login system - samtey - 04.08.2011

Try this from Soumi, mine hasn't got kills or somethin!


Re: need little help wich login system - doreto - 04.08.2011

hah thanks Soumi and samtey
Quote:

samtey:U mean: He wants to login and to login and to login? Take mine, oldie!

yea no more login and login and again login