Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function registerPlayer(userName,password,passwordReEntry)
- if userName ~= nil and password ~= nil and passwordReEntry ~= nil then
- if (string.len(password) < 6) then
- outputChatBox("Your password should be at least 6 chars. long!",client,255,0,0)
- elseif (password ~= passwordReEntry) then
- outputChatBox("Your password and your re-enter arent the same!",client,255,0,0)
- elseif (string.len(userName) <= 0) then
- outputChatBox("Please insert an username!",client,255,0,0)
- elseif userName and password == passwordReEntry then
- local ipFromPlayerRegistered = getPlayerID(client)
- local serialFromPlayerRegistered = getPlayerSerial(client)
- executeSQLQuery("SELECT * FROM accounts WHERE accountname=?",userName)[1]
- executeSQLQuery("SELECT * FROM accounts WHERE accountpassword=?",password)[1]
- executeSQLQuery("SELECT * FROM accounts WHERE level=?",0)[1]
- executeSQLQuery("SELECT * FROM accounts WHERE ip=?",ipFromPlayerRegistered)[1]
- executeSQLQuery("SELECT * FROM accounts WHERE serial=?",serialFromPlayerRegistered)[1]
- outputChatBox("#FF0000Your account has been successfully created!#FFFFFF(User: "..tostring(userName)..", Password: "..tostring(password)..")",client,255,0,0,true)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement