Advertisement
Guest User

Untitled

a guest
May 26th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.46 KB | None | 0 0
  1. --[[
  2. #author: chojnas
  3. #for: QualityGame
  4. #title: Montaż świateł
  5. ]]
  6.  
  7.  
  8. local sx, sy = guiGetScreenSize()
  9. local px,py = (sx/1920), (sy/1080)
  10. local screenW, screenH = guiGetScreenSize()
  11. local secondsToFade = 1.5
  12. local count = 60
  13. local countingTimer
  14. font1 = dxCreateFont("font.ttf", 12)
  15. font12 = dxCreateFont("font.ttf", 10)
  16. marker = createMarker(1298.21,-1398.95,13.20, "cylinder", 1,255,0,0)
  17. local ped = createPed(2, 1835.54,-2273.75,13.38)
  18. createMarker(1835.54,-2273.75,13.38+2,"cylinder", 1, 255,0,0)
  19. function startCounting12()
  20.     local target = getPedTarget(localPlayer)
  21.  
  22.     if isElementWithinMarker(localPlayer, marker) then
  23.         if target and getElementsByType(target) == "ped" then
  24.             count = 60
  25.             if count == 60 then
  26.                 removeEventHandler("onClientRender", root, gui12)
  27.                 addEventHandler('onClientRender', root, czekaj12)
  28.             end
  29.             count = count > 0 and (count - 1) or 0
  30.             if count == 0 then
  31.                 if isTimer(countingTimer) then
  32.                     killTimer(countingTimer)
  33.                 end
  34.                 removeEventHandler('onClientRender', root, czekaj12)
  35.                 showChat(true)
  36.             end
  37.         end
  38.     end
  39. end
  40.  
  41. function gui12()
  42.     dxDrawText("Aby rozpocząć napad wyjmij broń i wyceluj w sprzedawce", 762*px, 54*py, 1155*px, 123*py, tocolor(255, 255, 255, 255), 1.00, font12, "center", "center", false, false, false, false, false)
  43. end
  44. function czekaj12()
  45.     dxDrawText("Rozpocząłeś napad, ukryj się!\nZostały wezwane gliny!\nDo zakończenia napadu pozostało: "..count.."", 762*px, 54*py, 1155*px, 123*py, tocolor(255, 0, 0, 255), 1.00, font12, "center", "center", false, false, false, false, false)
  46.  
  47. end
  48.  
  49. function isMouseIn ( x, y, width, height )
  50.     if ( not isCursorShowing( ) ) then
  51.         return false
  52.     end
  53.     local sx, sy = guiGetScreenSize ( )
  54.     local cx, cy = getCursorPosition ( )
  55.     local cx, cy = ( cx * sx ), ( cy * sy )
  56.     if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
  57.         return true
  58.     else
  59.         return false
  60.     end
  61. end
  62.  
  63. addEvent("showGUI12", true)
  64. function pokazGUI12()
  65. addEventHandler("onClientRender", root, gui12)
  66. end
  67. addEventHandler("showGUI12", getRootElement(), pokazGUI12)
  68.  
  69. function schowajGUI12()
  70. removeEventHandler("onClientRender", root, gui12)
  71. end
  72. addEvent("hideGUI12", true)
  73. addEventHandler("hideGUI12", getRootElement(), schowajGUI12)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement