tabela = {
{x = 300, y = 300, width = 300, height = 300, scrolly = 300}
}
addEventHandler('onClientRender', root, function()
for key, value in ipairs(tabela) do
dxDrawRectangle(value.x, value.y, value.width, value.height, tocolor(250, 0, 0, 255))
dxDrawRectangle(value.x + value.width, value.scrolly, 10, 25, tocolor(0, 250, 0, 255))
if cos then
cursorx, cursory = getCursorPosition()
xx, yy = cursorx * 1920, cursory * 1080
value.scrolly = yy - 12.5
end
end
end)
addEventHandler('onClientClick', root, function(button, state)
if button == 'left' then
if state == 'down' then
for key, value in ipairs(tabela) do
if isMouseOn(value.x + value.width, value.scrolly, 10, 25) then
cos = true
end
end
elseif state == 'up' then
for key, value in ipairs(tabela) do
cos = false
end
end
end
end)