I use this way, best for me. 
local screenW,screenH = guiGetScreenSize() 
local resW,resH = 1280,720 -- Your resolution (This is mine) 
local sW,sH =  (screenW/resW), (screenH/resH) 
 
It should look like this then: 
  
local screenW,screenH = guiGetScreenSize() 
local resW,resH = 1280,720 
local sW,sH =  (screenW/resW), (screenH/resH) 
  
    addEventHandler("onClientRender", root, 
        function() 
            if(getElementData(localPlayer,"loggedIn"))then 
            dxDrawRectangle(0*sW, 0*sH, 1366*sW, 51*sH, tocolor(0, 0, 0, 255), true) 
            dxDrawRectangle(0*sW, 0*sH, 1365*sW, 49*sH, tocolor(0, 9, 85, 255), true) 
            dxDrawRectangle(1365*sW, 130*sH, 1*sW, 0*sH, tocolor(255, 255, 255, 255), true) --... 
        end 
    end)