PapitoEUS

Untitled

Jun 23rd, 2021
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.92 KB | None | 0 0
  1. local sx, sy = guiGetScreenSize()
  2. local zoom = 1920/sx
  3.  
  4. local f1 = {}
  5.  
  6. function scaleX(type, value)
  7.     if type == 'center' then
  8.         return math.floor(sx/2 - value/zoom)
  9.     elseif type == 'left' then
  10.         return math.floor(sx - value/zoom)
  11.     elseif type == 'right' then
  12.         return math.floor(value/zoom)
  13.     end
  14. end
  15.  
  16. function scaleY(type, value)
  17.     if type == 'center' then
  18.         return math.floor(sy/2 - value/zoom)
  19.     elseif type == 'top' then
  20.         return math.floor(value/zoom)
  21.     elseif type == 'down' then
  22.         return math.floor(sy - value/zoom)
  23.     end
  24. end
  25.  
  26. function scaleImage(value)
  27.     return math.floor(value/zoom)
  28. end
  29.  
  30. function isMouseInPosition ( x, y, width, height )
  31.     if ( not isCursorShowing( ) ) then
  32.         return false
  33.     end
  34.     local sx, sy = guiGetScreenSize ( )
  35.     local cx, cy = getCursorPosition ( )
  36.     local cx, cy = ( cx * sx ), ( cy * sy )
  37.    
  38.     return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) )
  39. end
  40.  
  41. f1.texture = {
  42.     logo = dxCreateTexture('assets/img/logo.png', 'argb', false, 'clamp')
  43. };
  44.  
  45. f1.font = {
  46.     normal = dxCreateFont('assets/font/font.ttf', 15/zoom, false, 'antialiased'),
  47.     bold = dxCreateFont('assets/font/font-bold.ttf', 15/zoom, false, 'antialiased')
  48. };
  49.  
  50. page = 1
  51. function helpPanel()
  52.     if page == 1 then
  53.         dxDrawRectangle(335, 265, 1250, 550, tocolor(0, 0, 0, 220), false)    
  54.         dxDrawRectangle(543, 265, 1042, 550, tocolor(29, 29, 29, 220), false)
  55.         dxDrawImage(344, 265, 180, 180, f1.texture['logo'], 0, 0, 0, tocolor(255, 255, 255, 255), false)
  56.         dxDrawText("INFORMACJE", 344, 476, 524, 514, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false, false, false, false)
  57.         dxDrawText("PRZEWODNIK", 344, 524, 524, 562, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false, false, false, false)
  58.         dxDrawText("ANIMACJE", 344, 572, 524, 610, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false,false, false, false)
  59.         dxDrawText("AKTUALIZACJE", 344, 620, 524, 658, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false, false, false, false)
  60.     end
  61.     if page == 2 then
  62.         dxDrawRectangle(335, 265, 1250, 550, tocolor(0, 0, 0, 220), false)    
  63.         dxDrawRectangle(543, 265, 1042, 550, tocolor(29, 29, 29, 220), false)
  64.         dxDrawImage(344, 265, 180, 180, f1.texture['logo'], 0, 0, 0, tocolor(255, 255, 255, 255), false)
  65.         dxDrawRectangle(335, 476, 208, 38, tocolor(29, 29, 29, 220), false)
  66.         dxDrawText("INFORMACJE", 344, 476, 524, 514, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false, false, false, false)
  67.         dxDrawText("PRZEWODNIK", 344, 524, 524, 562, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false, false, false, false)
  68.         dxDrawText("ANIMACJE", 344, 572, 524, 610, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false,false, false, false)
  69.         dxDrawText("AKTUALIZACJE", 344, 620, 524, 658, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false, false, false, false)
  70.         dxDrawRectangle(563, 285, 6, 38, tocolor(200, 4, 4, 254), false)
  71.         dxDrawText("INFORMACJE", 559, 285, 739, 323, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false,false, false, false, false)
  72.     end
  73.     if page == 3 then
  74.         dxDrawRectangle(335, 265, 1250, 550, tocolor(0, 0, 0, 220), false)    
  75.         dxDrawRectangle(543, 265, 1042, 550, tocolor(29, 29, 29, 220), false)
  76.         dxDrawImage(344, 265, 180, 180, f1.texture['logo'], 0, 0, 0, tocolor(255, 255, 255, 255), false)
  77.         dxDrawRectangle(344, 524, 208, 38, tocolor(29, 29, 29, 220), false)
  78.         dxDrawText("INFORMACJE", 344, 476, 524, 514, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false, false, false, false)
  79.         dxDrawText("PRZEWODNIK", 344, 524, 524, 562, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false, false, false, false)
  80.         dxDrawText("ANIMACJE", 344, 572, 524, 610, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false,false, false, false)
  81.         dxDrawText("AKTUALIZACJE", 344, 620, 524, 658, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false, false, false, false)
  82.         dxDrawRectangle(563, 285, 6, 38, tocolor(200, 4, 4, 254), false)
  83.         dxDrawText("PRZEWODNIK", 559, 285, 739, 323, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false,false, false, false, false)
  84.     end
  85.     if page == 4 then
  86.         dxDrawRectangle(335, 265, 1250, 550, tocolor(0, 0, 0, 220), false)    
  87.         dxDrawRectangle(543, 265, 1042, 550, tocolor(29, 29, 29, 220), false)
  88.         dxDrawImage(344, 265, 180, 180, f1.texture['logo'], 0, 0, 0, tocolor(255, 255, 255, 255), false)
  89.         dxDrawRectangle(344, 620, 208, 38, tocolor(29, 29, 29, 220), false)
  90.         dxDrawText("INFORMACJE", 344, 476, 524, 514, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false, false, false, false)
  91.         dxDrawText("PRZEWODNIK", 344, 524, 524, 562, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false, false, false, false)
  92.         dxDrawText("ANIMACJE", 344, 572, 524, 610, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false,false, false, false)
  93.         dxDrawText("AKTUALIZACJE", 344, 620, 524, 658, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false, false, false, false)
  94.         dxDrawRectangle(563, 285, 6, 38, tocolor(200, 4, 4, 254), false)
  95.         dxDrawText("ANIMACJE", 559, 285, 739, 323, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false,false, false, false, false)
  96.     end
  97.     if page == 5 then
  98.         dxDrawRectangle(335, 265, 1250, 550, tocolor(0, 0, 0, 220), false)    
  99.         dxDrawRectangle(543, 265, 1042, 550, tocolor(29, 29, 29, 220), false)
  100.         dxDrawImage(344, 265, 180, 180, f1.texture['logo'], 0, 0, 0, tocolor(255, 255, 255, 255), false)
  101.         dxDrawRectangle(344, 620, 208, 38, tocolor(29, 29, 29, 220), false)
  102.         dxDrawText("INFORMACJE", 344, 476, 524, 514, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false, false, false, false)
  103.         dxDrawText("PRZEWODNIK", 344, 524, 524, 562, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false, false, false, false)
  104.         dxDrawText("ANIMACJE", 344, 572, 524, 610, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false,false, false, false)
  105.         dxDrawText("AKTUALIZACJE", 344, 620, 524, 658, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false, false, false, false, false)
  106.         dxDrawRectangle(563, 285, 6, 38, tocolor(200, 4, 4, 254), false)
  107.         dxDrawText("AKTUALIZACJE", 559, 285, 739, 323, tocolor(255, 255, 255, 255), 1.00, f1.font['bold'], "center", "center", false,false, false, false, false)
  108.     end
  109. end
  110.  
  111. addEventHandler('onClientClick',root,function(btn, state)
  112.     if btn=='left' and state=='down' then
  113.         if isMouseInPosition(344, 476, 524, 514) then
  114.             page = 2
  115.         elseif isMouseInPosition(344, 524, 524, 562) then
  116.             page = 3
  117.         elseif isMouseInPosition(344, 572, 524, 610) then
  118.             page = 4
  119.         elseif isMouseInPosition(344, 620, 524, 658) then
  120.             page = 5
  121.         end
  122.     end
  123. end)
  124.  
  125. function F1PANEL()
  126.     if F1PANEL == false then
  127.         addEventHandler('onClientRender',root,helpPanel)
  128.         F1PANEL=true
  129.         showChat(false)
  130.         showCursor(true)
  131.     else
  132.         removeEventHandler('onClientRender',root,helpPanel)
  133.         F1PANEL=false
  134.         showChat(true)
  135.         showCursor(false)
  136.     end
  137. end
  138. bindKey('F1','down',F1PANEL)
Add Comment
Please, Sign In to add comment