Password Bug
#1

Hi All. I Need Help idk How to fix this Bug
(i login to Server the register dialogye Show to me but i don't Write password i can register)
Must Write More then 6 caract
Код:
11:55:36] {F5E618}Name: {FFFFFF}V.T.T {F5E618}Password: {FFFFFF} {F5E618}succesfuly registerd

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
    {
        case DIALOG_REGISTER:
        {
            if(response)
            {
           	     new
                    string[179],pFile[35];

    				format(pFile, 35, Player_File, GetName(playerid));

    			 new
        			INI:UserFile = INI_Open(pFile);

    				INI_WriteInt(UserFile, "Password", udb_hash(inputtext));
    				INI_WriteInt(UserFile, "Admin", 0);
    				INI_WriteInt(UserFile, "Money", START_MONEY);
    				INI_WriteInt(UserFile, "Score", 0);
				    INI_WriteInt(UserFile, "Skin", SKIN_ID);
				    INI_WriteInt(UserFile, "Warn", 0);
				    INI_WriteInt(UserFile, "VIP", 0);

    				INI_Close(UserFile);

    				SetPVarInt(playerid, "Registered", 1);
    				SetPVarInt(playerid, "Logged", 1);
    				SpawnPlayer(playerid);

                    format(string, 125, ""COL_YELLOW"Name: "COL_WHITE"%s "COL_YELLOW"Password: "COL_WHITE"%s "COL_YELLOW"succesfuly registerd", GetName(playerid), inputtext);
                    SCM(playerid, 0x46BA29FF, string);
                    SpawnPlayer(playerid);
            }
            else Kick(playerid);
        }

        case DIALOG_LOGIN:
        {
            if(response)
            {
                	new
                    pFile[35],dialog[128];

    				format(pFile, 35, Player_File, GetName(playerid));

    				INI_ParseFile(pFile, "LoadPlayerData", .bExtra = true, .extra = playerid);


    				if(udb_hash(inputtext) == P_Data[playerid][pPassword])
    				{
      				SetPVarInt(playerid, "Logged", 1);
      				SCM(playerid,-1,"Succesfuly login!");
    				}
   				 	else
    				{
        			format(dialog, sizeof(dialog),""COL_YELLOW"Name "COL_WHITE"%s "COL_YELLOW"is registered\n\n{FFFFFF}Please login", GetName(playerid));
        			ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{FF0033}Welcome on my server",dialog, "Login", "Exit");
    				}
            	}
            else Kick(playerid);
        }
Код:
Password = 1
Admin = 0
Money = 1000
Score = 0
Skin = 150
Warn = 0
VIP = 0
Reply
#2

A password is no int.

So you should use:

PHP код:
INI_WriteString(UserFile"Password"udb_hash(inputtext)); 
and to check the length of the inputtext:

PHP код:
if(strlen(inputtext) < 6) return /* Do you're thing here *///Here the length is smaller then 6 
Reply
#3

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
A password is no int.

So you should use:

PHP код:
INI_WriteString(UserFile"Password"udb_hash(inputtext)); 
and to check the length of the inputtext:

PHP код:
if(strlen(inputtext) < 6) return /* Do you're thing here *///Here the length is smaller then 6 
Can u edit it and Send me bcz i can't Understand bro
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)