How to check if there's no symbols in a string?
#2

Okay I found a way, I did this:
Код:
CMD:changepassword(playerid, params[])
{
	if(sscanf(params,"s[128]",newPassword[playerid]))
	{
		SyntaxMSG(playerid, "/changepass [password]");
		SCM(playerid, -1, "{FF0000}[WARNING]:{FFFFFF} Do not use any {00FF00}symbols{FFFFFF} on your new password.");
		return 1;
	}
	for(new i = 0; i < strlen(newPassword[playerid]); i++)
	{
		switch(newPassword[playerid][i])
		{
			case '!', '@', '#', '$','%','^','&','*','(',')','_','+','=','|','[',']','{','}','-','.','`','~','<','>','?',',': return SCM(playerid, 0xFF0000FF, "Invalid characters!");
			default: continue;
		}
	}
	ShowDialog(playerid, Show:<ChangePass>, DIALOG_STYLE_INPUT, "Password changer", "Please enter your secret word that you've registered with!", "Change", "Exit");
	return 1;
}
Reply


Messages In This Thread
How to check if there's no symbols in a string? - by PaulDinam - 09.02.2013, 19:16
Re: How to check if there's no symbols in a string? - by PaulDinam - 09.02.2013, 19:29
Re: How to check if there's no symbols in a string? - by batonsa - 09.02.2013, 19:33

Forum Jump:


Users browsing this thread: 1 Guest(s)