Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.53 KB | None | 0 0
  1. --[[
  2. Resource: Logging
  3. Servers: MTATruckers
  4. Developers: SataN <kontaktthinks@gmail.com>
  5. Copyright <kontaktthinks@gmail.com> 2019
  6. You have no right to use this code without my permission.
  7. ]]
  8. foncik = dxCreateFont("font.ttf",14) or "default"
  9. local sw1,sh1 = guiGetScreenSize()
  10. local sw, sh = sw1/1280,sh1/800
  11. local cx,cy = guiGetScreenSize()
  12. local sx, sy = cx/1280,cy/800
  13. local dist = 120
  14. local angler = 0
  15. local minesY = 0
  16.  
  17. sx, sy = guiGetScreenSize( )
  18.  
  19. shaderMatrix = dxCreateShader( ":3danim/matrix.fx" )
  20. img = dxCreateTexture( "logowa.png" )
  21. dxSetShaderValue( shaderMatrix, "gTexture", img )
  22.  
  23. rX, rY = 0, 0
  24.  
  25. local root = getRootElement()
  26. local resourceRoot = getResourceRootElement(getThisResource())
  27. local startTicking = getTickCount()
  28. local progress = (getTickCount() - startTicking) + 2300
  29. local progress2 = (getTickCount() - startTicking) + 2300
  30. local progress3 = (getTickCount() - startTicking) + 2300
  31. cameraX, cameraY = 977.59, 1734.23
  32. local mtat={ pokaz=nil, button={}, notif=nil, music=nil, }
  33.  
  34. function math.round(number, decimals, method)
  35. decimals = decimals or 0
  36. local factor = 10 ^ decimals
  37. if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor
  38. else return tonumber(("%."..decimals.."f"):format(number)) end
  39. end
  40.  
  41. function renderLogowanie()
  42. if mtat.notif then dxDrawText(mtat.notif, 146*sw, 471*sh, 249*sw, 42*sh, tocolor(255, 255, 255, 255), 1.00, foncik, "center", "center", false, false, false, false, false) end
  43. if mtat.music then
  44. local bit = getSoundFFTData(mtat.music, 2048, 2)
  45. for i,v in ipairs(bit) do
  46. anim = math.round((v *430), 30) > 100 and 100 or math.round((v * 430), 30)
  47. rytm = math.round((v*430),30)>100 and 100 or math.round((v*430),30)
  48. dxDrawImage(sw*0, sh*0, sw*1280, sh*800, "strzalka.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  49. dxDrawImage(sw*0-(anim/2), sh*0-(anim/2), sw*1280+anim, sh*800+anim, "light.png", 0, 0, 0, tocolor(221, 211, 30, rytm), false)
  50. local progress = (getTickCount() - startTicking) / 2300
  51. if tonumber(progress2) >= 1 and tonumber(progress3) >= 1 then
  52. exports["mtat-edit"]:createEditBox( "1", 0.38, 0.44, 0.25, 0.08, true, "", false, 16, foncik, false, 0, {221, 211, 30, 255 }, true, { 255, 255, 255, 0 }, 0.5, true, 60, true, "", { 255, 255, 255, 100 }, true, 3, "", true, false, {0, 114, 210}, false )
  53. exports["mtat-edit"]:createEditBox( "2", 0.38, 0.56, 0.25, 0.08, true, "", true, 16, "arial", false, 0, {221, 211, 30, 255 }, true, { 255, 255, 255, 0 }, 2, true, 60, true, "", { 255, 255, 255, 100 }, true, 3, "z", true, false, {0, 114, 210}, false )
  54. if isCursorShowing( ) then
  55. cX, cY = getCursorPosition( )
  56. rX, rY = (cX - 0.5) * 15, (cY - 0.5) * 15
  57. end
  58. dxSetShaderTransform( shaderMatrix, -rX, rY )
  59. dxDrawImage( sx * 0, sy * 0, 1280, 800, shaderMatrix )
  60.  
  61. end
  62. end
  63. end
  64. end
  65.  
  66.  
  67. addEventHandler("onClientClick", root, function(btn,state)
  68. if btn=="left" and state=="down" then
  69. if isCursorOnElement(sw*486, sh*574, sw*305, sh*37) and mtat.pokaz then
  70. local login= exports["mtat-edit"]:getText("1")
  71. local password= exports["mtat-edit"]:getText("2")
  72. if string.len(login) < 2 or string.len(password) < 2 then
  73. mtat.notif="Wypełnij wszystkie pola!"
  74. outputChatBox(tostring(foncik))
  75. return
  76. end
  77. triggerServerEvent("logowanie:sprawdzKonto", resourceRoot, login, password)
  78. end
  79. end
  80. end)
  81. addEvent("logowanie:wynik", true)
  82. addEventHandler("logowanie:wynik", resourceRoot, function(value,notif)
  83. if not notif then notif="" end
  84. if value then
  85. mtat.pokaz=false
  86. showZones(mtat.music)
  87. removeEventHandler("onClientRender", root, renderLogowanie)
  88. exports["mtat-edit"]:deleteEditBox("1")
  89. exports["mtat-edit"]:deleteEditBox("2")
  90.  
  91. else
  92. mtat.notif=tostring(notif)
  93. setTimer(function() mtat.notif=nil end, 3000, 1)
  94. end
  95. end)
  96.  
  97. addEventHandler("onClientResourceStart", resourceRoot, function()
  98. showChat(false)
  99. showCursor(true)
  100. mtat.pokaz=true
  101. setElementAlpha(localPlayer,0)
  102. mtat.music=playSound("music/music.mp3",true)
  103. setSoundVolume(mtat.music, 1.0)
  104. showPlayerHudComponent("all",false)
  105. addEventHandler("onClientRender", root, renderLogowanie)
  106.  
  107. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement