09.02.2018, 19:31
Hey, why when i type something in a dialog and i exit the game and reconnect to server the text that i typed in the dialog it's remaining.
And i have a problem that i can put any text i want without @, but i added
And i have a problem that i can put any text i want without @, but i added
Код:
strfind(inputtext, "@", false, 0)
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch(dialogid) { ....... case DIALOG_EMAIL: { if(!response) { new EmailQuerry[255]; mysql_format(Database, EmailQuerry, sizeof(EmailQuerry), "UPDATE `USERS` SET `Email` = 'NoEmail' WHERE `USERNAME`='%s'", pInfo[playerid][pName]); mysql_query(Database, EmailQuerry); } if(response) { if(!strlen(inputtext)) { if(pInfo[playerid][pLanguage] == 1) return ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "Email", "Introdu un email valid.\n\nIntrodu in casuta de mai jos un email de recuperare.", "Ok", "Close"); if(pInfo[playerid][pLanguage] == 2) return ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "Email", "Type an valid email.\n\nType in the dialog box an recovery email", "Ok", "Close"); } if(strfind(inputtext, "@", false, 0)) { if(pInfo[playerid][pLanguage] == 1) { new EmailQuerry[255]; mysql_format(Database, EmailQuerry, sizeof(EmailQuerry), "UPDATE `USERS` SET `Email` = '%s' WHERE `USERNAME`='%s'", inputtext, pInfo[playerid][pName]); mysql_query(Database, EmailQuerry); SCM(playerid, COLOR_YELLOW, "Email salvat."); } else { new EmailQuerry[255]; mysql_format(Database, EmailQuerry, sizeof(EmailQuerry), "UPDATE `USERS` SET `Email` = '%s' WHERE `USERNAME`='%s'", inputtext, pInfo[playerid][pName]); mysql_query(Database, EmailQuerry); SCM(playerid, COLOR_YELLOW, "Email saved."); } } else { if(pInfo[playerid][pLanguage] == 1) return ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "Email", "Introdu un email valid.\n\nIntrodu in casuta de mai jos un email de recuperare.", "Ok", "Close"); if(pInfo[playerid][pLanguage] == 2) return ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "Email", "Type an valid email.\n\nType in the dialog box an recovery email", "Ok", "Close"); } SendToTutorial(playerid); } } /////////////////////////////////////////////////////////////////////////////////////////////////// } return 0; }