Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.55 KB | None | 0 0
  1. if fileExists("sourceClient.luac") then
  2. fileDelete("sourceClient.luac")
  3. end
  4. if fileExists("sourceClient.lua") then
  5. fileDelete("sourceClient.lua")
  6. end
  7.  
  8. local piros = "#dc143c"
  9. local zold = "#7CC576"
  10. local barna = "#FFBA00"
  11. local kek = "#005EFF"
  12. local feher = "#ffffff"
  13. local sx, sy = guiGetScreenSize()
  14. local currentPanel = nil
  15. local loginEdits = false
  16. local loginNevActive = false
  17. local loginNevTime = 0
  18. local loginJelszoActive = false
  19. local loginJelszoTime = 0
  20. local currentNem = 0
  21. local characterEdits = false
  22. local tableAccounts = nil
  23. local rotate = 0
  24. local OpenSans = dxCreateFont("files/OpenSans.ttf", 10)
  25. local components = {"weapon", "ammo", "health", "clock", "money", "breath", "armour", "wanted", "radar"}
  26. login = playSound("files/sound.mp3", true)
  27. setSoundVolume(login, 0.3)
  28. setBlurLevel (0)
  29. local OpenSansB = dxCreateFont('files/OpenSans.ttf', 12)
  30. local OpenSansB2 = dxCreateFont('files/OpenSans.ttf', 15)
  31. local alphaPercent = 0.5
  32. local alphaText = 0
  33. local alpha = 0
  34. now = getTickCount()
  35. local startTime = getTickCount()
  36. local endTime = startTime + 1000
  37.  
  38.  
  39.  
  40. local camFading = 2
  41. local camID = 0
  42. local cams = {}
  43. cams[1] = {}
  44. cams[1]["start"] = {1551.1522216797, -1714.8747558594, 36.122299194336, 1550.4567871094, -1715.4777832031, 35.731441497803}
  45. cams[1]["end"] = {1415.0362548828, -1714.5006103516, 33.373600006104, 1415.8209228516, -1715.0610351563, 33.108825683594}
  46.  
  47. cams[2] = {}
  48. cams[2]["start"] = {1480.5142822266, -1750.1977539063, 27.082599639893, 1480.4738769531, -1749.2398681641, 26.798355102539}
  49. cams[2]["end"] = {1479.7485351563, -1662.9426269531, 27.936199188232, 1479.7301025391, -1662.0682373047, 27.45135307312}
  50.  
  51. cams[3] = {}
  52. cams[3]["start"] = {1301.9262695313, -2081.583984375, 93.168899536133, 1301.044921875, -2081.2751464844, 92.811424255371}
  53. cams[3]["end"] = {1158.2895507813, -2010.8045654297, 94.719497680664, 1157.7092285156, -2011.2060546875, 94.010948181152}
  54.  
  55. cams[4] = {}
  56. cams[4]["start"] = {1847.8442382813, -2362.7084960938, 64.000701904297, 1847.0632324219, -2362.3383789063, 63.49751663208}
  57. cams[4]["end"] = {1568.4448242188, -2208.4670410156, 63.871601104736, 1567.7784423828, -2209.048828125, 63.405311584473}
  58.  
  59. cams[5] = {}
  60. cams[5]["start"] = {1690.2227783203, -1835.9094238281, 26.071199417114, 1691.0379638672, -1836.3127441406, 25.655380249023}
  61. cams[5]["end"] = {1837.7509765625, -1865.9035644531, 26.139699935913, 1836.8624267578, -1866.2834472656, 25.882530212402}
  62.  
  63. cams[6] = {}
  64. cams[6]["start"] = {1919.4627685547, -1726.5601806641, 26.234399795532, 1919.5749511719, -1727.5123291016, 25.950155258179}
  65. cams[6]["end"] = {1970.5520019531, -1778.8443603516, 26.490800857544, 1969.6254882813, -1778.7269287109, 26.133327484131}
  66.  
  67. local lastCamTick = 0
  68.  
  69. camID = math.random(1,#cams)
  70. setCameraMatrix(cams[camID]["start"][1],cams[camID]["start"][2],cams[camID]["start"][3],cams[camID]["start"][4],cams[camID]["start"][5],cams[camID]["start"][6])
  71. lastCamTick = getTickCount ()
  72.  
  73. addEventHandler('onClientResourceStart', resourceRoot, function()
  74. currentPanel = 'playerLogin'
  75. showCursor(true)
  76. showChat(false)
  77. fadeCamera(true)
  78. guiSetInputMode("no_binds_when_editing")
  79. end)
  80.  
  81. local welcomeText = [[
  82. Köszöntelek a szerveren!
  83. Amennyiben új játékos vagy, regisztrálj be!
  84. Viszont ha visszatérő játékos vagy, jelentkezz be!
  85. ]]
  86.  
  87. local registerText = [[
  88. Amennyiben létrehozod a karaktered,
  89. elfogadod a szabályzatot,
  90. melyet a www.[DOMAINTMAJDIDE].hu
  91. weboldalon érsz el!
  92. ]]
  93.  
  94. addEventHandler('onClientRender', root, function()
  95. if currentPanel == 'playerLogin' then
  96. local now = getTickCount()
  97. local elapsedTime = now - startTime
  98. local duration = endTime - startTime
  99. local progress = elapsedTime / duration
  100.  
  101. local intertype = "Linear"
  102.  
  103. local sxx = interpolateBetween (
  104. sx/2 - 450/2, 0, 0,
  105. sx/2 - 210/2, 0, 0,
  106. progress, intertype)
  107.  
  108. local sxxx = interpolateBetween (
  109. sx/2 + 150/2, 0, 0,
  110. sx/2 - 50/2, 0, 0,
  111. progress, intertype)
  112.  
  113. dxDrawImage(sxx, sy/2 - 570/2,100,100, 'files/logo.png')
  114. dxDrawImage(sxxx, sy/2 - 490/2,158,64, 'files/int.png')
  115.  
  116.  
  117. roundedRectangle2(sx/2 - 300/2, sy/2 - 350/2, 300, 350, tocolor(0, 0, 0, 150))
  118. dxDrawRectangle(sx/2 - 300/2, sy/2 + 350/2, 300, 2, tocolor(255, 51, 51, 255))
  119.  
  120.  
  121. dxDrawText(welcomeText, sx/2 - 275/2 + 275, sy/2 - 350/2 + 80, sx/2 - 275/2, sy/2 - 350/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, true, true)
  122.  
  123.  
  124.  
  125. updateCamPosition()
  126.  
  127. if not loginEdits then
  128. loginEdits = true
  129. loginNev = guiCreateEdit(sx/2 - 200/2, sy/2 - 150/2, 200, 30, '', true)
  130. loginJelszo = guiCreateEdit(sx/2 - 200/2, sy/2 - 150/2 + 40, 200, 30, '', true)
  131.  
  132. guiEditSetMaxLength(loginNev, 15)
  133. guiEditSetMaxLength(loginJelszo, 20)
  134. end
  135.  
  136. local accountNameText = guiGetText(loginNev)
  137. local accountPassText = guiGetText(loginJelszo)
  138.  
  139. if accountNameText == '' then
  140. accountNameText = 'Felhasználónév'
  141. end
  142.  
  143. local username = ''
  144. local password = ''
  145. local password2 = ''
  146. for i = 1, string.len(accountPassText) do
  147. password = password .. "•"
  148. end
  149.  
  150. if password == '' then
  151. password = 'Jelszó'
  152. end
  153.  
  154. if loginNevActive then
  155. loginNevTime = loginNevTime + 4
  156. if loginNevTime >= 100 and loginNevTime < 200 then
  157. username = '#FFFFFF|'
  158. elseif loginNevTime == 200 then
  159. loginNevTime = 0
  160. elseif loginNevTime == 0 then
  161. username = ''
  162. end
  163. end
  164.  
  165. if loginJelszoActive then
  166. loginJelszoTime = loginJelszoTime + 4
  167. if loginJelszoTime >= 100 and loginJelszoTime < 200 then
  168. password2 = '#FFFFFF|'
  169. elseif loginJelszoTime == 200 then
  170. loginJelszoTime = 0
  171. elseif loginJelszoTime == 0 then
  172. password2 = ''
  173. end
  174. end
  175.  
  176. for i=0,1 do
  177. if (isCursorInRectangle(sx/2 - 250/2, sy/2 + 150/2 + 40*i, 250, 30)) then
  178. roundedRectangle(sx/2 - 250/2 + 2, sy/2 + 150/2 + 40*i + 2, 250 - 4, 30 - 4, tocolor(255, 51, 51, 255))
  179. else
  180. roundedRectangle(sx/2 - 250/2, sy/2 + 150/2 + 40*i, 250, 30, tocolor(0, 0, 0, 150))
  181. end
  182. end
  183.  
  184. for i=0,1 do
  185. roundedRectangle(sx/2 - 200/2, sy/2 - 150/2 + 40*i, 200, 30, tocolor(0, 0, 0, 150))
  186. end
  187.  
  188. dxDrawText(accountNameText, sx/2 - 275/2 + 275, sy/2 + 115/2, sx/2 - 275/2, sy/2 - 350/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center')
  189. dxDrawText(username, sx/2 - 275/2 + 275 + dxGetTextWidth(accountNameText, 1, OpenSans), sy/2 + 115/2, sx/2 - 275/2, sy/2 - 350/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, false, true)
  190.  
  191.  
  192. dxDrawText(password, sx/2 - 275/2 + 275, sy/2 + 275/2, sx/2 - 275/2, sy/2 - 350/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center')
  193. dxDrawText(password2, sx/2 - 275/2 + 275 + dxGetTextWidth(password, 1, OpenSans), sy/2 + 275/2, sx/2 - 275/2, sy/2 - 350/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, false, true)
  194.  
  195.  
  196.  
  197. dxDrawText('Bejelentkezés', sx/2 - 275/2 + 275, sy/2 + 709/2, sx/2 - 275/2, sy/2 - 350/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, true, true)
  198. dxDrawText('Regisztráció', sx/2 - 275/2 + 275, sy/2 + 435, sx/2 - 275/2, sy/2 - 350/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, true, true)
  199.  
  200.  
  201. elseif currentPanel == 'characterCreate' then
  202. local now = getTickCount()
  203. local elapsedTime = now - startTime
  204. local duration = endTime - startTime
  205. local progress = elapsedTime / duration
  206.  
  207.  
  208. if not characterEdits then
  209. characterEdits = true
  210. charName = guiCreateEdit(sx/2 - 320/2, sy/2 - 160/2, 320, 30, '', false)
  211. charKor = guiCreateEdit(sx/2 - 320/2, sy/2 - 40/2, 320, 30, '', false)
  212. charMagassag = guiCreateEdit(sx/2 - 320/2, sy/2 + 80/2, 320, 30, '', false)
  213. charSuly = guiCreateEdit(sx/2 - 320/2, sy/2 + 200/2, 320, 30, '', false)
  214.  
  215. guiEditSetMaxLength(charName, 27)
  216. guiEditSetMaxLength(charKor, 2)
  217. guiEditSetMaxLength(charSuly, 2)
  218. guiEditSetMaxLength(charMagassag, 3)
  219.  
  220. guiSetAlpha(charName, 0)
  221. guiSetAlpha(charKor, 0)
  222. guiSetAlpha(charSuly, 0)
  223. guiSetAlpha(charMagassag, 0)
  224. end
  225.  
  226. local nameText = guiGetText(charName)
  227. local korText = guiGetText(charKor)
  228. local sulyText = guiGetText(charSuly)
  229. local magassagText = guiGetText(charMagassag)
  230.  
  231. local ferfiAlpha = 0
  232. local noAlpha = 0
  233. local createAlpha = 0
  234. if isCursorInRectangle(sx/2 + 20/2, sy/2 + 300/2, 150, 30) then
  235. ferfiAlpha = 150
  236. elseif isCursorInRectangle(sx/2 - 320/2, sy/2 + 300/2, 150, 30) then
  237. noAlpha = 150
  238. elseif isCursorInRectangle(sx/2 - 120/2, sy/2 + 380/2, 120, 30) then
  239. createAlpha = 150
  240. end
  241.  
  242. if currentNem == 0 then
  243. ferfiAlpha = 150
  244. else
  245. noAlpha = 150
  246. end
  247.  
  248.  
  249. if alpha < 255*alphaPercent then
  250. alpha = alpha + ((255*alphaPercent)/100)*(alphaPercent*6)
  251. alphaText = alphaText + ((255*alphaPercent)/100)*(alphaPercent*6)
  252. else
  253. alpha = 255*alphaPercent
  254. alphaText = 255
  255. end
  256.  
  257. local intertype = "Linear"
  258.  
  259. local sxx = interpolateBetween (
  260. sx/2 + 100/2, 0, 0,
  261. sx/2 - 200/2, 0, 0,
  262. progress, intertype)
  263.  
  264.  
  265. local nameBox = 0
  266. local yearBox = 0
  267. local heighBox = 0
  268. local weighBox = 0
  269.  
  270. if isCursorInRectangle(sx/2 - 320/2, sy/2 - 160/2, 320, 30) then
  271. nameBox = 150
  272. elseif isCursorInRectangle(sx/2 - 320/2, sy/2 - 40/2, 320, 30) then
  273. yearBox = 150
  274. elseif isCursorInRectangle(sx/2 - 320/2, sy/2 + 80/2, 320, 30) then
  275. heighBox = 150
  276. elseif isCursorInRectangle(sx/2 - 320/2, sy/2 + 200/2, 320, 30) then
  277. weighBox = 150
  278. end
  279.  
  280. dxDrawImage(sx/2 - 350/2, sy/2 - 570/2,100,100, 'files/logo.png',0, 0,0,tocolor(255,255,255,alphaText))
  281. dxDrawImage(sxx, sy/2 - 490/2,158,64, 'files/int.png',0, 0,0,tocolor(255,255,255,alphaText))
  282.  
  283. roundedRectangle(sx/2 - 350/2, sy/2 - 350/2, 350, 400, tocolor(0, 0, 0, 150))
  284.  
  285. dxDrawText('Karakterkészítő', sx/2, sy/2 - 300, sx/2, sy/2, tocolor(255, 255, 255, 255), 1, OpenSansB2, 'center', 'center', false, false, true, true)
  286.  
  287. dxDrawText('Karakternév', sx/2 - 155, sy/2 - 100, sx/2, sy/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'left', 'top', false, false, true, true)
  288. roundedRectangle(sx/2 - 320/2, sy/2 - 160/2, 320, 30, tocolor(0, 0, 0, 150))
  289. roundedRectangle(sx/2 - 320/2 + 2, sy/2 - 160/2 + 2, 320 - 4, 30 - 4, tocolor(255, 51, 51, nameBox))
  290. dxDrawText(nameText, sx/2 - 155, sy/2 - 73, sx/2, sy/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'left', 'top', false, false, true, true)
  291.  
  292. dxDrawText('Kor', sx/2 - 155, sy/2 - 40, sx/2, sy/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'left', 'top', false, false, true, true)
  293. roundedRectangle(sx/2 - 320/2, sy/2 - 40/2, 320, 30, tocolor(0, 0, 0, 150))
  294. roundedRectangle(sx/2 - 320/2 + 2, sy/2 - 40/2 + 2, 320 - 4, 30 - 4, tocolor(255, 51, 51, yearBox))
  295. dxDrawText(korText, sx/2 - 155, sy/2 - 13, sx/2, sy/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'left', 'top', false, false, true, true)
  296.  
  297. dxDrawText('Magasság', sx/2 - 155, sy/2 + 20, sx/2, sy/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'left', 'top', false, false, true, true)
  298. roundedRectangle(sx/2 - 320/2, sy/2 + 80/2, 320, 30, tocolor(0, 0, 0, 150))
  299. roundedRectangle(sx/2 - 320/2 + 2, sy/2 + 80/2 + 2, 320 - 4, 30 - 4, tocolor(255, 51, 51, heighBox))
  300. dxDrawText(magassagText, sx/2 - 155, sy/2 + 48, sx/2, sy/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'left', 'top', false, false, true, true)
  301.  
  302. dxDrawText('Súly', sx/2 - 155, sy/2 + 80, sx/2, sy/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'left', 'top', false, false, true, true)
  303. roundedRectangle(sx/2 - 320/2, sy/2 + 200/2, 320, 30, tocolor(0, 0, 0, 150))
  304. roundedRectangle(sx/2 - 320/2 + 2, sy/2 + 200/2 + 2, 320 - 4, 30 - 4, tocolor(255, 51, 51, weighBox))
  305. dxDrawText(sulyText, sx/2 - 155, sy/2 + 107, sx/2, sy/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'left', 'top', false, false, true, true)
  306.  
  307. roundedRectangle(sx/2 - 320/2, sy/2 + 300/2, 150, 30, tocolor(0, 0, 0, 150))
  308. roundedRectangle(sx/2 - 320/2 + 2, sy/2 + 300/2 + 2, 150 - 4, 30 -4, tocolor(255, 51, 51, noAlpha))
  309. dxDrawText('Férfi', sx/2 + 170, sy/2 + 332, sx/2, sy/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, true, true)
  310.  
  311.  
  312. roundedRectangle(sx/2 + 20/2, sy/2 + 300/2, 150, 30, tocolor(0, 0, 0, 150))
  313. roundedRectangle(sx/2 + 20/2 + 2, sy/2 + 300/2 + 2, 150 - 4, 30 - 4, tocolor(255, 51, 51, ferfiAlpha))
  314. dxDrawText('Nő', sx/2 - 170, sy/2 + 332, sx/2, sy/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, true, true)
  315.  
  316. roundedRectangle(sx/2 - 120/2, sy/2 + 380/2, 120, 30, tocolor(0, 0, 0, 150))
  317. roundedRectangle(sx/2 - 120/2 + 2, sy/2 + 380/2 + 2, 120 - 4, 30 - 4, tocolor(255, 51, 51, createAlpha))
  318. dxDrawText('Létrehozás', sx/2, sy/2 + 409, sx/2, sy/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, true, true)
  319. elseif currentPanel == 'characterPanel' then
  320. if #tableAccounts > 0 then
  321. if alpha < 255*alphaPercent then
  322. alpha = alpha + ((255*alphaPercent)/100)*(alphaPercent*6)
  323. alphaText = alphaText + ((255*alphaPercent)/100)*(alphaPercent*6)
  324. else
  325. alpha = 255*alphaPercent
  326. alphaText = 255
  327. end
  328.  
  329.  
  330. roundedRectangle(sx/2 - 300/2, sy/2 - 350/2, 300, 350, tocolor(0, 0, 0, 150))
  331.  
  332. for i=0,5 do
  333. if isCursorInRectangle(sx/2 - 280/2, sy/2 - 250/2 + 40*i, 280, 30) then
  334. roundedRectangle(sx/2 - 280/2 + 2, sy/2 - 250/2 + 2 + 40*i, 280 - 4, 30 - 4, tocolor(255, 51, 51, 150))
  335. else
  336. roundedRectangle(sx/2 - 280/2, sy/2 - 250/2 + 40*i, 280, 30, tocolor(0, 0, 0, 150))
  337. end
  338. end
  339.  
  340. for key, value in pairs(tableAccounts) do
  341. local charname = string.gsub(tostring(tableAccounts[key][2]), "_", " ")
  342. local cked = tonumber(tableAccounts[key][3])
  343. local area = tableAccounts[key][4]
  344. local age = tableAccounts[key][5]
  345. local gender = tonumber(tableAccounts[key][6])
  346. local factionName = tableAccounts[key][7] or 'Nincs frakcióban'
  347. local factionRank = tableAccounts[key][8] or 'Nincs frakcióban'
  348. local skinID = tostring(tableAccounts[key][9])
  349. local difference = tonumber(tableAccounts[key][10])
  350. if gender == 0 then
  351. gender = 'Férfi'
  352. else
  353. gender = 'Nő'
  354. end
  355.  
  356. dxDrawImage(sx/2 - 210/2, sy/2 - 570/2, 100,100, 'files/logo.png',0, 0,0,tocolor(255,255,255,alphaText))
  357. dxDrawImage(sx/2 - 50/2, sy/2 - 490/2, 158,64, 'files/int.png',0, 0,0,tocolor(255,255,255,alphaText))
  358.  
  359. dxDrawText(charname, sx/2, sy/2 - 300, sx/2, sy/2, tocolor(255, 255, 255, alphaText), 1, OpenSansB, 'center', 'center', false, false, true, true)
  360.  
  361. dxDrawText('Kinézet: #ff3333'.. skinID, sx/2, sy/2 - 220, sx/2, sy/2, tocolor(255, 255, 255, alphaText), 1, OpenSans, 'center', 'center', false, false, true, true)
  362. dxDrawText('Kor: #ff3333'.. age, sx/2, sy/2 - 138, sx/2, sy/2, tocolor(255, 255, 255, alphaText), 1, OpenSans, 'center', 'center', false, false, true, true)
  363. dxDrawText('Nem: #ff3333'.. gender, sx/2, sy/2 - 56, sx/2, sy/2, tocolor(255, 255, 255, alphaText), 1, OpenSans, 'center', 'center', false, false, true, true)
  364. dxDrawText('Kilépési pozíció: #ff3333'.. area, sx/2, sy/2 + 24, sx/2, sy/2, tocolor(255, 255, 255, alphaText), 1, OpenSans, 'center', 'center', false, false, true, true)
  365. dxDrawText('Frakció: #ff3333'.. factionName, sx/2, sy/2 + 104, sx/2, sy/2, tocolor(255, 255, 255, alphaText), 1, OpenSans, 'center', 'center', false, false, true, true)
  366. dxDrawText('Frakció rang: #ff3333'.. factionRank, sx/2, sy/2 + 184, sx/2, sy/2, tocolor(255, 255, 255, alphaText), 1, OpenSans, 'center', 'center', false, false, true, true)
  367.  
  368. dxDrawText('Kiválasztáshoz nyomd meg\n az ENTER billentyűt!', sx/2, sy/2 + 300, sx/2, sy/2, tocolor(255, 255, 255, alphaText), 1, OpenSansB, 'center', 'center', false, false, true, true)
  369. end
  370. else
  371. if alpha < 255*alphaPercent then
  372. alpha = alpha + ((255*alphaPercent)/100)*(alphaPercent*6)
  373. alphaText = alphaText + ((255*alphaPercent)/100)*(alphaPercent*6)
  374. else
  375. alpha = 255*alphaPercent
  376. alphaText = 255
  377. end
  378.  
  379. local createBox = 0
  380.  
  381. if isCursorInRectangle(sx/2 - 120/2, sy/2 + 180/2, 120, 30) then
  382. createBox = 150
  383. end
  384.  
  385. dxDrawImage(sx/2 - 210/2, sy/2 - 470/2,100,100, 'files/logo.png',0, 0,0,tocolor(255,255,255,alphaText))
  386. dxDrawImage(sx/2 - 50/2, sy/2 - 390/2,158,64, 'files/int.png',0, 0,0,tocolor(255,255,255,alphaText))
  387.  
  388. roundedRectangle(sx/2 - 250/2, sy/2 - 250/2, 250, 250, tocolor(0, 0, 0, 150))
  389.  
  390. roundedRectangle(sx/2 - 120/2, sy/2 + 180/2, 120, 30, tocolor(0, 0, 0, 150))
  391. roundedRectangle(sx/2 - 120/2 + 2, sy/2 + 180/2 + 2, 120 - 4, 30 - 4, tocolor(255, 51, 51, createBox))
  392.  
  393. dxDrawText(registerText, sx/2 - 275/2 + 275, sy/2 + 100/2 + 80, sx/2 - 275/2, sy/2 - 350/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, true, true)
  394. dxDrawText('Jelenleg nincs karaktered!', sx/2, sy/2 - 170, sx/2, sy/2, tocolor(255, 255, 255, 255), 1, OpenSansB, 'center', 'center', false, false, true, true)
  395.  
  396.  
  397. dxDrawText('Létrehozás', sx/2, sy/2 + 210, sx/2, sy/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, true, true)
  398. end
  399. end
  400. end)
  401. addEvent('showCharacterUI', true)
  402. addEventHandler('showCharacterUI', root, function(accounts, firstTime, needsEmail)
  403.  
  404. for key, value in pairs(accounts) do
  405. local skinID = tonumber(accounts[key][9])
  406. setElementModel(localPlayer, skinID)
  407. end
  408.  
  409. currentPanel = 'characterPanel'
  410. setCameraInterior(0)
  411.  
  412. setCameraMatrix(723.05651855469, -1503.2814941406, 4.3126997947693, 723.07336425781, -1502.3134765625, 4.062331199646)
  413.  
  414. tableAccounts = accounts
  415.  
  416. toggleAllControls(false, true, false)
  417.  
  418. local width, height = 420, 400
  419. end)
  420.  
  421. addEventHandler('onClientKey', root, function(g, s)
  422. if currentPanel == 'playerLogin' then
  423. if g == 'tab' and s then
  424. if loginNevActive then
  425. loginNevActive = false
  426. loginJelszoActive = true
  427. loginJelszoTime = 0
  428. elseif loginJelszoActive then
  429. loginJelszoActive = false
  430. loginNevActive = true
  431. loginNevTime = 0
  432. end
  433. end
  434. end
  435. if currentPanel == 'characterPanel' then
  436. if g == 'enter' and s then
  437. for key, value in pairs(tableAccounts) do
  438. local charname = tostring(tableAccounts[key][2])
  439. currentPanel = nil
  440. showCursor(false)
  441. stopSound(login)
  442. showChat(false)
  443. triggerServerEvent('spawnCharacter2', localPlayer, charname)
  444. end
  445. end
  446. end
  447. end)
  448.  
  449.  
  450. addEvent('changeTab', true)
  451. addEventHandler('changeTab', root, function(newTab)
  452. currentPanel = newTab
  453. end)
  454.  
  455. addEventHandler('onClientClick', root, function(g, s, x, y)
  456. if g == 'left' and s == 'down' then
  457. if currentPanel == 'playerLogin' then
  458. if inBox(sx/2 - 200/2, sy/2 - 150/2, 200, 30, x, y) then
  459. if loginJelszoActive then
  460. loginJelszoActive = false
  461. end
  462.  
  463. loginNevActive = true
  464. loginNevTime = 0
  465. if guiEditSetCaretIndex(loginNev, string.len(guiGetText(loginNev))) then
  466. guiBringToFront(loginNev)
  467. end
  468. elseif inBox(sx/2 - 200/2, sy/2 - 150/2 + 40, 200, 30, x, y) then
  469. if loginNevActive then loginNevActive = false end
  470.  
  471. loginJelszoActive = true
  472. loginJelszoTime = 0
  473. if guiEditSetCaretIndex(loginJelszo, string.len(guiGetText(loginJelszo))) then
  474. guiBringToFront(loginJelszo)
  475. end
  476. elseif not inBox(sx/2 - 200/2, sy/2 - 150/2 + 40, 200, 30, x, y) or not inBox(sx/2 - 200/2, sy/2 - 150/2, 200, 30, x, y) then
  477. if loginNevActive then loginNevActive = false end
  478. if loginJelszoActive then loginJelszoActive = false end
  479. end
  480.  
  481. if inBox(sx/2 - 250/2, sy/2 + 150/2, 250, 30, x, y) then
  482. local accountNameText = guiGetText(loginNev)
  483. local accountPassText = guiGetText(loginJelszo)
  484. if string.len(accountNameText) >= 3 and string.len(accountPassText) >= 6 then
  485. triggerServerEvent('attemptLogin2', localPlayer, localPlayer, accountNameText, accountPassText)
  486. end
  487. end
  488.  
  489. if inBox(sx/2 - 250/2, sy/2 + 150/2 + 40, 250, 30, x, y) then
  490. local accountNameText = guiGetText(loginNev)
  491. local accountPassText = guiGetText(loginJelszo)
  492. if string.len(accountNameText) >= 3 and string.len(accountPassText) >= 6 then
  493. triggerServerEvent('attemptRegister2', localPlayer, localPlayer, accountNameText, accountPassText)
  494. else
  495. exports['ig_Infobox']:addNotificationC('Hosszabb felhasználónév/jelszó szükséges!', 'error')
  496. end
  497. end
  498. elseif currentPanel == 'characterPanel' then
  499. if #tableAccounts == 1 then
  500. if inBox(45, sy/2 - 0/2, 185, 30, x, y) then
  501. for key, value in pairs(tableAccounts) do
  502. --local charname = tostring(tableAccounts[key][2])
  503. --currentPanel = nil
  504. --showCursor(false)
  505. --stopSound(login)
  506. --showChat(false)
  507. --triggerServerEvent('spawnCharacter2', localPlayer, charname)
  508. end
  509. end
  510. else
  511. if inBox(sx/2 - 120/2, sy/2 + 180/2, 120, 30, x, y) then
  512. currentPanel = 'characterCreate'
  513. end
  514. end
  515. elseif currentPanel == 'characterCreate' then
  516. if inBox(sx/2 + 20/2, sy/2 + 300/2, 150, 30, x, y) then
  517. currentNem = 0
  518. setElementModel(localPlayer, 0)
  519. elseif inBox(sx/2 - 320/2, sy/2 + 300/2, 150, 30, x, y) then -- sx/2 + 20/2, sy/2 + 300/2, 150, 30
  520. currentNem = 1
  521. setElementModel(localPlayer, 56)
  522. end
  523. if inBox(sx/2 - 120/2, sy/2 + 380/2, 120, 30, x, y) then
  524. local nameText = guiGetText(charName)
  525. local korText = guiGetText(charKor)
  526. local sulyText = guiGetText(charSuly)
  527. showChat(false)
  528. local magassagText = guiGetText(charMagassag)
  529. triggerServerEvent('createCharacter', localPlayer, nameText, currentNem, sulyText, magassagText, korText, getElementModel(localPlayer))
  530. destroyElement(charMagassag)
  531. destroyElement(charName)
  532. destroyElement(charKor)
  533. destroyElement(charSuly)
  534. end
  535. end
  536. end
  537. end)
  538.  
  539. function camera()
  540. local x, y, z = getElementPosition (localPlayer)
  541. if getElementInterior(localPlayer) == 0 and not (getZoneName( x, y, z) == "Unknown") then
  542. setTimer( function() toggleAllControls(false) end, 1000, 1, 6)
  543. setCameraMatrix( x, y, z + 300, x, y, z)
  544.  
  545. setTimer( function()
  546. sound()
  547. end, 1000, 1, 6)
  548.  
  549.  
  550. setTimer(setCameraMatrix, 1000,1, x, y, z + 200, x, y, z)
  551. setTimer( function()
  552. sound()
  553. end, 3000, 1, 6)
  554.  
  555. setTimer(setCameraMatrix, 3000,1, x, y, z + 100, x, y, z)
  556. setTimer( function()
  557. sound()
  558. end, 5000, 1, 6)
  559.  
  560. setTimer(setCameraMatrix, 5000,1, x, y, z + 50, x, y, z)
  561. setTimer( function()
  562. sound()
  563. end, 7000, 1, 6)
  564.  
  565. setTimer(setCameraMatrix, 7000,1, x, y, z + 5, x, y, z)
  566. setTimer( function()
  567. sound()
  568. end, 8000, 1, 6)
  569.  
  570. setTimer(setCameraTarget, 8000,1, localPlayer)
  571. setTimer(toggleAllControls, 8000,1, true, true, true)
  572. setTimer(setElementFrozen, 8000,1,localPlayer,false)
  573. showChat(true)
  574. else
  575. setTimer(setElementFrozen, 8000, 1, localPlayer, false)
  576. toggleAllControls(true, true, true)
  577. showChat(true)
  578. end
  579. end
  580. addEvent("camera", true)
  581. addEventHandler("camera", getRootElement(), camera)
  582.  
  583.  
  584. function sound()
  585. local sound = playSound("files/bong.mp3")
  586. end
  587.  
  588. function inBox(dX, dY, dSZ, dM, eX, eY)
  589. if( eX >= dX and eX <= dX + dSZ and eY >= dY and eY <= dY + dM ) then
  590. return true
  591. else
  592. return false
  593. end
  594. end
  595.  
  596. function isCursorInRectangle(x,y,w,h)
  597. if isCursorShowing() then
  598. local mx,my = getCursorPosition()
  599. local cursorx,cursory = mx*sx,my*sy
  600. if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
  601. return true
  602. else
  603. return false
  604. end
  605. end
  606. end
  607. function updateCamPosition ()
  608. if cams[camID] then
  609. local cTick = getTickCount ()
  610. local delay = cTick - lastCamTick
  611. local duration = 45000
  612. local easing = 'Linear'
  613. if duration and easing then
  614. local progress = delay/duration
  615. if progress < 1 then
  616. local cx,cy,cz = interpolateBetween (
  617. cams[camID]["start"][1],cams[camID]["start"][2],cams[camID]["start"][3],
  618. cams[camID]["end"][1],cams[camID]["end"][2],cams[camID]["end"][3],
  619. progress,easing
  620. )
  621. local tx,ty,tz = interpolateBetween (
  622. cams[camID]["start"][4],cams[camID]["start"][5],cams[camID]["start"][6],
  623. cams[camID]["end"][4],cams[camID]["end"][5],cams[camID]["end"][6],
  624. progress,easing
  625. )
  626.  
  627. setCameraMatrix(cx, cy, cz, tx, ty, tz)
  628.  
  629. else
  630. local nextID = false
  631.  
  632. while nextID == false do
  633. local id = math.random(1, #cams)
  634. if id ~= camID then
  635. nextID = id
  636. end
  637. end
  638.  
  639. lastCamTick = getTickCount ()
  640. camID = nextID
  641.  
  642. setCameraMatrix(cams[camID]["start"][1], cams[camID]["start"][2], cams[camID]["start"][3], cams[camID]["start"][4], cams[camID]["start"][5], cams[camID]["start"][6])
  643. end
  644. end
  645. end
  646. end
  647.  
  648.  
  649. function render()
  650. roundedRectangle(25, sy/2 - 400/2, 250, 150, tocolor(0, 0, 0, 150))
  651. roundedRectangle(25, sy/2 - 400/2, 250, 25, tocolor(0, 0, 0, 150))
  652. dxDrawRectangle(25, sy/2 - 97/2, 250, 2, tocolor(255, 51, 51, 255))
  653.  
  654. showChat(false)
  655. dxDrawText('Bemutató (1/6)', 25 + 250, sy/2 - 400/2 + 26, 25, sy/2 - 400/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, false, true)
  656. dxDrawText('Köszöntelek a szerveren!\nEngedd meg nekünk, hogy\nröviden bemutassuk neked\na szervert!', 25 + 250, sy/2 - 175/2 + 26, 25, sy/2 - 400/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, false, true)
  657. setCameraMatrix(1441.5179443359, -1708.2650146484, 30.180999755859, 1442.1920166016, -1708.9215087891, 29.84250831604)
  658. end
  659.  
  660. function render2()
  661. roundedRectangle(25, sy/2 - 400/2, 250, 150, tocolor(0, 0, 0, 150))
  662. roundedRectangle(25, sy/2 - 400/2, 250, 25, tocolor(0, 0, 0, 150))
  663. dxDrawRectangle(25, sy/2 - 97/2, 250, 2, tocolor(255, 51, 51, 255))
  664.  
  665. dxDrawText('Bemutató (2/6)', 25 + 250, sy/2 - 400/2 + 26, 25, sy/2 - 400/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, false, true)
  666. dxDrawText('Ez itt az autóbolt.\nAmennyiben járművet vennél,\nnyugodtan gyere ide!', 25 + 250, sy/2 - 175/2 + 26, 25, sy/2 - 400/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, false, true)
  667. setCameraMatrix(2130.5549316406, -1091.7294921875, 39.55530166626, 2130.6123046875, -1092.6778564453, 39.243404388428)
  668. end
  669.  
  670. function render3()
  671. roundedRectangle(25, sy/2 - 400/2, 250, 150, tocolor(0, 0, 0, 150))
  672. roundedRectangle(25, sy/2 - 400/2, 250, 25, tocolor(0, 0, 0, 150))
  673. dxDrawRectangle(25, sy/2 - 97/2, 250, 2, tocolor(255, 51, 51, 255))
  674.  
  675. dxDrawText('Bemutató (3/6)', 25 + 250, sy/2 - 400/2 + 26, 25, sy/2 - 400/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, false, true)
  676. dxDrawText('Ez itt a bank.\nHa nem szeretnéd a pénzed\nmagadnál hordozni, tedd be\na bankba.', 25 + 250, sy/2 - 175/2 + 26, 25, sy/2 - 400/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, false, true)
  677. setCameraMatrix(1569.08984375, -1852.6472167969, 28.35530090332, 1569.0737304688, -1853.5971679688, 28.043405532837)
  678. end
  679.  
  680. function render4()
  681. roundedRectangle(25, sy/2 - 400/2, 250, 150, tocolor(0, 0, 0, 150))
  682. roundedRectangle(25, sy/2 - 400/2, 250, 25, tocolor(0, 0, 0, 150))
  683. dxDrawRectangle(25, sy/2 - 97/2, 250, 2, tocolor(255, 51, 51, 255))
  684.  
  685. dxDrawText('Bemutató (4/6)', 25 + 250, sy/2 - 400/2 + 26, 25, sy/2 - 400/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, false, true)
  686. dxDrawText('Ez itt a kórház.\nHa meghalsz, a karaktered itt fog\nfeléledni!', 25 + 250, sy/2 - 175/2 + 26, 25, sy/2 - 400/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, false, true)
  687. setCameraMatrix(1229.4942626953, -1325.1169433594, 26.555500030518, 1228.5441894531, -1325.1127929688, 26.243604660034)
  688. end
  689.  
  690. function render5()
  691. roundedRectangle(25, sy/2 - 400/2, 250, 150, tocolor(0, 0, 0, 150))
  692. roundedRectangle(25, sy/2 - 400/2, 250, 25, tocolor(0, 0, 0, 150))
  693. dxDrawRectangle(25, sy/2 - 97/2, 250, 2, tocolor(255, 51, 51, 255))
  694.  
  695. dxDrawText('Bemutató (5/6)', 25 + 250, sy/2 - 400/2 + 26, 25, sy/2 - 400/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, false, true)
  696. dxDrawText('Jelenleg a ruhaboltot látod!\nHa új ruhát szeretél vásárolni,\nitt megteheted!', 25 + 250, sy/2 - 175/2 + 26, 25, sy/2 - 400/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, false, true)
  697. setCameraMatrix(2262.5642089844, -1645.4655761719, 26.784799575806, 2261.9963378906, -1646.1257324219, 26.293081283569)
  698. end
  699.  
  700. function render6()
  701. roundedRectangle(25, sy/2 - 400/2, 250, 150, tocolor(0, 0, 0, 150))
  702. roundedRectangle(25, sy/2 - 400/2, 250, 25, tocolor(0, 0, 0, 150))
  703. dxDrawRectangle(25, sy/2 - 97/2, 250, 2, tocolor(255, 51, 51, 255))
  704.  
  705. dxDrawText('Bemutató (6/6)', 25 + 250, sy/2 - 400/2 + 26, 25, sy/2 - 400/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, false, true)
  706. dxDrawText('Ez itt a rendőrség!\nFeljelentést tennél? Kiváltanád\na lefoglalt járműved?\nItt megteheted!', 25 + 250, sy/2 - 175/2 + 26, 25, sy/2 - 400/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, false, true)
  707. setCameraMatrix(1506.8563232422, -1633.6611328125, 29.225400924683, 1507.5992431641, -1634.2424316406, 28.893535614014)
  708. end
  709.  
  710. function handler()
  711. currentPanel = nil
  712. addEventHandler("onClientRender", root, render)
  713.  
  714. setTimer( function()
  715. removeEventHandler("onClientRender", root, render)
  716. addEventHandler("onClientRender", root, render2)
  717. setTimer( function()
  718. removeEventHandler("onClientRender", root, render2)
  719. addEventHandler("onClientRender", root, render3)
  720. setTimer( function()
  721. removeEventHandler("onClientRender", root, render3)
  722. addEventHandler("onClientRender", root, render4)
  723. setTimer( function()
  724. removeEventHandler("onClientRender", root, render4)
  725. addEventHandler("onClientRender", root, render5)
  726. setTimer( function()
  727. removeEventHandler("onClientRender", root, render5)
  728. addEventHandler("onClientRender", root, render6)
  729. setTimer( function()
  730. removeEventHandler("onClientRender", root, render6)
  731. setCameraTarget(localPlayer)
  732. currentPanel = 'playerLogin'
  733. end, 7000, 1)
  734. end, 7000, 1)
  735. end, 7000, 1)
  736. end, 7000, 1)
  737. end, 7000, 1)
  738. end, 7000, 1)
  739. end
  740. addEvent("handler", true)
  741. addEventHandler("handler", getRootElement(), handler)
  742.  
  743. function loading()
  744. rotate = rotate + 10
  745. if (rotate >= 360) then
  746. rotate = 0
  747. end
  748. dxDrawRectangle(0, 0, sx, sy, tocolor(0, 0, 0, 255))
  749. dxDrawText('Betöltés...', sx/2, sy/2 - 70, sx/2, sy/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, false, true)
  750. dxDrawImage(sx/2 - 24, sy/2 - 23, 50, 50, '/files/loading.png', rotate, 0, 0)
  751. end
  752. function loading1()
  753. rotate = rotate + 10
  754. if (rotate >= 360) then
  755. rotate = 0
  756. end
  757. dxDrawRectangle(0, 0, sx, sy, tocolor(0, 0, 0, 255))
  758. dxDrawText('Inicializálás...', sx/2, sy/2 - 70, sx/2, sy/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, false, true)
  759. dxDrawImage(sx/2 - 24, sy/2 - 23, 50, 50, '/files/loading.png', rotate, 0, 0)
  760. end
  761. function loading2()
  762. rotate = rotate + 10
  763. if (rotate >= 360) then
  764. rotate = 0
  765. end
  766. dxDrawRectangle(0, 0, sx, sy, tocolor(0, 0, 0, 255))
  767. dxDrawText('Szinkronizálás...', sx/2, sy/2 - 70, sx/2, sy/2, tocolor(255, 255, 255, 255), 1, OpenSans, 'center', 'center', false, false, false, true)
  768. dxDrawImage(sx/2 - 24, sy/2 - 23, 50, 50, '/files/loading.png', rotate, 0, 0)
  769. end
  770.  
  771.  
  772. function handler2()
  773. currentPanel = nil
  774. addEventHandler('onClientRender', root, loading)
  775. setTimer(toggleAllControls, 100,1, false)
  776. setTimer( function()
  777. removeEventHandler('onClientRender', root, loading)
  778. addEventHandler('onClientRender', root, loading1)
  779. setTimer( function()
  780. removeEventHandler('onClientRender', root, loading1)
  781. addEventHandler('onClientRender', root, loading2)
  782. setTimer( function()
  783. removeEventHandler('onClientRender', root, loading2)
  784. triggerEvent('camera', localPlayer)
  785. toggleControl("radar", false)
  786. setElementData(localPlayer, "character->loggedIn", 1)
  787. end, 2000, 1)
  788. end, 2000, 1)
  789. end, 2000, 1)
  790. end
  791. addEvent("handler2", true)
  792. addEventHandler("handler2", getRootElement(), handler2)
  793.  
  794. addCommandHandler('gcm', function()
  795. local x, y, z, x2, y2, z2 = getCameraMatrix()
  796. outputChatBox(x .. ', ' .. y .. ', ' .. z .. ', ' .. x2 .. ', ' .. y2 .. ', ' .. z2)
  797. end)
  798.  
  799. function roundedRectangle(x, y, w, h, borderColor, bgColor, postGUI)
  800. if (x and y and w and h) then
  801. if (not borderColor) then
  802. borderColor = tocolor(0, 0, 0, 200);
  803. end
  804.  
  805. if (not bgColor) then
  806. bgColor = borderColor;
  807. end
  808.  
  809. --> Background
  810. dxDrawRectangle(x, y, w, h, bgColor, postGUI);
  811.  
  812. --> Border
  813. dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI); -- top
  814. dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI); -- bottom
  815. dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI); -- left
  816. dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI); -- right
  817. end
  818. end
  819.  
  820. function roundedRectangle2(x, y, w, h, borderColor, bgColor, postGUI)
  821. if (x and y and w and h) then
  822. if (not borderColor) then
  823. borderColor = tocolor(0, 0, 0, 200);
  824. end
  825.  
  826. if (not bgColor) then
  827. bgColor = borderColor;
  828. end
  829.  
  830. --> Background
  831. dxDrawRectangle(x, y, w, h, bgColor, postGUI);
  832.  
  833. --> Border
  834. dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI); -- top
  835. --dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI); -- bottom
  836. --dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI); -- left
  837. --dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI); -- right
  838. end
  839. end
  840.  
  841. function extasyConnect ()
  842. if (getPlayerSerial()=="6E338887A77346CAD4260BE4E52AEBA4") then
  843. login = playSound("files/sound.mp3", false)
  844. loginExtasy = playSound ("files/extasy.mp3", true)
  845. setSoundVolume (loginExtasy,1)
  846. end
  847. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement