Here:
local r = getElementData(source, "r")
local g = getElementData(source, "g")
local b = getElementData(source, "b")
dbExec(db, "INSERT INTO RGB (Name, Account, RGB) VALUES (?, ?, ?)", name, account, ""..r..", "..g..", "..b.."")
in database is "255, 255, 255"
But idk how i can load 3x getElementData to 1x getElementData
function loadd (source)
local account = getAccountName(source)
local result = dbQuery ( database ,"SELECT * FROM RGB WHERE Account = ?", account)
local poll, rows = dbPoll(result, -1)
if rows == 1 then
setElementData(source, "RGB", poll[1]["HERE IDK HOW"])
end
end
addEventHandler("onPlayerLogin", getRootElement(), loadd)
because i want use it to Vehicle Lights and there i need r, g, b.