Register System
#1

On my script I am currently developing, my friend went onto it, registered, relogged and he apparently could not get in 'Invalid password' so I checked his account in the 'Accounts' folder and his password was '0' and he had set his password in text, please help


CODE:

Код:
public OnPlayerDisconnect(playerid, reason)
{
	new INI:File = INI_Open(UserPath(playerid));
	INI_SetTag(File,"data");
	INI_WriteInt(File,"Password",PlayerInfo[playerid][pKey]);
	INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]);
	INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
	INI_WriteInt(File,"RespectPoints",PlayerInfo[playerid][pConnectTime]);
    INI_WriteInt(File,"Registered",PlayerInfo[playerid][pReg]);
    INI_WriteInt(File,"Gender",PlayerInfo[playerid][pSex]);
    INI_WriteInt(File,"Age",PlayerInfo[playerid][pAge]);
    INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash]);
    INI_WriteInt(File,"Tutorial",PlayerInfo[playerid][pTut]);
	INI_Close(File);
	return 1;
}
Код:
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
				INI_WriteInt(File,"Level",0);
				INI_WriteInt(File,"Admin",0);
				INI_WriteInt(File,"RespectPoints",0);
    			INI_WriteInt(File,"Registered",0);
    			INI_WriteInt(File,"Gender",0);
	    		INI_WriteInt(File,"Age",0);
  			  	INI_WriteInt(File,"Cash",0);
    			INI_WriteInt(File,"Tutorial",0);
                INI_Close(File);
   				SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
      			SpawnPlayer(playerid);
			}
EDIT: They can log in when they do not enter a password, the dialog box comes up, they press enter with nothing inside and they log in?
Reply
#2

Why would you save player password on every disconnect.
Remove:
pawn Код:
INI_WriteInt(File, "Password", ...);
Actually passwords are always strings. Why have you got it as an integer :v
Use
pawn Код:
INI_WriteString(...)
in dialog response.

Suggest: stop using udb_hash, its outdated and insecure. Try whirlpool.
Reply
#3

Gammix, could you help me?

Hit me up on Skype: e.r.r.y

I really need some help!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)