daily pastebin goal
9%
SHARE
TWEET

accountC.lua

a guest Nov 6th, 2018 147 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- \\ writed by Jack // --
  2. --Regisztráció
  3. --Bejelentkezés
  4. --Karakter létrehozás random név táblából
  5. --Adatok mentése
  6. --Ellenőrizni hogy a játékosnak van -e accountja, ha van akkor a login-t tesszük elé
  7.  
  8.  
  9. local sx, sy = guiGetScreenSize();
  10.  
  11.  
  12. ---------------------------------------------------------------------------------
  13. --------------------------Mátrixok meghatározása---------------------------------
  14.  
  15. camPos = {}
  16. camPos[1] = {2422.8366699219, -1659.5369873047, 20.660020828247, 2322.8374023438, -1659.1408691406, 20.660020828247}
  17. camPos[2] = {2266.4499511719, -1658.240234375, 21.822526931763, 2166.4719238281, -1656.5705566406, 19.057621002197}
  18. camPos[3] = {2266.4499511719, -1658.240234375, 21.822526931763, 2168.8793945313, -1636.3687744141, 19.057621002197}
  19. camPos[4] = {2113.0180664063, -1613.2703857422, 17.964408874512, 2013.0187988281, -1612.8742675781, 19.057621002197}
  20. camPos[5] = {2009.427734375, -1613.8239746094, 18.143964767456, 1910.4256591797, -1627.3883056641, 19.057621002197}
  21. camPos[6] = {2001.4849853516, -1613.5836181641, 18.143964767456, 2000.6928710938, -1713.5723876953, 19.057621002197}
  22. camPos[7] = {2001.1732177734, -1750.5603027344, 17.712144851685, 2000.3811035156, -1850.5571289063, 19.057621002197}
  23. camPos[8] = {2001.1729736328, -1752.060546875, 17.712144851685, 1901.1818847656, -1751.6645507813, 19.057621002197}
  24. camPos[9] = {1817.8791503906, -1751.7553710938, 18.015951156616, 1717.8798828125, -1751.3592529297, 19.057621002197}
  25. camPos[10] = {1821.6284179688, -1751.6922607422, 18.015951156616, 1820.3547363281, -1651.7084960938, 19.057621002197}
  26. camPos[11] = {1824.8376464844, -1732.0211181641, 18.015951156616, 1724.8383789063, -1731.625, 19.057621002197}
  27. camPos[12] = {1312.8140869141, -1731.5557861328, 18.691499710083, 1212.8280029297, -1729.8859863281, 19.057621002197}
  28. camPos[13] = {1312.8140869141, -1731.5557861328, 18.691499710083, 1312.8140869141, -1631.5638427734, 19.057621002197}
  29. camPos[14] = {1314.7663574219, -1547.4327392578, 19.046047210693, 1321.1307373047, -1447.6435546875, 19.057621002197}
  30. camPos[15] = {1342.5394287109, -1488.2711181641, 19.456857681274, 1377.4528808594, -1394.5725097656, 19.057621002197}
  31. camPos[16] = {1356.9691162109, -1403.126953125, 19.508377075195, 1356.9691162109, -1303.126953125, 19.057621002197}
  32. camPos[17] = {1357.0478515625, -1395.9272460938, 19.508377075195, 1257.0485839844, -1395.5311279297, 19.057621002197}
  33. camPos[18] = {636.24139404297, -1395.6773681641, 20.915954589844, 537.19915771484, -1409.2471923828, 19.057621002197}
  34. camPos[19] = {628.44250488281, -1395.7573242188, 20.915954589844, 627.65032958984, -1495.7541503906, 19.057621002197}
  35. camPos[20] = {621.24371337891, -1744.6323242188, 19.58584022522, 609.017578125, -1843.8820800781, 19.057621002197}
  36. camPos[21] = {621.24371337891, -1744.6323242188, 19.58584022522, 718.34161376953, -1768.5147705078, 19.057621002197}
  37. camPos[22] = {758.74047851563, -1780.4946289063, 19.952068328857, 856.67993164063, -1800.6499023438, 19.057621002197}
  38. camPos[23] = {758.74047851563, -1780.4946289063, 19.952068328857, 858.54315185547, -1786.7741699219, 19.057621002197}
  39. camPos[24] = {1030.5223388672, -1817.9530029297, 20.883810043335, 1123.7994384766, -1853.9774169922, 19.057621002197}
  40. camPos[25] = {1046.5244140625, -1836.9858398438, 19.816757202148, 1044.4587402344, -1936.9564208984, 19.057621002197}
  41. camPos[26] = {1031.8864746094, -2081.6369628906, 14.958271026611, 1014.6212158203, -2180.1352539063, 19.057621002197}
  42. camPos[27] = {1017.1469726563, -2193.8757324219, 15.141680717468, 1020.1759033203, -2293.8298339844, 19.057621002197}
  43. camPos[28] = {1057.1735839844, -2313.23046875, 15.707840919495, 1112.8751220703, -2396.2807617188, 19.057621002197}
  44. camPos[29] = {1112.9096679688, -2382.6008300781, 15.08243560791, 1190.1669921875, -2445.9782714844, 19.057621002197}
  45. camPos[30] = {1318.5529785156, -2463.2524414063, 12.949135780334, 1418.3409423828, -2461.8957519531, 19.057621002197}
  46. camPos[31] = {1318.5529785156, -2463.2524414063, 12.949135780334, 1322.6807861328, -2363.4106445313, 19.057621002197}
  47. camPos[32] = {1323.6564941406, -2392.6127929688, 17.899843215942, 1345.4444580078, -2295.0234375, 19.057621002197}
  48. camPos[33] = {1583.9509277344, -2195.5190429688, 19.057621002197, 1683.9509277344, -2195.4333496094, 19.057621002197}
  49. camPos[34] = {1952.4744873047, -2167.76171875, 19.652322769165, 2052.4396972656, -2165.1286621094, 19.057621002197}
  50. camPos[35] = {1961.4730224609, -2167.7023925781, 19.652322769165, 1961.7834472656, -2067.7028808594, 19.057621002197}
  51. camPos[36] = {1962.5642089844, -1817.1022949219, 19.652322769165, 1962.8746337891, -1717.1027832031, 19.057621002197}
  52. camPos[37] = {1962.4359130859, -1812.1551513672, 19.652322769165, 2062.4357910156, -1812.0695800781, 19.057621002197}
  53. camPos[38] = {2077.0358886719, -1812.0567626953, 19.652322769165, 2177.0358886719, -1811.9711914063, 19.057621002197}
  54. camPos[39] = {2080.5529785156, -1812.82421875, 19.652322769165, 2101.0910644531, -1714.9891357422, 19.057621002197}
  55. camPos[40] = {2093.2312011719, -1756.7137451172, 18.675369262695, 2118.7338867188, -1660.0203857422, 19.057621002197}
  56. camPos[41] = {2093.2600097656, -1754.3140869141, 18.675369262695, 2193.251953125, -1754.228515625, 19.057621002197}
  57. camPos[42] = {2415.3725585938, -1750.5134277344, 18.949174880981, 2515.2961425781, -1746.6072998047, 19.057621002197}
  58. camPos[43] = {2415.3725585938, -1750.5134277344, 18.949174880981, 2413.1362304688, -1650.5709228516, 19.057621002197}
  59. camPos[44] = {2415.0632324219, -1732.3741455078, 18.444812774658, 2515.0480957031, -1733.5622558594, 19.057621002197}
  60. camPos[45] = {2478.0646972656, -1730.8605957031, 18.248012542725, 2578.0473632813, -1729.5013427734, 19.057621002197}
  61. camPos[46] = {2479.2607421875, -1730.9559326172, 18.248012542725, 2487.2053222656, -1631.2801513672, 19.057621002197}
  62. camPos[47] = {2482.8950195313, -1658.1937255859, 19.176633834839, 2476.8403320313, -1558.3852539063, 19.057621002197}
  63. camPos[48] = {2423.3500976563, -1659.0334472656, 20.690965652466, 2323.3696289063, -1657.0532226563, 19.057621002197}
  64.  
  65. ---------------------------------------------------------------------------------
  66. ---------------------------------------------------------------------------------
  67.  
  68. camPos.curr = 1
  69.  
  70.  
  71. camPos.next = ( (camPos.curr >= #camPos) and 1 or (camPos.curr+1) )
  72.  
  73.  
  74. camPos.start = getTickCount()
  75.  
  76. -- Mozgási idő két kameraállás között ezredmásodpercben
  77. camPos.length = 10000
  78.  
  79. -- Render funkció
  80. function moveCamera()
  81.     --showChat(false)
  82.     setPlayerHudComponentVisible("all", false)
  83.     fadeCamera(true)
  84.     local tick = getTickCount()
  85.         if (tick - camPos.start) < camPos.length then
  86.             local camX, camY, camZ = interpolateBetween(camPos[camPos.curr][1], camPos[camPos.curr][2], camPos[camPos.curr][3], camPos[camPos.next][1], camPos[camPos.next][2], camPos[camPos.next][3], (tick-camPos.start)/camPos.length, "InOutQuad")
  87.             local lookX, lookY, lookZ = interpolateBetween(camPos[camPos.curr][4], camPos[camPos.curr][5], camPos[camPos.curr][6], camPos[camPos.next][4], camPos[camPos.next][5], camPos[camPos.next][6], (tick-camPos.start)/camPos.length, "InOutQuad")
  88.             setCameraMatrix(camX, camY, camZ, lookX, lookY, lookZ)
  89.         else
  90.             camPos.curr = camPos.next
  91.             camPos.next = ( (camPos.curr >= #camPos) and 1 or (camPos.curr+1) )
  92.             camPos.start = tick
  93.         end
  94. end
  95. addEventHandler("onClientRender", root, moveCamera)
  96.  
  97. ---------------------------------------------------------------------------------
  98. ---------------------------------------------------------------------------------
  99.  
  100. local buttoncolors = {
  101.     [1] = tocolor(0, 140, 229, 150)
  102. }
  103.  
  104. function showRegister()
  105.  
  106.     showCursor(true)
  107.  
  108.     dxDrawRectangle(sx * 0.4068, sy * 0.3083, sx * 0.1865, sy * 0.3833, tocolor(0, 0, 0, 150), false) --háttér   
  109.  
  110.     dxDrawRectangle(sx * 0.4068, sy * 0.3083, sx * 0.1865, sy * 0.0296, tocolor(0, 140, 229, 150), false) --Fejléc
  111.         dxDrawText("Regisztráció", (sx * 0.4646) - 1, (sy * 0.3074) - 1, (sx * 0.5349) - 1, (sy * 0.3380) - 1, tocolor(0, 0, 0, 255), 1.90, "default", "center", "center", false, false, false, false, false) --Fejléc szöveg
  112.         dxDrawText("Regisztráció", (sx * 0.4646) + 1, (sy * 0.3074) - 1, (sx * 0.5349) + 1, (sy * 0.3380) - 1, tocolor(0, 0, 0, 255), 1.90, "default", "center", "center", false, false, false, false, false) --Fejléc szöveg
  113.         dxDrawText("Regisztráció", (sx * 0.4646) - 1, (sy * 0.3074) + 1, (sx * 0.5349) - 1, (sy * 0.3380) + 1, tocolor(0, 0, 0, 255), 1.90, "default", "center", "center", false, false, false, false, false) --Fejléc szöveg
  114.         dxDrawText("Regisztráció", (sx * 0.4646) + 1, (sy * 0.3074) + 1, (sx * 0.5349) + 1, (sy * 0.3380) + 1, tocolor(0, 0, 0, 255), 1.90, "default", "center", "center", false, false, false, false, false) --Fejléc szöveg      
  115.         dxDrawText("Regisztráció", sx * 0.4646, sy * 0.3074, sx * 0.5349, sy * 0.3380, tocolor(255, 255, 255, 255), 1.90, "default", "center", "center", false, false, false, false, false) --Fejléc szöveg    
  116.        
  117.     dxDrawRectangle(sx * 0.4120, sy * 0.6583, sx * 0.0688, sy * 0.0241, buttoncolors[1], false) --regisztráció gomb
  118.     regButton = guiCreateLabel(sx *  0.412,sy * 0.656, sx * 0.07, sy * 0.02, "", false)
  119.         addEventHandler("onClientGUIClick", regButton, isPlayerClickedButton, false)
  120.         if isPlayerCursorInRectangle(sx * 0.4120, sy * 0.6583, sx * 0.0688, sy * 0.0241) then
  121.             dxDrawRectangle(sx * 0.4120, sy * 0.6583, sx * 0.0688, sy * 0.0241, tocolor(0, 140, 229, 255), false)
  122.         else
  123.             dxDrawRectangle(sx * 0.4120, sy * 0.6583, sx * 0.0688, sy * 0.0241, tocolor(0, 140, 229, 150), false)
  124.         end
  125.         dxDrawText("Regisztráció", (sx * 0.4120) - 1, (sy * 0.6583) - 1, (sx * 0.4807) - 1, (sy * 0.6833) - 1, tocolor(0, 0, 0, 255), 1.80, "default", "center", "center", false, false, false, false, false) --regisztráció gomb
  126.         dxDrawText("Regisztráció", (sx * 0.4120) + 1, (sy * 0.6583) - 1, (sx * 0.4807) + 1, (sy * 0.6833) - 1, tocolor(0, 0, 0, 255), 1.80, "default", "center", "center", false, false, false, false, false) --regisztráció gomb
  127.         dxDrawText("Regisztráció", (sx * 0.4120) - 1, (sy * 0.6583) + 1, (sx * 0.4807) - 1, (sy * 0.6833) + 1, tocolor(0, 0, 0, 255), 1.80, "default", "center", "center", false, false, false, false, false) --regisztráció gomb
  128.         dxDrawText("Regisztráció", (sx * 0.4120) + 1, (sy * 0.6583) + 1, (sx * 0.4807) + 1, (sy * 0.6833) + 1, tocolor(0, 0, 0, 255), 1.80, "default", "center", "center", false, false, false, false, false) --regisztráció gomb      
  129.         dxDrawText("Regisztráció", sx * 0.4120, sy * 0.6583, sx * 0.4807, sy * 0.6833, tocolor(255, 255, 255, 255), 1.80, "default", "center", "center", false, false, false, false, false) --regisztráció gomb    
  130.     --[[   
  131.     dxDrawRectangle(sx * 0.5193, sy * 0.6583, sx * 0.0688, sy * 0.0241, tocolor(0, 140, 229, 150), false) --bejelentkező gomb
  132.         if isPlayerCursorInRectangle(sx * 0.5193, sy * 0.6583, sx * 0.0688, sy * 0.0241) then
  133.             dxDrawRectangle(sx * 0.5193, sy * 0.6583, sx * 0.0688, sy * 0.0241, tocolor(0, 140, 229, 255), false)
  134.         else
  135.             dxDrawRectangle(sx * 0.5193, sy * 0.6583, sx * 0.0688, sy * 0.0241, tocolor(0, 140, 229, 150), false)
  136.         end
  137.         dxDrawText("Bejelentkezés", (sx * 0.5193) - 1, (sy * 0.6574) - 1, (sx * 0.5880) - 1, (sy * 0.6824) - 1, tocolor(0, 0, 0, 255), 1.70, "default", "center", "center", false, false, false, false, false) --bejelentkező gomb
  138.         dxDrawText("Bejelentkezés", (sx * 0.5193) + 1, (sy * 0.6574) - 1, (sx * 0.5880) + 1, (sy * 0.6824) - 1, tocolor(0, 0, 0, 255), 1.70, "default", "center", "center", false, false, false, false, false) --bejelentkező gomb
  139.         dxDrawText("Bejelentkezés", (sx * 0.5193) - 1, (sy * 0.6574) + 1, (sx * 0.5880) - 1, (sy * 0.6824) + 1, tocolor(0, 0, 0, 255), 1.70, "default", "center", "center", false, false, false, false, false) --bejelentkező gomb
  140.         dxDrawText("Bejelentkezés", (sx * 0.5193) + 1, (sy * 0.6574) + 1, (sx * 0.5880) + 1, (sy * 0.6824) + 1, tocolor(0, 0, 0, 255), 1.70, "default", "center", "center", false, false, false, false, false) --bejelentkező gomb
  141.         dxDrawText("Bejelentkezés", sx * 0.5193, sy * 0.6574, sx * 0.5880, sy * 0.6824, tocolor(255, 255, 255, 255), 1.70, "default", "center", "center", false, false, false, false, false) --bejelentkező gomb
  142.     ]]     
  143.     dxDrawText("Felhasználónév:", sx * 0.4141, sy * 0.3630, sx * 0.4839, sy * 0.3843, tocolor(255, 255, 255, 255), 1.50, "default", "left", "center", false, false, false, false, false)
  144.     --Felhasználónév mező
  145.  
  146.     dxDrawText("Jelszó:", sx * 0.4141, sy * 0.4306, sx * 0.4427, sy * 0.4519, tocolor(255, 255, 255, 255), 1.50, "default", "left", "center", false, false, false, false, false)
  147.     --Jelszó mező
  148.  
  149.     dxDrawText("Jelszó megerősítése:", sx * 0.4141, sy * 0.4926, sx * 0.5031, sy * 0.5139, tocolor(255, 255, 255, 255), 1.50, "default", "left", "center", false, false, false, false, false)
  150.     --Jelszó megerősítése mező
  151.  
  152.     dxDrawText("E-mail:", sx * 0.4141, sy * 0.5500, sx * 0.4427, sy * 0.5713, tocolor(255, 255, 255, 255), 1.50, "default", "left", "center", false, false, false, false, false)
  153.     --E-mail mező
  154.  
  155. end
  156. addEventHandler("onClientRender", root, showRegister)
  157.  
  158. local username = _username
  159. local password = _password
  160. local passwordconfirm = _passwordconfirm
  161. local email = _email
  162.  
  163. function dataButtons()
  164.  
  165.     username = guiCreateEdit(sx * 0.41, sy * 0.39, sx * 0.11, sy * 0.02, "", false) --Felhasználónév mező
  166.  
  167.     password = guiCreateEdit(sx * 0.41, sy * 0.46, sx * 0.09, sy * 0.02, "", false) --Jelszó mező
  168.     guiEditSetMasked(password, true)   
  169.  
  170.     passwordconfirm = guiCreateEdit(sx * 0.41, sy * 0.52, sx * 0.09, sy * 0.02, "", false) --Jelszó megerősítése mező
  171.     guiEditSetMasked(passwordconfirm, true)
  172.  
  173.     email = guiCreateEdit(sx * 0.41,sy * 0.58, sx * 0.09, sy * 0.02, "", false) --E-mail mező
  174.  
  175. end
  176. addEventHandler("onClientResourceStart", root, dataButtons)
  177.  
  178. addEvent("sendDatas:server", true)
  179. addEventHandler("sendDatas:server", root,
  180.     function(username, password, passwordconfirm, email)
  181.         local username = guiGetText(_username)
  182.         local password = guiGetText(_password)
  183.         local passwordconfirm = guiGetText(_passwordconfirm)
  184.         local email = guiGetText(_email)
  185.     end
  186. )
  187.  
  188. function isPlayerClickedButton(button)
  189.     if (button == "left" and pressed) then
  190.         outputChatBox("A szerver sikeressen meghívva")
  191.         triggerServerEvent("acc:Register", root)
  192.     end
  193. end
  194.  
  195. ---------------------------------------------------------------------------------
  196. ---------------------------------------------------------------------------------
  197.  
  198. addEvent("cancelMoveCamera", true)
  199. addEventHandler("cancelMoveCamera", root,
  200.     function()
  201.         showCursor(false)
  202.         showChat(true)
  203.         setPlayerHudComponentVisible("all", true)
  204.         setCameraTarget(localPlayer)
  205.         removeEventHandler("onClientRender", root, moveCamera)
  206.         removeEventHandler("onClientRender", root, showRegister)
  207.         removeEventHandler("onClientResourceStart", root, dataButtons)
  208.     end
  209. )
  210.  
  211. ---------------------------------------------------------------------------------
  212. ---------------------------------------------------------------------------------
  213.  
  214. function isPlayerCursorInRectangle(x, y, w, h)
  215.     if isCursorShowing() then
  216.         local mx, my = getCursorPosition()
  217.         local cursorX, cursorY = mx*sx, my*sy
  218.         if cursorX > x and cursorX < x + w and cursorY > y and cursorY < y + h then
  219.             return true
  220.         else
  221.             return false
  222.         end
  223.     end
  224. end
  225.  
  226. ---------------------------------------------------------------------------------
  227. ---------------------------------------------------------------------------------
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top