Jump to content

Login problem


1LoL1

Recommended Posts

Always when i login i see message Welcome Back! but when i login with new account i don't see message and i'am not spawned.. Can anyone help me please?

 

function lacc (_, acc)
    local account = getAccountName(acc)
    local result = dbQuery (database, "SELECT * FROM SERVER WHERE Account = ?", account)
    local poll, rows = dbPoll(result, -1)
    if rows == 1 then
		if getAccountData(acc, "NewUser") then
		spawnPlayer(source, x, y, z, 0, 0, 0, 0)
        outputChatBox("Welcome Back!")
		else
		spawnPlayer(source, x, y, z, 0, 0, 0, 0)
		setAccountData(acc, "NewUser", "NewUser")
      	outputChatBox("Welcome (NewUser)")
		end
    end
end
addEventHandler("onPlayerLogin", getRootElement(), lacc)

 

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