Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. local sx, sy = guiGetScreenSize(); --lekéri a játékos képernyőméretét
  2. local w, h = 200, 300; --Megadja a hosszát és a magasságát {200 = hossz ; változtatható} {20 = magasság ; változtatható}
  3. local x, y = sx/2-w/2, sy/2-h/2; --Megadja az x és az y pozitcióját (középre helyezi)
  4. local font = dxCreateFont("file/mySimpleFont.ttf") --<[ Font ]>--
  5. local rage = dxCreateFont("file/rage.ttf") --<[ Font ]>--
  6. local enabledCars = { [416]=true, [596]=true, [597]=true, [598]=true, [599]=true, [427]=true, [490]=true }
  7. local veh = getPedOccupiedVehicle(localPlayer)
  8. local ulephely = getPedOccupiedVehicleSeat(localPlayer)
  9.  
  10. mainRender = false
  11.  
  12. function mainRender()
  13. if (veh) then
  14. if (getElementModel(veh)) == 416 or (getElementModel(veh)) == 596 or (getElementModel(veh)) == 597 or (getElementModel(veh)) == 598 or (getElementModel(veh)) == 599 or (getElementModel(veh)) == 427 or (getElementModel(veh)) == 490 then
  15. if ulephely < 2 then
  16. mainRender = true
  17. dxDrawRectangle(x*1.95, y, w, h, isCursorHower(x*1.95, y, w, h, tocolor(0, 0, 0, 100), tocolor(220, 20, 60, 100)));
  18. dxDrawRectangle(x*1.95, y, w, h-270, tocolor(0, 0, 0, 150))
  19. dxDrawImage(x*2, y+180, w/2, h/3, "file/siren.png")
  20. dxDrawImage(x*2, y+40, w/2, h/3, "file/horn.png", tocolor(90,90,134,255))
  21. dxDrawText("#dc153cSwipe#ffffff-#00baf3Siren", x*1.95, y, x*1.95+w, y+h-270, tocolor(60, 155, 74, 200), 2, "rage", "center", "center", true, true, true, true)
  22. return;
  23. elseif ulephely > 2 then
  24. mainRender = false
  25. end
  26. else
  27. mainRender = false
  28. return;
  29. end
  30. end
  31. end
  32. addEventHandler("onClientRender", root, mainRender);
  33.  
  34. function isCursorHower(posX, posY, width, height, color1, color2)
  35. if isCursorShowing() then
  36. local mouseX, mouseY = getCursorPosition();
  37. local clientW, clientH = guiGetScreenSize();
  38. local mouseX, mouseY = mouseX * clientW, mouseY * clientH;
  39. if (mouseX > posX and mouseX < (posX+width) and mouseY > posY and mouseY < (posY+height)) then
  40. return color2;
  41. end
  42. end
  43. return color1;
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement