Dialog and inputtext
#3

Quote:
Originally Posted by Lunoxel
Посмотреть сообщение
You must use the strval and IsNumeric.
Код:
if(dialogid == DIALOG_ACTIVATION)
{
	if(!response) return Kick(playerid);
	if(!IsNumeric(inputtext)) return SendClientMessage(playerid, -1, "In this dialog you can only use numbers."); // Else, another message
	if(response)
	{
		if(strval(inputtext) == 1)
		{
			PlayerInfo[playerid][pActivated] = 1;
		}
		else
		{
			ShowPlayerDialog(playerid, DIALOG_ACTIVATION, DIALOG_STYLE_INPUT, "Oops! Something went wrong.", "You have entered an incorrect code. Please Try again.", "Activate", "Quit");
		}
	}
}
IsNumeric:
Код:
IsNumeric(const string[])
{
	for (new i = 0, j = strlen(string); i < j; i++)
	{
		if (string[i] > '9' || string[i] < '0') return 0;
	}
    return 1;
}
That didn't really work at all, now it doesn't matter what number I enter it will still activate the account even if I just make up any random number and enter it in the dialog.
Reply


Messages In This Thread
Dialog and inputtext - by freddiebox - 19.08.2015, 22:06
Re: Dialog and inputtext - by Lunoxel - 19.08.2015, 22:19
Re: Dialog and inputtext - by freddiebox - 19.08.2015, 22:28
Re: Dialog and inputtext - by Lunoxel - 19.08.2015, 22:33
Re: Dialog and inputtext - by freddiebox - 20.08.2015, 12:08
Re: Dialog and inputtext - by Virtual1ty - 20.08.2015, 13:07
Re: Dialog and inputtext - by freddiebox - 20.08.2015, 22:18
Re: Dialog and inputtext - by Jefff - 20.08.2015, 22:22
Re: Dialog and inputtext - by freddiebox - 20.08.2015, 23:22
Re: Dialog and inputtext - by freddiebox - 21.08.2015, 13:45

Forum Jump:


Users browsing this thread: 1 Guest(s)