Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function serverLogin(thePlayer, textUsername, textPassword)
- textUsername = mysql_escape_string(theHandler, textUsername)
- local theQuery1 = mysql_query(theHandler, "SELECT Username FROM accounts WHERE Username = '"..textUsername.."'")
- if (mysql_num_rows(theQuery1) == 0) then
- local theQuery = mysql_query(theHandler, "SELECT Username FROM accounts WHERE Username = '"..textUsername.."' AND Password = '"..textPassword.."'")
- if (mysql_num_rows(theQuery) == 1) then
- outputChatBox("#FF8C00* #FFFFFFYou have succesfully logged in.", thePlayer, 255, 255, 255, true)
- local theQuery = mysql_query(theHandler, "SELECT * FROM Accounts WHERE Username='"..playerUsername.."'")
- local theRow = mysql_fetch_row(theQuery)
- setElementData(thePlayer, "playerAdmin", theRow[4])
- setElementData(thePlayer, "playerMoney", theRow[5])
- outputChatBox("money: "..theRow[5]..", admin: "..theRow[4]..".")
- else
- outputChatBox("#FF8C00* #FFFFFFIncorrect Password.", thePlayer, 255, 255, 255, true)
- end
- else
- outputChatBox("#FF8C00* #FFFFFFThe account does not exist.", thePlayer, 255, 255, 255, true)
- end
- end
Add Comment
Please, Sign In to add comment