Only digits.
#1

Hey, guys. I'm searching in forum, but no result. I have registration with GUI. But i need to make, that password can be just digits, no letters. What is the code? Because after time i forget this.

Thanks.
Reply
#2

Do something with IsNumeric. Check if the password which that player gave contains number, and if not, return him to the password gui.
Код:
stock IsNumeric(const string[])
{
	for (new i = 0, j = strlen(string); i < j; i++)
	{
		if (string[i] > '9' || string[i] < '0') return 0;
	}
	return 1;
}
Reply
#3

Quote:
Originally Posted by Remi-X
Do something with IsNumeric. Check if the password which that player gave contains number, and if not, return him to the password gui.
Код:
stock IsNumeric(const string[])
{
	for (new i = 0, j = strlen(string); i < j; i++)
	{
		if (string[i] > '9' || string[i] < '0') return 0;
	}
	return 1;
}
Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)