Guest User

Untitled

a guest
Jun 4th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. function RegisterPlayer(playerSource, commandName, _password)
  2.   local name = exports["MySQL"]:mysqlEscapeString(getPlayerName(playerSource))
  3.   local password = exports["MySQL"]:mysqlEscapeString(_password)
  4.   local query = "INSERT INTO accounts SET username='" .. name .. "', password=MD5('" .. password .. "')"
  5.  
  6.   if (exports["MySQL"]:mysqlQuery(query)) then
  7.     outputChatBox("Account created successfuly.", playerSource)
  8.   else
  9.     outputChatBox("An error has occured when trying to create your account.", playerSource)
  10.   end
  11. end
  12.  
  13. addCommandHandler("register", RegisterPlayer)
Add Comment
Please, Sign In to add comment