Not give message for error
#1

Код:
	case DIALOG_EMAIL:
	{
	if(!response) return Kick(playerid);
	if(response)
	{
	if(strlen(inputtext))
	{
	if(strfind(inputtext,"@",true) != -1)
	{
	        new emailp = strfind(inputtext, "@", true);
            if(emailp == -1)
	        {
	            SendClientMessage(playerid, 0xFFFFFFFF, ""COL_RED"[GRESKA]: "COL_WHITE"Unijeli ste "COL_RED"NEPRAVILNU "COL_WHITE"email adresu! Unesite vasu "COL_RED"TOCNU "COL_WHITE"email adresu kako biste "COL_CYAN"ZASTITILI"COL_WHITE" svoj profil.");
			    ShowPlayerDialog(playerid, DIALOG_EMAIL, -1, ""COL_ORANGE"EMAIL", ""COL_WHITE"Unesite ponovno vasu email adresu\n\n\n"COL_ORANGE"Unesite "COL_RED"TOCNU "COL_WHITE" vasu email adresu!", "Dalje", "Odustani");
				return 1;
			}
			new emailp2 = strfind(inputtext, ".", true);
			if(emailp2 == -1)
	        {
                SendClientMessage(playerid, 0xFFFFFFFF, ""COL_RED"[GRESKA]: "COL_WHITE"Unijeli ste "COL_RED"NEPRAVILNU "COL_WHITE"email adresu! Unesite vasu "COL_RED"TOCNU "COL_WHITE"email adresu kako biste "COL_CYAN"ZASTITILI"COL_WHITE" svoj profil.");
			    ShowPlayerDialog(playerid, DIALOG_EMAIL, -1, ""COL_ORANGE"EMAIL", ""COL_WHITE"Unesite ponovno vasu  email adresu\n\n\n"COL_ORANGE"Unesite "COL_RED"TOCNU "COL_WHITE"vasu email adresu!", "Dalje", "Odustani");
			}
			new string[128];
			new INI:File = INI_Open(UserPath(playerid));
            INI_SetTag(File,"data");
            INI_WriteString(File, "Email", inputtext);
			format(string, sizeof(string), "%s", inputtext);
			format(PlayerInfo[playerid][pEmail],128,"%s",inputtext);
			INI_Close(File);
			format(string,sizeof(string),""COL_ORANGE"SERVER "COL_WHITE"Email adresa koju ste unijeli "COL_CYAN"%s"COL_WHITE".",inputtext);
			SCM(playerid,-1,string);
			ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT,""COL_ORANGE"GODINE","Koliko imate godina?","Dalje","");
	}
	else
	{
    ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, ""COL_ORANGE"EMAIL",""COL_WHITE"Unesite vasu EMAIL adresu koja ce biti postavljena za vas profil.\n"COL_WHITE"Unesite vasu "COL_RED"TOCNU "COL_WHITE"EMAIL adresu radi sigurnosti vaseg profila!!\n\n\n"COL_GREY"Vasu EMAIL adresu necemo prosljedivati niti iskoristavati.","OK","");
	}
	}
	}
    }
When enter wrong email type: sssssssssksk i dont got message for wrong email.

it giving errors if not type @ and .
Код:
	if(strfind(inputtext,"@",true) != -1)
	{
	        new emailp = strfind(inputtext, "@", true);
            if(emailp == -1)
	        {
	            SendClientMessage(playerid, 0xFFFFFFFF, ""COL_RED"[GRESKA]: "COL_WHITE"Unijeli ste "COL_RED"NEPRAVILNU "COL_WHITE"email adresu! Unesite vasu "COL_RED"TOCNU "COL_WHITE"email adresu kako biste "COL_CYAN"ZASTITILI"COL_WHITE" svoj profil.");
			    ShowPlayerDialog(playerid, DIALOG_EMAIL, -1, ""COL_ORANGE"EMAIL", ""COL_WHITE"Unesite ponovno vasu email adresu\n\n\n"COL_ORANGE"Unesite "COL_RED"TOCNU "COL_WHITE" vasu email adresu!", "Dalje", "Odustani");
				return 1;
			}
			new emailp2 = strfind(inputtext, ".", true);
			if(emailp2 == -1)
	        {
                SendClientMessage(playerid, 0xFFFFFFFF, ""COL_RED"[GRESKA]: "COL_WHITE"Unijeli ste "COL_RED"NEPRAVILNU "COL_WHITE"email adresu! Unesite vasu "COL_RED"TOCNU "COL_WHITE"email adresu kako biste "COL_CYAN"ZASTITILI"COL_WHITE" svoj profil.");
			    ShowPlayerDialog(playerid, DIALOG_EMAIL, -1, ""COL_ORANGE"EMAIL", ""COL_WHITE"Unesite ponovno vasu  email adresu\n\n\n"COL_ORANGE"Unesite "COL_RED"TOCNU "COL_WHITE"vasu email adresu!", "Dalje", "Odustani");
			}
and how To do that it can not leave an empty email address.
Reply
#2

Change
pawn Код:
if(strfind(inputtext,"@",true) != -1)
to
pawn Код:
if(strfind(inputtext,"@",true) ==0)
And to check if the string is null use isnull. If you're not using ZCMD, - you'll have to include it yourself,
pawn Код:
#if !defined isnull
    #define isnull(%1) \
                ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif
Reply
#3

Quote:
Originally Posted by Abagail
Посмотреть сообщение
Change
pawn Код:
if(strfind(inputtext,"@",true) != -1)
to
pawn Код:
if(strfind(inputtext,"@",true) ==0)
And to check if the string is null use isnull. If you're not using ZCMD, - you'll have to include it yourself,
pawn Код:
#if !defined isnull
    #define isnull(%1) \
                ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif
i use zcmd
Reply
#4

Then you don't need to include that last part as isnull is already defined. Just use "isnull" to check if the string is null or not. Example,

pawn Код:
new string[24];
if(isnull(string)) return print("this string is null");
This would print the message as no data has been assigned to the string yet, - thus rendering it a null string.
Reply
#5

Quote:
Originally Posted by Abagail
Посмотреть сообщение
Then you don't need to include that last part as isnull is already defined. Just use "isnull" to check if the string is null or not. Example,

pawn Код:
new string[24];
if(isnull(string)) return print("this string is null");
This would print the message as no data has been assigned to the string yet, - thus rendering it a null string.
Код:
	case DIALOG_EMAIL:
	{
	if(!response) return Kick(playerid);
	if(response)
	{
	if(strlen(inputtext))
	{
	if(strfind(inputtext,"@",true) != -1)
	{
	        new emailp = strfind(inputtext, "@", true);
            if(emailp == -1)
	        {
	            SendClientMessage(playerid, 0xFFFFFFFF, ""COL_RED"[GRESKA]: "COL_WHITE"Unijeli ste "COL_RED"NEPRAVILNU "COL_WHITE"email adresu! Unesite vasu "COL_RED"TOCNU "COL_WHITE"email adresu kako biste "COL_CYAN"ZASTITILI"COL_WHITE" svoj profil.");
			    ShowPlayerDialog(playerid, DIALOG_EMAIL, -1, ""COL_ORANGE"EMAIL", ""COL_WHITE"Unesite ponovno vasu email adresu\n\n\n"COL_ORANGE"Unesite "COL_RED"TOCNU "COL_WHITE" vasu email adresu!", "Dalje", "Odustani");
				return 1;
			}
			new emailp2 = strfind(inputtext, ".", true);
			if(emailp2 == -1)
	        {
                SendClientMessage(playerid, 0xFFFFFFFF, ""COL_RED"[GRESKA]: "COL_WHITE"Unijeli ste "COL_RED"NEPRAVILNU "COL_WHITE"email adresu! Unesite vasu "COL_RED"TOCNU "COL_WHITE"email adresu kako biste "COL_CYAN"ZASTITILI"COL_WHITE" svoj profil.");
			    ShowPlayerDialog(playerid, DIALOG_EMAIL, -1, ""COL_ORANGE"EMAIL", ""COL_WHITE"Unesite ponovno vasu  email adresu\n\n\n"COL_ORANGE"Unesite "COL_RED"TOCNU "COL_WHITE"vasu email adresu!", "Dalje", "Odustani");
			}
			new string[128];
			new INI:File = INI_Open(UserPath(playerid));
            INI_SetTag(File,"data");
            INI_WriteString(File, "Email", inputtext);
			format(string, sizeof(string), "%s", inputtext);
			format(PlayerInfo[playerid][pEmail],128,"%s",inputtext);
			INI_Close(File);
			format(string,sizeof(string),""COL_ORANGE"SERVER "COL_WHITE"Email adresa koju ste unijeli "COL_CYAN"%s"COL_WHITE".",inputtext);
			SCM(playerid,-1,string);
			ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT,""COL_ORANGE"GODINE","Koliko imate godina?","Dalje","");
	}
	else
	{
    ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, ""COL_ORANGE"EMAIL",""COL_WHITE"Unesite vasu EMAIL adresu koja ce biti postavljena za vas profil.\n"COL_WHITE"Unesite vasu "COL_RED"TOCNU "COL_WHITE"EMAIL adresu radi sigurnosti vaseg profila!!\n\n\n"COL_GREY"Vasu EMAIL adresu necemo prosljedivati niti iskoristavati.","OK","");
	}
	}
	}
    }
can you we have to do it for me , I'm confused. :/

will fix it as you do not get the message because I entered an incorrect password?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)