VALUE = VALUE on dialog
#1

Hello!

I`m trying to make a system to validate an e-mail.

I did /setmail, when someone will enter an e-mail adress will receive on it a validation key.

After it, he must insert validation key from e-mail but i do not know how to check if the inputtext value is the same with validation key.

I did it:
Код HTML:
case 589:
			{
			    
				if(response && strlen(inputtext)<10)
				{
				    new da = strlen(inputtext);
				    if(PlayerData[playerid][pMailKey] == da)
				    {
				    	new Str[256],pname2[25];
				    	GetPlayerName(playerid,pname2,25);
						format(string128, sizeof(string128), "You e-mail adress was validated: %s", PlayerData[playerid][pEmail]);
						SCM(playerid, COLOR_GRAD4, string128);
						PlayerData[playerid][pMailValid] = 1;
						format(Str,256,"UPDATE `playeraccounts` SET `MailKey`='0' WHERE `playerID`='%d'",PlayerData[playerid][pInternalID]);
				    	mysql_tquery(handle,Str);
						format(Str,256,"UPDATE `playeraccounts` SET `playerMailValid`='%d' WHERE `playerID`='%d'",PlayerData[playerid][pMailValid],PlayerData[playerid][pInternalID]);
				    	mysql_tquery(handle,Str);
					}
					return 1;
				}
			}
I use
Код HTML:
 new da = strlen(inputtext);
				    if(PlayerData[playerid][pMailKey] == da)
to check if the value is the same but even if I insert the right value it is doesn't work.

P.S.: In the last dialog when the e-mail is sent PlayerData[playerid][pMailKey] gets that value.

How can I do this?
Reply
#2

Use strcmp():
https://sampwiki.blast.hk/wiki/Strcmp
Reply
#3

PlayerData[playerid][pMailKey] is a string or number?
Reply
#4

It is a number! I forgot to say it.
Reply
#5

I solved this problem.

I changed new da = strlen(inputtext); into new da = strval(inputtext); and i used if(Player....[pMailKey] == da) . Thanks a lot !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)