Y_INI - Extra characters issue - 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: Y_INI - Extra characters issue (
/showthread.php?tid=520632)
Y_INI - Extra characters issue -
LowRyder - 19.06.2014
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 !
Re: Y_INI - Extra characters issue -
Clad - 19.06.2014
Try to use this.
Quote:
if(strfind(inputtext,"@",true) != -1)
|
Re: Y_INI - Extra characters issue -
LowRyder - 19.06.2014
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 :
Peace yo !
Re: Y_INI - Extra characters issue -
Clad - 19.06.2014
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.
Re: Y_INI - Extra characters issue -
LowRyder - 19.06.2014
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.
Re: Y_INI - Extra characters issue -
LowRyder - 20.06.2014
No one can answer this ?
Should i use d_ini instead?
Re: Y_INI - Extra characters issue -
LowRyder - 20.06.2014
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.