27.11.2013, 13:51
I am having problems with my log-in screen at the moment. When I press cancel I have to be kicked but somehow I can continue to the class selection.
Code from dialogresponse:
If somebody could help me I'd be happy. Thanks already.
Code from dialogresponse:
Код:
if(response) { switch(dialogid) { case DIALOG_REGISTER: { if(!response) return Kick(playerid); if(response) { if(!strlen(inputtext)) { ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "{00FFFF}Register", "{FFFFFF}Please enter your password to register.\n{FF0000}You can't leave this empty.", "OK", "Cancel"); return 1; } new hashpass[128]; new INI:file = INI_Open(Path(playerid)); INI_WriteString(file,"Password",hashpass); INI_WriteInt(file,"Money",0); INI_WriteInt(file,"Score",0); INI_WriteInt(file,"Deaths",0); INI_WriteInt(file,"Admin",0); INI_Close(file); return 1; } } case DIALOG_LOGIN: { if(!response) return Kick(playerid); if(response) { new hashpass[129]; if(!strcmp(hashpass, pStats[playerid][password], false)) { INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid); } else { SendClientMessage(playerid, COLOR_ACMDSCOMDIR, "You have to log-in in order to play."); Kick(playerid); } return 0; } } } } return 1; }