Any ideea why?
#1

Do you have any ideea why this doesn't work? Considering other dialogs from my register part works just as fine.

The problem is:
Email just doesn't seems to register any data from inputtext, why ... I can't understand.
Dialog id: 6


Here is the code
Код:
	if(dialogid == DIALOG_EMAIL)
	{
	   if(response)
	   {
		  if(strlen(inputtext) >= 80 || strlen(inputtext) < 1)
		  {
			  SendClientMessage(playerid, COLOR_RED, "ERROR: Email is too long, or too short.");
			  return ShowEmailDialog(playerid);
		  }
		  strmid(InfoAccount[playerid][Email], inputtext, 0, 1000);
		  SendClientMessage(playerid, COLOR_YELLOW, "Thanks, if there is any need, we will contact you through this email.");
		  ShowSecurityDialog(playerid);
	   }
	   else
	   {
		  SelectTextDraw(playerid, COLOR_ORANGE);
	   }
	}
It just won't work:

Here is the function

Код:
stock ShowEmailDialog(playerid)
{
	new str[1024*2];
	new string[32]; format(string, sizeof(string), "HELLO "COL_RED"%s"COL_WHITE"\n", GetUserName(playerid));
	strcat(str, string);
	strcat(str, "Please write your email down below.");
	strcat(str, "It will help contact you if we need to do so.\n");
	format(string, sizeof(string), "Your email: %s \n", InfoAccount[playerid][Email]);
	strcat(str, string);
	return ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "Email", str, "Next", "Cancel");
}
And here is how I called it.
Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == CT_6)
    {
	   CancelSelectTextDraw(playerid);
	   ShowEmailDialog(playerid);
    }
    return 1;
}
This maybe will give you a piece of information about why it doesn't work... I just can't seem, to understand. The country,city etc.. dialog works under the same thing and they work, maybe it is because of the OnPlayerClickTextdraw?
Reply
#2

Try this

Код:
strmid(InfoAccount[playerid][Email], inputtext, 0, 1000, 80);
Change the last parameter to size of Email - InfoAccount is two-dimensional array, so you have to change it manually. But I recommend use strcat function for this

Код:
InfoAccount[playerid][Email][0] = EOS;
strcat(InfoAccount[playerid][Email], inputtext, 80);
Reply
#3

Thank you so much . I don't know why I didn't thought of this
+Respect .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)