Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local db = dbConnect("sqlite", ":db_royal/users.db")
- local newTable = dbExec(db, "CREATE TABLE IF NOT EXISTS Royal-users (id INT, nome TEXT, login TEXT, pass TEXT, serial TEXT)")
- function registerPlayer(user, pass, conf)
- if user == "" then
- outputLoginMsg(source, "Preencha todos os campos!", "error")
- else
- if pass == "" then
- outputLoginMsg(source, "Preencha todos os campos!", "error")
- else
- if conf == "" then
- outputLoginMsg(source, "Preencha todos os campos!", "error")
- else
- if conf == pass then
- addAccount(tostring(user),tostring(pass))
- triggerClientEvent(source, "onRoyalRegister", source)
- local serial = getPlayerSerial(source)
- local query = dbPoll(dbQuery(db, "SELECT * FROM Royal-users WHERE serial=?", serial),-1)
- if #query == 0 then
- dbExec(db, "INSERT INTO Royal-users VALUES (?,?,?,?)", --[[## AQUI QUE É A PARTE DO ID]], getPlayerName(source), tostring(user), tostring(pass), serial)
- end
- outputLoginMsg(source, "Conta criada com sucesso! Aguarde...", "success")
- if not getAccount(user, pass) then
- outputLoginMsg(source, "Esta conta já está sendo utilizada!", "error")
- end
- else
- outputLoginMsg(source, "As senhas não estão iguais.", "error")
- end
- end
- end
- end
- end
- addEvent("onPlayerRequestRegister",true)
- addEventHandler("onPlayerRequestRegister", root, registerPlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement