Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
2,973
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.72 KB | None | 0 0
  1. --[[
  2.  
  3. ---- Informacje ----
  4. @Autor: STOPseba < stopsebaofficial@op.pl >
  5. @Pomagał: STOPseba
  6. @Edytował: STOPseba
  7. @Copyright: Your New Experience MTA
  8. @Zakazuje się rozpowszechniania bądź używania zasoby bez zgody pierwotnego autora zasobu (STOPseba)
  9.  
  10. ---- Kontakt ----
  11. @GG:55028983
  12. @Skype:STOPseba
  13. @stopsebaofficial@op.pl
  14.  
  15. ]]--
  16. if getElementData(localPlayer, "player:uid") then return end
  17.  
  18. local root = getRootElement()
  19. local resourceRoot = getResourceRootElement(getThisResource())
  20. local screenWidth, screenHeight = guiGetScreenSize()
  21.  
  22. --[[
  23. local blurStrength = 70
  24.  
  25.  
  26. local myScreenSource = dxCreateScreenSource(screenWidth, screenHeight)
  27. blurShader, blurTec = dxCreateShader("shaders/BlurShader.fx")
  28.  
  29.  
  30. function renderblur()
  31. if blur == true then
  32. dxUpdateScreenSource(myScreenSource)
  33.  
  34. dxSetShaderValue(blurShader, "ScreenSource", myScreenSource);
  35. dxSetShaderValue(blurShader, "BlurStrength", blurStrength);
  36. dxSetShaderValue(blurShader, "UVSize", screenWidth, screenHeight);
  37.  
  38. dxDrawImage(0, 0, screenWidth, screenHeight, blurShader)
  39. end
  40. end
  41. addEventHandler("onClientRender", root, renderblur)
  42.  
  43. addEventHandler("onClientResourceStop", resourceRoot,
  44. function()
  45. if (blurShader) then
  46. destroyElement(blurShader)
  47. blurShader = nil
  48. end
  49. end)
  50.  
  51. x,y=2313.58, 1282.80-- my width
  52. intro_step=math.random(0,850)
  53. --]]
  54.  
  55. local sx,sy=guiGetScreenSize()
  56. local data={ showed=nil, button={}, info=nil, misc=nil, }
  57.  
  58. function isMouseIn(psx,psy,pssx,pssy,abx,aby)
  59. if not isCursorShowing() then return end
  60. cx,cy=getCursorPosition()
  61. cx,cy=cx*sx,cy*sy
  62. if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
  63. return true,cx,cy
  64. else
  65. return false
  66. end
  67. end
  68. local dist = 100
  69. local angler = 0
  70. function getPointFromDistanceRotation(x, y, dist, angler)
  71. local a = math.rad(90 - angler)
  72. local dx = math.cos(a) * dist;
  73. local dy = math.sin(a) * dist;
  74. return x+dx, y+dy;
  75. end
  76.  
  77. function renderLoginBox()
  78. blur = true
  79. dxDrawRectangle(sx*270/1025, sy*4600/14769, sx*500/1025, sy*58/167, tocolor(255, 255, 255, 100), false)
  80. --exports["YNE-Dodatki"]:dxDrawBluredRectangle(sx*270/1025, sy*4600/14769, sx*500/1025, sy*58/167, tocolor(150, 150, 150, 255), false)
  81. dxDrawRectangle(sx *270/1025, sy *4600/14769, sx * 0.0052, sy * 58/167, tocolor(49, 237, 254, 199), false)
  82. if data.info then dxDrawText(data.info, sx*252/1024, sy*272/768, sx*800/1024, sy*255/768, tocolor(255, 0, 0, 255), 1.00, "default", "center", "center", false) end
  83. dxDrawText("Nazwa Użytkownika", sx*80/1024, sy*270/768, sx*760/1024, sy*302/768, white, 1.30, "default-bold", "center", "center", false)
  84. dxDrawText("Hasło", sx*80/1024, sy*480/768, sx*760/1024, sy*302/768, white, 1.30, "default-bold", "center", "center", false)
  85. dxDrawText("Forum: W trakcie prac", sx*-5/1054, sy*690/768, sx*760/1024, sy*302/768, white, 1.2, "default-bold", "center", "center", false)
  86. if not isMouseIn(sx*620/1024, sy*450/768, sx*200/1024, sy*45/768) then dxDrawRectangle(sx*620/1024, sy*450/768, sx*150/1024, sy*45/768, tocolor(0, 128, 255), false)
  87. else dxDrawRectangle(sx*620/1024, sy*450/768, sx*150/1024, sy*45/768, tocolor(49, 237, 254, 179), false) end
  88. if not isMouseIn(sx*620/1024, sy*390/768, sx*200/1024, sy*45/768) then dxDrawRectangle(sx*620/1024, sy*390/768, sx*150/1024, sy*45/768, tocolor(0, 128, 255), false)
  89. else dxDrawRectangle(sx*620/1024, sy*390/768, sx*150/1024, sy*45/768, tocolor(49, 237, 254, 179), false) end
  90. dxDrawText("Zaloguj się", sx*1260/1024, sy*780/768, sx*130/1024, sy*45/768, white, 1.5, "default-bold", "center", "center", false)
  91. dxDrawText("Zarejestruj się", sx*1260/1024, sy*900/768, sx*130/1024, sy*45/768, white, 1.5, "default-bold", "center", "center", false)
  92. local postepZDJ = math.sin((getTickCount()/360)*4)
  93. --dxDrawImage(655,100,545,285,"logo.png", postepZDJ ,tocolor(255,255,255,255))
  94. dxDrawImage(sx * 0.255, sy * 0.-0, sx * 0.500, sy * 0.400, "logo.png",postepZDJ ,tocolor(255,255,255,255))
  95. local zone1=math.sin(intro_step/500)*9000
  96. local zone2=math.cos(intro_step/500)*9000
  97. setCameraMatrix (-1900.30078125, 466.53228759766 -1900.8060302734,465.72592163086, 109.7618560791, zone1, zone2, 2)
  98. intro_step=intro_step-1
  99.  
  100. dxDrawRectangle(sx*270/1024, sy*600/768, sx*500/1024, sy*45/768, tocolor(49, 237, 254, 100), false)
  101. dxDrawText("Ważne\nX Jeśli teraz się rozłączysz, stracisz Kasę oraz Reputacje. Pamiętaj administracja ci tego nie, zwróci! X", sx*550/1024, sy*1200/768, sx*500/1024, sy*45/768, white, 1, "default-bold", "center", "center", false)
  102. end
  103.  
  104.  
  105. addEventHandler("onClientClick", root, function(btn,state)
  106. if btn=="left" and state=="down" then
  107. if isMouseIn(sx*620/1024, sy*390/768, sx*200/1024, sy*45/768) and data.showed then
  108. local login=guiGetText(data.button[1])
  109. local pass=guiGetText(data.button[2])
  110. if string.len(login) < 2 or string.len(pass) < 2 then
  111. data.info="Wypełnij wszystkie pola!"
  112. return
  113. end
  114. triggerServerEvent("logging:checkAccount", resourceRoot, login, pass)
  115. end
  116. if isMouseIn(sx*620/1024, sy*450/768, sx*200/1024, sy*45/768) and data.showed then
  117. local login=guiGetText(data.button[1])
  118. local pass=guiGetText(data.button[2])
  119. if string.len(login) > 22 or string.len(pass) > 22 and string.len(login) < 3 or string.len(pass) < 3 then
  120. data.info="Login/Hasło muszą mieć mniej niż od 3 do 22 znaków."
  121. return
  122. end
  123. triggerServerEvent("logging:newAccount", resourceRoot, login, pass)
  124. end
  125. end
  126. end)
  127.  
  128. addEvent("logging:result", true)
  129. addEventHandler("logging:result", resourceRoot, function(value,info)
  130. if not info then info="" end
  131. if value then
  132. data.showed=false
  133. showZones(data.misc)
  134.  
  135. -- Usuwamy elementy
  136. destroyElement(data.button[1])
  137. destroyElement(data.button[2])
  138. removeEventHandler("onClientRender", root, renderLoginBox)
  139. else
  140. data.info=tostring(info)
  141. setTimer(function() data.info=nil end, 3000, 1)
  142. end
  143. end)
  144.  
  145. addEventHandler("onClientResourceStart", resourceRoot, function()
  146. showChat(false)
  147. showCursor(true)
  148. fadeCamera(true)
  149. data.showed=true
  150. setElementAlpha(localPlayer,0)
  151. data.misc=playSound("misc/intro.mp3",true)
  152. --data.misc=playSound("misc/nuta" .. tostring(math.random(1, 6)) .. ".mp3",true)
  153. setSoundVolume(data.misc, 1.0)
  154. showPlayerHudComponent("all",true)
  155. guiSetInputMode("no_binds_when_editing")
  156. setElementData(localPlayer,"status","Loguje się")
  157. addEventHandler("onClientRender", root, renderLoginBox)
  158. data.button[1]=guiCreateEdit(0.30, 0.40, 0.22, 0.04, "", true)
  159. data.button[2]=guiCreateEdit(0.30, 0.53, 0.22, 0.04, "", true)
  160. guiEditSetMasked(data.button[2],true)
  161. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement