EMAIL ADDRES - 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: EMAIL ADDRES (
/showthread.php?tid=641404)
EMAIL ADDRES -
BrnX - 15.09.2017
Hey guys, how can I check if the player entered an email? I want to restrict a field to emails so they can't type random things
Код:
DIALOG(EMAILCIMREPOST)
{
if(!response) Kick(playerid);
// E-MAIL CODE .....
SendClientMessage(playerid, -1, "(( sucessfuly!!))");
pInfo[playerid][pPlayerEmail] = strval(inputtext);
ShowLoginDialog(playerid,PHASE_PASSWORDBELEP);
return 1;
}
Re: EMAIL ADDRES -
Meller - 15.09.2017
SSCANF comes in handy..
PHP код:
sscanf(variable, "p<@>s[64]s[256]", localPart, domain);
sscanf(domain, "p<.>s[256]s[9]", domain, extension);
The local part of an email is limited to 64 chars, source:
https://en.wikipedia.org/wiki/Email_address#Local-part
The domain is limited to 256 chars, source:
https://en.wikipedia.org/wiki/Email_address#Domain
And the domain extension is limited to 9 chars, source:
******, lost the link.
Then try using PAWN REGEX to compare for available letters.