Email array problem
#1

Code basicly doesn't work and I can input address like "myemail@." and it would work.

I want this code to check:

- @ (working)
- . (working)
- com,net,org... (not working)

Код:
case REGISTER_EMAIL_DIALOG:
	    {
	        if(!response)
	        {
	            SendClientMessage(playerid,-1,"{0080FF}WG:{FFFFFF} Automatski ste kikani sa servera zbog odbijanja registracije.");
	            odbioRegister[playerid] = 1;
	            SetTimerEx("kickPlayer", 1000, false, "%i", playerid);
	        }
	        else
	        {
	            new monkeyString = strfind(inputtext,"@",true);
	            new tockaString = strfind(inputtext,".",true);
	            new endListStrings[15][] =
				{
					"com",
					"net",
					"me",
					"us",
					"eu",
					"se",
					"dk",
					"org",
					"de",
					"au",
					"vg",
					"hu",
					"it",
					"uk",
					"co"
				};
			  	
	            if(!strlen(inputtext)) return SendClientMessage(playerid,-1,"{FF0000}Greska: {FFFFFF}Pogresan unos. Molimo pokusajte ponovno.") && ShowPlayerDialog(playerid,REGISTER_EMAIL_DIALOG,DIALOG_STYLE_INPUT,"{0049FF}Registracija","{FFFFFF}Molimo unesite vasu email adresu.", "Unesi", "Izlaz");
	            if(strlen(inputtext) < 12 || strlen(inputtext) > 30) return SendClientMessage(playerid,-1,"{FF0000}Greska: {FFFFFF}Neispravna email adresa. Pokusajte ponovno.") && ShowPlayerDialog(playerid,REGISTER_EMAIL_DIALOG,DIALOG_STYLE_INPUT,"{0049FF}Registracija","{FFFFFF}Molimo unesite vasu email adresu.", "Unesi", "Izlaz");
				if(monkeyString == -1) return SendClientMessage(playerid,-1,"{FF0000}Greska: {FFFFFF}Neispravna email adresa. Pokusajte ponovno.") && ShowPlayerDialog(playerid,REGISTER_EMAIL_DIALOG,DIALOG_STYLE_INPUT,"{0049FF}Registracija","{FFFFFF}Molimo unesite vasu email adresu.", "Unesi", "Izlaz");
				if(tockaString == -1) return SendClientMessage(playerid,-1,"{FF0000}Greska: {FFFFFF}Neispravna email adresa. Pokusajte ponovno.") && ShowPlayerDialog(playerid,REGISTER_EMAIL_DIALOG,DIALOG_STYLE_INPUT,"{0049FF}Registracija","{FFFFFF}Molimo unesite vasu email adresu.", "Unesi", "Izlaz");
				//
				for(new index = 0; index < 14; ++index)
				{
					if(strfind(inputtext,endListStrings[index][0],false))
	    			{
	    				strcat(PlayerInfo[playerid][email],inputtext,30);
	    				format(poruka,sizeof(poruka),"{0049FF}WG:{FFFFFF} Email adresa unesena. Ona glasi: %s. Molimo nastavite dalje...",PlayerInfo[playerid][email]);
	 					SendClientMessage(playerid,-1,poruka);
	    				//
	    				ShowPlayerDialog(playerid,REGISTER_PASSWORD_DIALOG,DIALOG_STYLE_PASSWORD, "{0080FF}Registracija", "{FFFFFF}Molimo unesite vasu lozinku kako biste dovrsili registraciju.", "Unesi", "Izlaz");
					}
					else
					{
					    if(index == 14)
						{
						    SendClientMessage(playerid,-1,"{FF0000}Greska: {FFFFFF}Pogresan unos. Molimo pokusajte ponovno.") && ShowPlayerDialog(playerid,REGISTER_EMAIL_DIALOG,DIALOG_STYLE_INPUT,"{0049FF}Registracija","{FFFFFF}Molimo unesite vasu email adresu.", "Unesi", "Izlaz");
						}
						else
						{
							printf("Nije pronadeno. Brojac: %d",index);
							continue;
						}
					}
				}
			}
	    }
The problem is in array and I probably did the stupid mistake which i couldn't find so i'm posting this...
Any help would be appreciated
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)