Guest User

Untitled

a guest
Jun 1st, 2018
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. function serverLogin(thePlayer, textUsername, textPassword)
  2.  
  3. textUsername = mysql_escape_string(theHandler, textUsername)
  4. local theQuery1 = mysql_query(theHandler, "SELECT Username FROM accounts WHERE Username = '"..textUsername.."'")
  5.  
  6. if (mysql_num_rows(theQuery1) == 0) then
  7.  
  8. local theQuery = mysql_query(theHandler, "SELECT Username FROM accounts WHERE Username = '"..textUsername.."' AND Password = '"..textPassword.."'")
  9.  
  10. if (mysql_num_rows(theQuery) == 1) then
  11.  
  12. outputChatBox("#FF8C00* #FFFFFFYou have succesfully logged in.", thePlayer, 255, 255, 255, true)
  13.  
  14. local theQuery = mysql_query(theHandler, "SELECT * FROM Accounts WHERE Username='"..playerUsername.."'")
  15.  
  16. local theRow = mysql_fetch_row(theQuery)
  17.  
  18. setElementData(thePlayer, "playerAdmin", theRow[4])
  19. setElementData(thePlayer, "playerMoney", theRow[5])
  20.  
  21. outputChatBox("money: "..theRow[5]..", admin: "..theRow[4]..".")
  22.  
  23. else
  24.  
  25. outputChatBox("#FF8C00* #FFFFFFIncorrect Password.", thePlayer, 255, 255, 255, true)
  26.  
  27. end
  28.  
  29. else
  30.  
  31. outputChatBox("#FF8C00* #FFFFFFThe account does not exist.", thePlayer, 255, 255, 255, true)
  32.  
  33. end
  34.  
  35. end
Add Comment
Please, Sign In to add comment