Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.64 KB | None | 0 0
  1. intro_step=math.random(0,850)
  2.  
  3. local screenW, screenH = guiGetScreenSize()
  4. local sx,sy=guiGetScreenSize()
  5. local data={ showed=nil, button={}, info=nil, misc=nil, }
  6. local f = dxCreateFont(":west-gui/f/droid-sans.ttf",12)
  7.  
  8. function isMouseIn(psx,psy,pssx,pssy,abx,aby)
  9. if not isCursorShowing() then return end
  10. cx,cy=getCursorPosition()
  11. cx,cy=cx*sx,cy*sy
  12. if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
  13. return true,cx,cy
  14. else
  15. return false
  16. end
  17. end
  18.  
  19. function renderZoneBox()
  20. dxDrawImage(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000, "bg.png", 0, 0, 0, tocolor(255,255,255,255), false)
  21. dxDrawRectangle(screenW * 0.3812, screenH * 0.2444, screenW * 0.2383, screenH * 0.5125, tocolor(50,50,50,200), false)
  22. if not isMouseIn(screenW * 0.4266, screenH * 0.3125, screenW * 0.1469, screenH * 0.0903) then dxDrawRectangle(screenW * 0.4266, screenH * 0.3125, screenW * 0.1469, screenH * 0.0903, tocolor(204,153,0,200), false)
  23. else dxDrawRectangle(screenW * 0.4266, screenH * 0.3125, screenW * 0.1469, screenH * 0.0903, tocolor(50,50,50,255), false) end
  24. if not isMouseIn(screenW * 0.4266, screenH * 0.4556, screenW * 0.1469, screenH * 0.0903) then dxDrawRectangle(screenW * 0.4266, screenH * 0.4556, screenW * 0.1469, screenH * 0.0903, tocolor(204,153,0,200), false)
  25. else dxDrawRectangle(screenW * 0.4266, screenH * 0.4556, screenW * 0.1469, screenH * 0.0903, tocolor(50,50,50,255), false) end
  26. if not isMouseIn(screenW * 0.4266, screenH * 0.6000, screenW * 0.1469, screenH * 0.0903) then dxDrawRectangle(screenW * 0.4266, screenH * 0.6000, screenW * 0.1469, screenH * 0.0903, tocolor(204,153,0,200), false)
  27. else dxDrawRectangle(screenW * 0.4266, screenH * 0.6000, screenW * 0.1469, screenH * 0.0903, tocolor(50,50,50,255), false) end
  28. dxDrawText("Prawo Jazdy San Fierro", screenW * 0.4266, screenH * 0.3097, screenW * 0.5734, screenH * 0.4028, white, 1.00, f, "center", "center", false)
  29. dxDrawText("Glowny spawn SF", screenW * 0.4266, screenH * 0.4556, screenW * 0.5734, screenH * 0.5486, white, 1.00, f, "center", "center", false)
  30. dxDrawText("Mieszkanie\nO ile posiadasz!", screenW * 0.4266, screenH * 0.5972, screenW * 0.5734, screenH * 0.6903, white, 1.00, f, "center", "center", false)
  31. local zone1=math.sin(intro_step/500)*9000
  32. local zone2=math.cos(intro_step/500)*9000
  33. intro_step=intro_step-1.5
  34.  
  35. end
  36.  
  37. addEventHandler("onClientClick", root, function(btn,state)
  38. if btn=="left" and state=="down" then
  39. if isMouseIn(screenW * 0.4266, screenH * 0.3125, screenW * 0.1469, screenH * 0.0903) and data.showed then
  40. setElementData(localPlayer,"player:spawn",{-2156.86, 252.62, 35.32+0.1})
  41. exports["LS-Notyfikacje"]:noti("Autoryzacja przebiegła pomyślnie!",plr)
  42. exports["LS-Notyfikacje"]:noti("Wybrałeś: Prawo Jazdy San Fierro",plr)
  43. closeZones()
  44. end
  45. if isMouseIn(screenW * 0.4266, screenH * 0.4556, screenW * 0.1469, screenH * 0.0903) and data.showed then
  46. setElementData(localPlayer,"player:spawn",{-2649.20, -33.84, 6.13+0.1})
  47. exports["LS-Notyfikacje"]:noti("Autoryzacja przebiegła pomyślnie!",plr)
  48. exports["LS-Notyfikacje"]:noti("Wybrałeś: Główny spawn San Fierro",plr)
  49. closeZones()
  50. end
  51. if isMouseIn(screenW * 0.4266, screenH * 0.6000, screenW * 0.1469, screenH * 0.0903) and data.showed then
  52. local domek=getElementData(localPlayer,"player:house")
  53. if not domek then
  54. setElementData(localPlayer,"player:spawn",{-2649.20, -33.84, 6.13+0.1})
  55. outputChatBox("Nie posiadasz mieszkania, lub stracił ważność, lub nie wykupiony, wytepany na spawna.")
  56. end
  57. closeZones()
  58. end
  59. end
  60. end)
  61.  
  62. function closeZones()
  63. showChat(true)
  64. showCursor(false)
  65. fadeCamera(false)
  66. setElementAlpha(localPlayer,255)
  67. setElementData(localPlayer,"status","Zalogowany(a)")
  68. stopSound(data.misc)
  69. showPlayerHudComponent("all",false)
  70. showPlayerHudComponent("crosshair",true)
  71. showPlayerHudComponent("weapon",true)
  72. showPlayerHudComponent("radar",false)
  73. showPlayerHudComponent("health",true)
  74. showPlayerHudComponent("breath",true)
  75. showPlayerHudComponent("clock",true)
  76. showPlayerHudComponent("ammo",true)
  77. data.showed=false
  78. -- Usuwamy elementy
  79. triggerServerEvent("core:spawnPlayer", localPlayer)
  80. setTimer(triggerEvent, 250, 1, "gui:start", localPlayer)
  81. removeEventHandler("onClientRender", root, renderZoneBox)
  82. end
  83.  
  84. function showZones(misc)
  85. data.misc=misc
  86. data.showed=true
  87. showPlayerHudComponent("all",false)
  88. guiSetInputMode("no_binds_when_editing")
  89. addEventHandler("onClientRender", root, renderZoneBox)
  90. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement