11.10.2014, 18:15
Hello.
I have problem with my register and login system. It doesn't save passwords.
Login Dialog:
Register Dialog:
I have problem with my register and login system. It doesn't save passwords.
Login Dialog:
Код:
case DIALOG_LOGIN: { if ( !response ) return Kick ( playerid ); if( response ) { if(udb_hash(inputtext) == PlayerInfo[playerid][pPass]) { INI_ParseFile(UserPath(playerid), "LoadUser_data", .bExtra = true, .extra = playerid); GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]); ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_LGREEN"Success",""COL_LGREEN"You have successfully logged in!","Ok",""); } else { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_GREY"Login",""COL_GREY"You have entered an incorrect {FF6347}password{B4B5B7}.\n"COL_GREY"Type your password below to login.","Login","Quit"); } SendClientMessage(playerid, lightgreen, "[{B4B5B7}System{9ACD32}]: {B4B5B7}You have successfully register this account ."); return 1;
Код:
case DIALOG_REGISTER: { if (!response) return Kick(playerid); if(response) { if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_GREY"Registering...",""COL_GREY"You have entered an invalid {FF6347}password{B4B5B7}.\n"COL_GREY"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,"Admin",0); INI_WriteInt(File,"VIP",0); INI_WriteInt(File,"Wanted",0); INI_WriteInt(File,"Kills",0); INI_WriteInt(File,"Deaths",0); INI_WriteInt(File,"Jailed",0); INI_WriteInt(File,"Muted",0); INI_WriteInt(File,"Cash",0); INI_WriteInt(File,"Score",0); INI_WriteInt(File,"Banned",0); INI_Close(File); SendClientMessage(playerid, lightgreen, "[{B4B5B7}System{9ACD32}]: {B4B5B7}You have successfully register this account .");