Y_INI - Extra characters issue
#1

Hey peeps,
I have been using y_ini to create a registartion system which features Email label.
So as far as i got, y_ini doesn't support extra characters such as "@" "."
May anyone provide help here ?
[ info ] The Email label in the ini file stays empty when using extra characters.
Peace yo !
Reply
#2

Try to use this.
Quote:

if(strfind(inputtext,"@",true) != -1)

Reply
#3

In the dialog input condition ?
I guess you didn't quiet understand my question; Y_INI can't save extra characters such as "@" and "."
Can anyone explain please
Код:
                INI_WriteString(File,"Email",inputtext);
INI file after writing "exemple@email.com" in the input text :
Код:
Email =
Peace yo !
Reply
#4

Quote:

if(dialogid == DialogID)
{
if(response == 1)
{
if(strfind(inputtext,"@",true) != -1)
{
if(strfind(inputtext,".",true) != -1)
{
new string3[64];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "%s.ini", playername3);
strmid(PlayerInfo[playerid][pPlayerEmail], inputtext, 0, 32, 32);
dini_Set(string3, "PlayerEmail",PlayerInfo[playerid][pPlayerEmail]);
SaveMail(playerid, inputtext);
return 1;
}

Quote:

forward SaveMail(playerid, Email[]);

Quote:

public SaveMailing(playerid, Email[])
{
new Texte[128];
format(Texte, sizeof(Texte), "%s\r\n", Email);
new File: file2 = fopen("mail.ini", io_append);
fwrite(file2, Texte);
fclose(file2);
return 1;
}

This help you to save all e-mails.
Reply
#5

Thanks for the precise answer, but why all this while you can just do :
Код:
       if((strfind(inputtext,"@",true) !=-1) && (strfind(inputtext,".",true) !=-1) && !(strlen(inputtext) < 10))
            	{
		new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"mailtag");
                INI_WriteString(File,"Email",inputtext);
                //
                INI_Close(File);
	}
If you understand well, i meant why y_INI doesn't accept special characters such as "@" and "." nad it can't register them in the INI file.
Not how to make an Email system.
Reply
#6

No one can answer this ?
Should i use d_ini instead?
Reply
#7

After searching around the forum, i found a reply in Y_ini main thread....
Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
I guess you must encode the player when reading/loading because Y_Ini, i think, doesn't support characters like /=-0()%^* etc.

Like Name$ gives Name_5 (Which is readable and good for reading, without any problems)
Am more then disappointed how could a minor issue not be fixed so switching to d_ini is my best bet.

Mod you may lock.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)