Help save email
#1

Fixed.
Reply
#2

Hi
You Have To Open Player File And Write inputtext...
E.g. :
pawn Код:
if(dialogid == 6)
{
if(strlen(inputtext) < 5 || strlen(inputtext) > 60) return ShowPlayerDialog(playerid, 6, DIALOG_STYLE_INPUT,"Register:", "Error: Your Email length Should Be Between 5 To 60 characters. \nWrite your email address.\nExemplu: my_email@yahoo.com","OK", "");
new INI:File = INI_Open(/*Your User Path Here To Open*/);
INI_SetTag(File,"data");
INI_WriteString(File,"Email",inputtext);
INI_Close(File);
return 1;
}
Reply
#3

Fixed.
Reply
#4

Fixed.
Reply
#5

Did you really put the value of inputtext to the enum of yours?
Reply
#6

pawn Код:
if(strlen(inputtext) < 5 || strlen(inputtext) > 60) return ShowPlayerDialog(playerid, 6, DIALOG_STYLE_INPUT,"Register:", "Error: Your Email length Should Be Between 5 To 60 characters. \nWrite your email address.\nExemplu: my_email@yahoo.com","OK", "");
new INI:File = INI_Open(/*Your User Path Here To Open*/);
INI_SetTag(File,"data");
INI_WriteString(File,"Email",inputtext);
INI_Close(File);
On load user stats

pawn Код:
INI_String("Email",PlayerInfo[playerid][pEmail],sizeof(PlayerInfo[playerid][pEmail]);
Reply
#7

Fixed.
Reply
#8

You must specify the size of the string.
Like this:
pawn Код:
//Enum:
enum pInfo
{
    pEmail[60]
}
//Loading Data:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_String("Email",PlayerInfo[playerid][pEmail],60);
    return 1;
}
//OnplayerDisconnect:
INI_WriteString(File,"Email",PlayerInfo[playerid][pEmail]);
Compiler give this errors because you didn't specify the size of string in enum !
try and tell me worked or no !
Reply
#9

Use this to avoid people setting "asdasdasdsdads" as email :P
Код:
new First[30], Second[15], Third[4];
if(sscanf(inputtext, "p<@>s[30]P<.>s[15]s[4]",First, Second, Third))
    return ShowPlayerDialog(playerid, 6, DIALOG_STYLE_INPUT,"Register:", "Error: Your Email format seems to be wrong. \nWrite your email address.\nExemplu: my_email@yahoo.com","OK", "");
Reply
#10

Fixed.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)