25.01.2018, 13:17
Code:
if(dialogid == dlogin) {//then if(!response) return Kick(playerid); if(response) {//then new hashpass[129]; WP_Hash(hashpass,sizeof(hashpass),inputtext); if(!strcmp(hashpass,pInfo[playerid][Pass])) {//then INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid); SetPlayerScore(playerid,pInfo[playerid][Score]); GivePlayerMoney(playerid,pInfo[playerid][Money]); SendClientMessage(playerid,-1,"{c3c3c3}(INFO) You have successfully logged in! You can start playing now."); } else {//then ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT,"Account","{FF0000}You have entered a wrong password! Please try again.","Login","Quit");//We will tell to them that they've entered an incorrect password return 1; } } } return 1; }
Code:
forward loadaccount_user(playerid, name[], value[]); public loadaccount_user(playerid, name[], value[]) { INI_String("Password", pInfo[playerid][Pass],129); INI_Int("Admin",pInfo[playerid][Admin]); INI_Int("Money",pInfo[playerid][Money]); INI_Int("Score",pInfo[playerid][Score]); INI_Int("Kills",pInfo[playerid][Kills]); INI_Int("Deaths",pInfo[playerid][Deaths]); return 1; }