Guest User

Untitled

a guest
Jun 3rd, 2018
129
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.  exports["MySQL"]:mysqlEscapeString(getPlayerName(playerSource))
  3.  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 with id #" .. mysql_insert_id(handler), 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