Jump to content

Error


BiSolpos

Recommended Posts

Hello

I created a login page and I want to filter some words, but even when the filtered words are not in the edit box, server say 'Username is incorrect'.

 

AllowedChars = {
	{"a"},{"b"},{"c"},{"d"},{"e"},{"f"},{"g"},{"h"},{"i"},{"j"},{"k"},{"l"},
	{"m"},{"n"},{"o"},{"p"},{"q"},{"r"},{"s"},{"t"},{"u"},{"v"},{"w"},{"x"},
	{"y"},{"z"},{"1"},{"2"},{"3"},{"4"},{"5"},{"6"},{"7"},{"8"},{"9"},{"0"},
	{"@"},{"("},{")"},{"-"},{"_"},{"."},{"|"},
}

function getCharacter(character)
	for I, V in ipairs(AllowedChars) do
		if string.lower(V[1]) == string.lower(character) then
			for i, ebox in ipairs(editbox) do
				if eboxClickI == i then
					table.insert(text[i], character)
				end
			end
			return
		end
	end
end
addEventHandler("onClientCharacter", getRootElement(), getCharacter)

function pressLogin()
	for i, ebox in ipairs(editbox) do
		if ebox.name == "Username" then
			UserValue = ebox.text
		elseif ebox.name == "Password" then
			PassValue = ebox.text
		end
	end
	
	if (string.find(UserValue,'@')) or (string.find(UserValue,'.')) or (string.find(UserValue,'|')) or (string.find(UserValue,'_')) then
		outputChatBox("Username is incorrect", source, 255, 255, 255)
	else
		triggerServerEvent ("Login", getLocalPlayer(), getLocalPlayer(), UserValue, PassValue)
	end
end





 

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...