EMAIL ADDRES
#1

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;
}
Reply
#2

SSCANF comes in handy..

PHP код:
sscanf(variable"p<@>s[64]s[256]"localPartdomain);
sscanf(domain"p<.>s[256]s[9]"domainextension); 
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.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)