TAKKASHI Posted May 19, 2021 Share Posted May 19, 2021 (edited) Olá, estou a precisar de ajuda neste script. Eu não sei como resolver isto de alguem puder ajudar agradecia. Este é o erro: WARNING: [SCRIPTS]/san_accounts/Szerver.lua:84: dbPoll failed; Field 'admin' doesn't have a default value Código: function onRegisterClick(player, username, password2) --, email) if isTimer(timer2) then exports.san_infobox:addNotification(player,"Estamos com uma quantidade grande de pessoas tentando registrar ao mesmo tempo, tenha paciência","error") return end timer2 = setTimer(function() end, 3000, 1) local password = md5(password2) local registerQuery = dbPoll(dbQuery(connection, "SELECT * FROM accounts WHERE username LIKE '".. tostring(username) .."' or mtaserial = '".. getPlayerSerial(player) .."'"), -1) local accountAdded = addAccount(tostring(username),tostring(password2)) if ( accountAdded ) then outputChatBox ( "Obrigado por registrar " .. getPlayerName(player) .. "", player ) for _, row in ipairs(registerQuery) do if row["username"] == username then exports.san_infobox:addNotification(player,"O nome de usuário está ocupado!","error") return end if row["mtaserial"] == getPlayerSerial(player) and not serials[getPlayerSerial(player)] then exports.san_infobox:addNotification(player,"Este serial já está conectado a uma conta!","error") return end end local registerInsert = dbQuery(connection, "INSERT INTO accounts SET username = ?, password = ?, mtaserial = ?, ip = ?, regdate = NOW(), lastlogin = NOW()", username, password, getPlayerSerial(player), getPlayerIP(player)) local result, num, insertID = dbPoll(registerInsert, -1) if insertID then exports.san_infobox:addNotification(player,"Registro bem sucedido! Agora você pode entrar!","success") setElementData(player, "acc:id", insertID) triggerClientEvent(player, "login:setPlayerPanelState", player, "login") end else exports.san_infobox:addNotification(player,"Este usuario ja existe!","error") outputChatBox ( "Este usuario ja existe!", player ) return end end addEvent("onRegisterClick", true) addEventHandler("onRegisterClick", root, onRegisterClick) Sublinhei a laranja a linha que está a dar erro. Edited May 19, 2021 by TAKKASHI Link to comment
Other Languages Moderators Lord Henry Posted May 19, 2021 Other Languages Moderators Share Posted May 19, 2021 Utilize o botão <> do fórum para postar scripts. Não cole direto no texto. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now