VALUE = VALUE on dialog - 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: VALUE = VALUE on dialog (
/showthread.php?tid=658135)
VALUE = VALUE on dialog -
Nin9r - 24.08.2018
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?
Re: VALUE = VALUE on dialog -
DarkSkull - 24.08.2018
Use strcmp():
https://sampwiki.blast.hk/wiki/Strcmp
Re: VALUE = VALUE on dialog -
Shinja - 24.08.2018
PlayerData[playerid][pMailKey] is a string or number?
Re: VALUE = VALUE on dialog -
Nin9r - 24.08.2018
It is a number! I forgot to say it.
Re: VALUE = VALUE on dialog -
Nin9r - 24.08.2018
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 !