Jump to content

help


Recommended Posts

function loginReguest(player,username,password)
	local account exports.mysql:_Query("SELECT 'users' WHERE username = " .. username)
		if (account) then
			local account = accounts[1] -- 
			local password == accounts["password"] then
		
			outputChatBox("Succesfully logged In!")
			spawnPlayer(player,accounts["posX"],accounts["posY"],accounts["posZ"],accounts["pRot"],accounts["pSkin"],accounts["pInt"],accounts["pDim"])

		else 
			outputChatBox("Username or Password is wrong!")
		end
	end
end
	
			triggerClientEvent(player,"showHide", getRootElement() )
end

addEvent("logIn",false)
addEventHandler("logIn",getRootElement(), loginReguest)

I try to figure out the mysql :) but i dont now i am on the right track ??

Link to comment

No, that's not how a SELECT statement looks and the rest of your code is terribly wrong as well. Like local password == accounts["password"]... What's that for? Shouldn't it be in an if statement? How do you define a variable? It's local variable = "value"...

local account = exports.mysql:_Query("SELECT * FROM `users` WHERE `username` = ? LIMIT 1", username)

 

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...