SA-MP Forums Archive
Help save email - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help save email (/showthread.php?tid=543191)



Fixed. - Edw - 25.10.2014

Fixed.


Re: Help save email - M4D - 25.10.2014

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;
}



Fixed. - Edw - 25.10.2014

Fixed.


Fixed. - Edw - 25.10.2014

Fixed.


Re: Help save email - Metroplex - 25.10.2014

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


Re: Help save email - Quickie - 25.10.2014

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]);



Fixed. - Edw - 25.10.2014

Fixed.


Re: Help save email - M4D - 25.10.2014

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 !


Re: Help save email - Mic_H - 25.10.2014

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", "");



Fixed. - Edw - 25.10.2014

Fixed.