27.01.2013, 01:17
Having a problem with my login/registration system! When I register it saves the password to the player's file and everything..
but when you go to login on that account, if you put in any password like '123', it will still let you login.
Anyone can login to any ones accounts.
but when you go to login on that account, if you put in any password like '123', it will still let you login.
Anyone can login to any ones accounts.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2)
{
if(!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,2,3,"Registration","Type in a password to register","Register","Leave");
return 1;
}
new INI:file = INI_Open(Path(playerid));
INI_SetTag(file,"Player's Stats");
INI_WriteString(file,"Password",(inputtext));
INI_WriteInt(file,"Admin",0);
INI_WriteInt(file,"Cash",25);
INI_Close(file);
return 1;
}
}
if(dialogid == 1)
{
if(!response) return Kick(playerid);
if(response)
{
if(strcmp(inputtext,pInfo[playerid][Pass])) // Here
{
INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);
GivePlayerMoney(playerid,pInfo[playerid][Cash]);
}
else
{
ShowPlayerDialog(playerid,1,3,"Login","Type in your password to login\nIncorrect password!","Login","Leave");
return 1;
}
}
}
return 1;
}