Welcome!
local connection = exports.dm_mysql:getConnection()
function onJoin()
local serial = getPlayerSerial(source)
local ipadress = getPlayerIP(source)
local serialcheck = dbQuery(connection, "SELECT banned FROM accounts WHERE serial = ?", serial)
local result = dbPoll(serialcheck, -1)
if result and #result == 1 then -- found an account
local banned = tonumber(result[1]["banned"]) == 1 -- A Boolean from database is 0 (false) or 1 (true), this will be true if the value 1, false otherwise
if banned then
outputChatBox("Banned", source)
else
outputChatBox("Not banned", source)
end
end
end
addEventHandler("onPlayerJoin", root, onJoin)