Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.76 KB | None | 0 0
  1. --[[
  2. Autor: Malentas
  3. ]]
  4.  
  5. if getElementData(localPlayer, "zalogowany") then return end
  6.  
  7. local screenW, screenH = guiGetScreenSize()
  8. local rozx, rozy = screenW/1440, screenH/900
  9.  
  10. local tlo = dxCreateTexture("img/tlo.png", "argb", true, "clamp")
  11.  
  12. sx,sy = guiGetScreenSize()
  13. x,y = (sx/1366), (sy/768)
  14. messages = {}
  15. editBox = {}
  16. editBox.__index = editBox
  17. editBox.instances = {}
  18. local sm = {}
  19. sm.moov = 0
  20. sm.object1,sm.object2 = nil,nil
  21.  
  22. local muzyka = false
  23. local zapamietaj = true
  24.  
  25. local domki = { }
  26.  
  27. local sx, sy = guiGetScreenSize()
  28.  
  29. function mysz(psx,psy,pssx,pssy,abx,aby)
  30. if not isCursorShowing() then return end
  31. cx,cy=getCursorPosition()
  32. cx,cy=cx*sx,cy*sy
  33. if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
  34. return true,cx,cy
  35. else
  36. return false
  37. end
  38. end
  39.  
  40. panel = false
  41. logowanie = false
  42. rejestracja = false
  43. changelog = false
  44. regulamin = false
  45.  
  46. addEventHandler("onClientClick", root, function(button, state)
  47. local login = g.nick.text
  48. local haslo = g.haslo.text
  49. if button == "left" and state == "down" and mysz(1249*rozx, 526*rozy, 1357*rozx, 557*rozy) and logowanie == true then
  50. if login:len() < 3 then
  51. zmienPowiadomienie("Podany login ma za mało znaków.")
  52. return
  53. end
  54. if haslo:len() < 3 then
  55. zmienPowiadomienie("Podane hasło ma za mało znaków.")
  56. return
  57. end
  58. login = string.gsub(login, "[ ]", "")
  59. haslo = string.gsub(haslo, "[ ]", "")
  60. triggerServerEvent("zaloguj", localPlayer, login, haslo)
  61. elseif button == "left" and state == "down" and mysz(1249*rozx, 526*rozy, 1357*rozx, 557*rozy) and rejestracja == true then
  62. if login:len() < 3 then
  63. zmienPowiadomienie("Podany login ma za mało znaków.")
  64. return
  65. end
  66. if haslo:len() < 3 then
  67. zmienPowiadomienie("Podany hasło ma za mało znaków.")
  68. return
  69. end
  70. login = string.gsub(login, "[ ]", "")
  71. haslo = string.gsub(haslo, "[ ]", "")
  72. triggerServerEvent("zarejestruj", localPlayer, login, haslo)
  73. end
  74. end)
  75.  
  76. local czcionka = dxCreateFont("cz.ttf", 10)
  77. local czcionka2 = dxCreateFont("cz.ttf", 12)
  78. local czcionka3 = dxCreateFont("cz.ttf", 22)
  79.  
  80. function gui()
  81. setCameraMatrix(1283.2510986328, -2005.490234375, 97.91300201416, 1282.3190917969, -2005.6629638672, 97.594230651855)
  82. if muzyka then
  83. local bit = getSoundFFTData(muzyka, 2048, 3)
  84. for i,v in ipairs(bit) do
  85. rytm = math.round((v*320),0)>100 and 100 or math.round((v*320),0)
  86. dxDrawImage(535*rozx, 255*rozy, 400*rozx, 400*rozy, "img/podswietlenie.png", 0, 0, 0, tocolor(26, 177, 133, rytm), false)
  87. end
  88. end
  89. local alph = interpolateBetween(0, 0, 0, 255, 0, 0, (getTickCount() - tick)/1000, "Linear")
  90. dxDrawImage(580*rozx, 302*rozy, 826*rozx, 297*rozy, tlo, 0, 0, 0, tocolor(255, 255, 255, alph), false)
  91. if mysz(61*rozx, 52*rozy, 188*rozx, 188*rozy) or logowanie == true then
  92. dxDrawImage(61*rozx, 52*rozy, 188*rozx, 188*rozy, ":np-logowanie/img/logowanie_on.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  93. else
  94. dxDrawImage(61*rozx, 52*rozy, 188*rozx, 188*rozy, ":np-logowanie/img/logowanie_off.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  95. end
  96. if mysz(61*rozx, 250*rozy, 188*rozx, 188*rozy) or rejestracja == true then
  97. dxDrawImage(61*rozx, 250*rozy, 188*rozx, 188*rozy, ":np-logowanie/img/rejestracja_on.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  98. else
  99. dxDrawImage(61*rozx, 250*rozy, 188*rozx, 188*rozy, ":np-logowanie/img/rejestracja_off.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  100. end
  101. if mysz(61*rozx, 448*rozy, 188*rozx, 188*rozy) or changelog == true then
  102. dxDrawImage(61*rozx, 448*rozy, 188*rozx, 188*rozy, ":np-logowanie/img/changelog_on.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  103. else
  104. dxDrawImage(61*rozx, 448*rozy, 188*rozx, 188*rozy, ":np-logowanie/img/changelog_off.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  105. end
  106. if mysz(61*rozx, 646*rozy, 188*rozx, 188*rozy) or regulamin == true then
  107. dxDrawImage(61*rozx, 646*rozy, 188*rozx, 188*rozy, ":np-logowanie/img/regulamin_on.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  108. else
  109. dxDrawImage(61*rozx, 646*rozy, 188*rozx, 188*rozy, ":np-logowanie/img/regulamin_off.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  110. end
  111. if logowanie == true then
  112. dxDrawImage(902*rozx, 453*rozy, 275*rozx, 45*rozy, ":np-logowanie/img/editbox.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
  113. dxDrawImage(902*rozx, 376*rozy, 275*rozx, 45*rozy, ":np-logowanie/img/editbox.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
  114. if zapamietaj == true then
  115. dxDrawImage(1029*rozx, 514*rozy, 148*rozx, 26*rozy, ":np-logowanie/img/save_on.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
  116. else
  117. dxDrawImage(1029*rozx, 514*rozy, 148*rozx, 26*rozy, ":np-logowanie/img/save_off.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
  118. end
  119. dxDrawText("NewPlace", 1198*rozx, 393*rozy, 1396*rozx, 438*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
  120. dxDrawText("Życzymy miłej rozgrywki", 1198*rozx, 448*rozy, 1396*rozx, 493*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka, "center", "center", false, false, false, false, false)
  121. dxDrawImage(1239*rozx, 521*rozy, 119*rozx, 42*rozy, ":np-logowanie/img/button_off.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
  122. dxDrawText("Zaloguj", 1245*rozx, 526*rozy, 1357*rozx, 557*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka, "center", "center", false, false, false, false, false)
  123. end
  124. if rejestracja == true then
  125. dxDrawImage(902*rozx, 453*rozy, 275*rozx, 45*rozy, ":np-logowanie/img/editbox.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
  126. dxDrawImage(902*rozx, 376*rozy, 275*rozx, 45*rozy, ":np-logowanie/img/editbox.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
  127. dxDrawText("NewPlace", 1198*rozx, 393*rozy, 1396*rozx, 438*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
  128. dxDrawText("Życzymy miłej rozgrywki", 1198*rozx, 448*rozy, 1396*rozx, 493*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka, "center", "center", false, false, false, false, false)
  129. dxDrawImage(1239*rozx, 521*rozy, 119*rozx, 42*rozy, ":np-logowanie/img/button_off.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
  130. dxDrawText("Zarejestruj", 1245*rozx, 526*rozy, 1357*rozx, 557*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka, "center", "center", false, false, false, false, false)
  131. end
  132. if regulamin == true then
  133. dxDrawText("Regulamin serwera NewPlace", 885*rozx, 308*rozy, 1404*rozx, 357*rozy, tocolor(255, 255, 255, alph), 0.75, czcionka2, "center", "center", false, false, false, false, false)
  134. dxDrawText("Do Aktualizacji", 885*rozx, 357*rozy, 1404*rozx, 579*rozy, tocolor(255, 255, 255, alph), 0.75, czcionka, "center", "center", false, false, false, false, false)
  135. end
  136. if changelog == true then
  137. dxDrawText("Aktualizacje", 885*rozx, 308*rozy, 1404*rozx, 357*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
  138. dxDrawText("25.05.2018 - Oficjalny start serwera", 885*rozx, 357*rozy, 1404*rozx, 579*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka, "center", "center", false, false, false, false, false)
  139. end
  140. --
  141. for k,self in pairs(editBox.instances) do
  142. if self.visible then
  143. local px,py,pw,ph = self:getPosition()
  144. local text = self.masked and string.gsub(self.text,".","•") or self.text
  145. local alignX = dxGetTextWidth(text,self.scale,self.font) <= pw and "left" or "right"
  146. --roundedRectangle(px, py, pw, ph, tocolor(unpack(self.color)), false)
  147. dxDrawText(text,px+x*5, py,px-x*5+pw, py+ph,tocolor(255, 255, 255, alph),self.scale,self.font, alignX, "center",true)
  148. if self.input and dxGetTextWidth(text,self.scale,self.font) <= pw then
  149. local lx = dxGetTextWidth(text,self.scale,self.font)+px+x*8
  150. local lx = dxGetTextWidth(text,self.scale,self.font)+px+x*8
  151. dxDrawLine(lx, py+y*10, lx, py+ph-y*10, tocolor(255,255,255,math.abs(math.sin(getTickCount()/300))*200), 2)
  152. end
  153. end
  154. end
  155. ---
  156. if getKeyState("backspace") then
  157. for k,self in pairs(editBox.instances) do
  158. if self.visible and self.input then
  159. if not keyState then
  160. keyState = getTickCount() + 400
  161. self.text = string.sub(self.text,1,string.len(self.text)-1)
  162. elseif keyState and keyState < getTickCount() then
  163. keyState = getTickCount()+100
  164. self.text = string.sub(self.text,1,string.len(self.text)-1)
  165. end
  166. return
  167. end
  168. end
  169. keyState = nil
  170. end
  171. --
  172. end
  173.  
  174. function math.round(number, decimals, method)
  175. decimals = decimals or 0
  176. local factor = 10 ^ decimals
  177. if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor
  178. else return tonumber(("%."..decimals.."f"):format(number)) end
  179. end
  180.  
  181.  
  182. local font = dxCreateFont("cz.ttf", 13)
  183.  
  184. function onClientClick(button,state,cX,cY)
  185. if not isCursorShowing() then
  186. return
  187. end
  188. if button == "left" and state == "up" then
  189. for k,self in pairs(editBox.instances) do
  190. if self.visible then
  191. if self.input then
  192. self.input = nil
  193. self.onOutput()
  194. end
  195. local x,y,w,h = self:getPosition()
  196. if mysz(x,y,w,h) then
  197. self.input = true
  198. self.onInput()
  199. tick222 = getTickCount()
  200. end
  201. end
  202. end
  203. end
  204. end
  205. addEventHandler("onClientClick", root, onClientClick)
  206.  
  207. addEventHandler("onClientClick", root, function(btn, state)
  208. if btn == "left" and state == "down" then
  209. if mysz(1032*rozx, 516*rozy, 20*rozx, 23*rozy) and logowanie == true then
  210. playSound("click.mp3", false)
  211. if zapamietaj == true then
  212. zapamietaj = false
  213. elseif zapamietaj == false then
  214. zapamietaj = true
  215. end
  216. --panel
  217. elseif mysz(61*rozx, 52*rozy, 188*rozx, 188*rozy) and panel == true and logowanie ~= true then
  218. logowanie = true
  219. g.nick.visible = true
  220. g.haslo.visible = true
  221. rejestracja = false
  222. changelog = false
  223. regulamin = false
  224. tick = getTickCount()
  225. elseif mysz(61*rozx, 250*rozy, 188*rozx, 188*rozy) and panel == true and rejestracja ~= true then
  226. logowanie = false
  227. rejestracja = true
  228. g.nick.visible = true
  229. g.haslo.visible = true
  230. changelog = false
  231. regulamin = false
  232. tick = getTickCount()
  233. elseif mysz(61*rozx, 448*rozy, 188*rozx, 188*rozy) and panel == true and changelog ~= true then
  234. logowanie = false
  235. rejestracja = false
  236. changelog = true
  237. regulamin = false
  238. g.nick.visible = false
  239. g.haslo.visible = false
  240. tick = getTickCount()
  241. elseif mysz(61*rozx, 646*rozy, 188*rozx, 188*rozy) and panel == true and regulamin ~= true then
  242. logowanie = false
  243. rejestracja = false
  244. changelog = false
  245. regulamin = true
  246. g.nick.visible = false
  247. g.haslo.visible = false
  248. tick = getTickCount()
  249. end
  250. end
  251. end)
  252.  
  253. okno1 = false
  254.  
  255. local spawn = 1
  256. local gui2s = false
  257. local spawn1 = "Urząd miasta, Los Santos"
  258.  
  259. function usun()
  260. removeEventHandler("onClientRender", root, gui2)
  261. gui2s = false
  262. showChat(true)
  263. showCursor(false)
  264. stopSound(muzyka)
  265. destroyElement(ped)
  266. if samolocik == true then
  267. local samolot = createVehicle(592, 2071.44, -2494.35, 16.74, 350, 0, 90)
  268. setCameraMatrix(2030.5219726563, -2531.9909667969, 20.844900131226, 2031.2567138672, -2531.3178710938, 20.759534835815)
  269. setElementData(samolot, "samolot", true)
  270. setElementFrozen(samolot, true)
  271. setElementData(localPlayer, "hud", true)
  272. showChat(false)
  273. showPlayerHudComponent("all", false)
  274. showPlayerHudComponent ("health", false)
  275. showPlayerHudComponent ("clock", false)
  276. showPlayerHudComponent ("breath", false)
  277. showPlayerHudComponent ("weapon", false)
  278. showPlayerHudComponent ("armour", false)
  279. showPlayerHudComponent ("ammo", false)
  280. end
  281. end
  282.  
  283. function gui2()
  284. local alph = interpolateBetween(0, 0, 0, 255, 0, 0, (getTickCount() - tick2)/1000, "Linear")
  285. dxDrawImage(322*rozx, 214*rozy, 275*rozx, 376*rozy, ":np-gui/grafiki/tlo.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
  286. dxDrawImage(891*rozx, 214*rozy, 275*rozx, 376*rozy, ":np-gui/grafiki/tlo.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
  287. dxDrawImage(929*rozx, 277*rozy, 201*rozx, 49*rozy, ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
  288. dxDrawText("Wybór spawnu", 891*rozx, 214*rozy, 1166*rozx, 263*rozy, tocolor(255, 255, 255, 255), 1.00, czcionka2, "center", "center", false, false, false, false, false)
  289. dxDrawImage(929*rozx, 336*rozy, 201*rozx, 49*rozy, ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
  290. dxDrawImage(929*rozx, 395*rozy, 201*rozx, 49*rozy, ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
  291. dxDrawImage(929*rozx, 454*rozy, 201*rozx, 49*rozy, ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
  292. --dxDrawImage(929*rozx, 513*rozy, 201*rozx, 49*rozy, ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, alph), false)
  293. dxDrawText("Spawn Los Santos", 929*rozx, 278*rozy, 1130*rozx, 326*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
  294. dxDrawText("Przechowalnia", 929*rozx, 336*rozy, 1130*rozx, 384*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
  295. dxDrawText("Ostatnia pozycja", 929*rozx, 395*rozy, 1130*rozx, 443*rozy, tocolor(255, 255, alph, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
  296. dxDrawText("Spawn Las Venturas", 929*rozx, 454*rozy, 1130*rozx, 502*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
  297. --dxDrawText("Gdzies2", 929*rozx, 512*rozy, 1130*rozx, 560*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
  298. dxDrawText("Informacje o postaci", 321*rozx, 213*rozy, 597*rozx, 278*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
  299. dxDrawText("Nickname: "..getPlayerName(localPlayer).."\nDBID: "..getElementData(localPlayer, "dbid").."\nPieniądze: "..getElementData(localPlayer, "pieniadze").." PLN\nBankomat: "..getElementData(localPlayer, "bankomat").." PLN", 321*rozx, 276*rozy, 597*rozx, 590*rozy, tocolor(255, 255, 255, alph), 1.00, czcionka2, "center", "center", false, false, false, false, false)
  300. if #domki > 0 then
  301. dxDrawImage(1187*rozx, 214*rozy, 239*rozx, 375*rozy, ":np-gui/grafiki/tlo.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  302. dxDrawText("Dodatkowe spawny", 1186*rozx, 214*rozy, 1426*rozx, 252*rozy, tocolor(255, 255, 255, 255), 1.00, czcionka2, "center", "center", false, false, false, false, false)
  303. for i, v in ipairs(domki) do
  304. local dodatekY = (50*rozy)*(i-1)
  305. dxDrawImage(1205*rozx, 262*rozy+dodatekY, 200*rozx, 45*rozy, ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  306. dxDrawText(v[1], 1205*rozx, 262*rozy+(dodatekY*2), 1405*rozx, 307*rozy, tocolor(255, 255, 255, 255), 1.00, czcionka2, "center", "center", false, false, false, false, false)
  307. end
  308. end
  309. end
  310.  
  311. addEventHandler("onClientClick", root, function(btn, state)
  312. if btn == "left" and state == "down" then
  313. if mysz(929*rozx, 277*rozy, 201*rozx, 49*rozy) and gui2s == true then
  314. triggerServerEvent("spawn", localPlayer, "spawn")
  315. usun()
  316. elseif mysz(929*rozx, 336*rozy, 201*rozx, 49*rozy) and gui2s == true then
  317. triggerServerEvent("spawn", localPlayer, "przecho")
  318. usun()
  319. elseif mysz(929*rozx, 395*rozy, 201*rozx, 49*rozy) and gui2s == true then
  320. triggerServerEvent("spawn", localPlayer, "pozi")
  321. usun()
  322. elseif mysz(929*rozx, 454*rozy, 201*rozx, 49*rozy) and gui2s == true then
  323. triggerServerEvent("spawn", localPlayer, "lv")
  324. usun()
  325. end
  326. if gui2s == true and #domki > 0 then
  327. for i, v in ipairs(domki) do
  328. local dodatekY = (50*rozy)*(i-1)
  329. if mysz(1205*rozx, 262*rozy+dodatekY, 200*rozx, 45*rozy) and gui2s == true and #domki > 0 then
  330. local pos = split(v[2], ",")
  331. triggerServerEvent("spawn", localPlayer, "dom", pos[1], pos[2], pos[3])
  332. usun()
  333. end
  334. end
  335. end
  336. end
  337. end)
  338.  
  339. addEventHandler("onClientResourceStart", resourceRoot, function()
  340. addEventHandler("onClientRender", root, gui)
  341. logowanie = true
  342. panel = true
  343. showCursor(true)
  344. showChat(false)
  345. fadeCamera(true)
  346. muzyka = playSound("muzyka.mp3", true)
  347. setSoundVolume(muzyka, 0.6)
  348. tick = getTickCount()
  349. setPlayerHudComponentVisible("all", false)
  350. setPlayerHudComponentVisible("radar", false)
  351. triggerEvent("usunPobieranie", localPlayer)
  352. triggerServerEvent("sprawdzBana", localPlayer)
  353. g = {}
  354. g.nick = editBox.new()
  355. g.nick:setPosition(902*rozx, 376*rozy, 275*rozx, 35*rozy)
  356. g.nick.color = {26, 177, 133, 130}
  357. g.nick.font = font
  358. g.nick.text = loadLoginFromXML()
  359. g.nick.onInput = function()
  360. g.nick.color = {26, 177, 133, 220}
  361. end
  362. g.nick.onOutput = function()
  363. g.nick.color = {26, 177, 133, 130}
  364. end
  365.  
  366. g.haslo = editBox.new()
  367. g.haslo:setPosition(902*rozx, 453*rozy, 275*rozx, 35*rozy)
  368. g.haslo.color = {26, 177, 133, 130}
  369. g.haslo.font = font
  370. g.haslo.text = loadLoginFromXML2()
  371. g.haslo.masked = true
  372. g.haslo.onInput = function()
  373. g.haslo.color = {26, 177, 133, 220}
  374. end
  375. g.haslo.onOutput = function()
  376. g.haslo.color = {26, 177, 133, 130}
  377. end
  378. g.nick.visible = true
  379. g.haslo.visible = true
  380. end)
  381.  
  382. addEvent("bShowedLogin", true)
  383. addEventHandler("bShowedLogin", root, function()
  384. g.nick.visible = false
  385. g.haslo.visible = false
  386. removeEventHandler("onClientRender", root, gui)
  387. logowanie = false
  388. rejestracja = false
  389. wyb_reg = false
  390. wyb_log = false
  391. setTimer(function()
  392. triggerServerEvent("banWyrzuc", localPlayer)
  393. end, 14000, 1)
  394. end)
  395.  
  396. local ile = 0.1
  397. local d = false
  398.  
  399. addEventHandler("onClientRender", root, function()
  400. for i,v in ipairs(getElementsByType("vehicle")) do
  401. if getElementData(v, "samolot") then
  402. triggerEvent("radar:onClientHudComponent", localPlayer, "radar", false)
  403. local x,y,z = getElementPosition(v)
  404. local rx,ry,rz = getElementRotation(v)
  405. if x < 1950 and d ~= true then
  406. dolecial()
  407. d = true
  408. return
  409. end
  410. setElementPosition(v, x-ile,y,z)
  411. if rx > 90 then
  412. setElementRotation(v, rx+0.05,ry,rz)
  413. end
  414. if z > 14.5 then
  415. setElementPosition(v, x-ile,y,z-0.01)
  416. else
  417. setElementPosition(v, x-ile,y,z)
  418. end
  419. if d == false then
  420. setTime(2,0)
  421. --dxDrawRectangle(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 0.2380, tocolor(15,15,15,125), false)
  422. --dxDrawRectangle(screenW * 0.0000, screenH * 0.7620, screenW * 1.0000, screenH * 0.2380, tocolor(15,15,15,125), false)
  423. dxDrawRectangle(0, 783*rozy, 1500*rozx, 123*rozy, tocolor(0, 0, 0, 140), false)
  424. dxDrawRectangle(0, 0, 1500*rozx, 123*rozy, tocolor(0, 0, 0, 140), false)
  425. dxDrawText("Witaj w Los Santos", 328*rozx, 783*rozy, 1125*rozx, 896*rozy, tocolor(255, 255, 255, 255), 1.00, czcionka3, "center", "center", false, false, false, false, false)
  426. end
  427. local x,y,z,x1,y1,z1 = getCameraMatrix(localPlayer)
  428. setCameraMatrix(x-ile,y,z,x1-ile,y1,z1)
  429. end
  430. end
  431. end)
  432.  
  433. function dolecial()
  434. fadeCamera(false)
  435. setTimer(function()
  436. fadeCamera(true)
  437. setCameraTarget(localPlayer)
  438. setElementData(localPlayer, "hud", false)
  439. showChat(true)
  440. local x,y,z = getElementPosition(localPlayer)
  441. setElementPosition(localPlayer, x, y, 69.2)
  442. for i,v in ipairs(getElementsByType("vehicle")) do
  443. if getElementData(v, "samolot") then
  444. setElementData(v, "samolot", false)
  445. destroyElement(v)
  446. end
  447. end
  448. local time = getRealTime()
  449. setTime(time.hour,time.minute)
  450. triggerEvent("radar:onClientHudComponent", localPlayer, "radar", true)
  451. end, 1500, 1)
  452. end
  453.  
  454. addEvent("usunElementyLogowania", true)
  455. addEventHandler("usunElementyLogowania", root, function(onest)
  456. if onest == "true" then
  457. samolocik = true
  458. end
  459. g.nick.visible = false
  460. g.haslo.visible = false
  461. removeEventHandler("onClientRender", root, gui)
  462. smoothMoveCamera(1283.2510986328, -2005.490234375, 97.91300201416, 1282.3190917969, -2005.6629638672, 97.594230651855, 1121.2890625, -2039.5078125, 79.85050201416, 1120.4855957031, -2038.9918212891, 79.553489685059, 1500)
  463. setTimer(function()
  464. addEventHandler("onClientRender", root, gui2)
  465. gui2s = true
  466. removeEventHandler("onClientPreRender",root,camRender)
  467. tick2 = getTickCount( )
  468. end, 1500, 1)
  469. panel = false
  470. logowanie = false
  471. rejestracja = false
  472. changelog = false
  473. regulamin = false
  474. setTimer(function()
  475. local skin = getElementData(localPlayer, "skin") or 0
  476. ped = createPed(tonumber(skin), 1117.61, -2036.99, 78.75, 225)
  477. end, 100, 1)
  478. if zapamietaj == true then
  479. saveLoginToXML(g.nick.text, g.haslo.text)
  480. end
  481. end)
  482.  
  483. addEvent("pokaz:domki", true)
  484. addEventHandler("pokaz:domki", root, function(tab)
  485. for i, v in ipairs(tab) do
  486. table.insert(domki, {v.name.." (ID: "..v.id..")", v.wejscie})
  487. end
  488. end)
  489.  
  490. function zmienPowiadomienie(text)
  491. exports["np-notyfikacje"]:noti(text)
  492. end
  493. addEvent("zmienPowiadomienie", true)
  494. addEventHandler("zmienPowiadomienie", root, zmienPowiadomienie)
  495.  
  496. function roundedRectangle(x, y, w, h, color)
  497. dxDrawRectangle(x, y, w, h, color, false)
  498. dxDrawRectangle(x + 2, y - 1, w - 4, 1, color, false)
  499. dxDrawRectangle(x + 2, y + h, w - 4, 1, color, false)
  500. dxDrawRectangle(x - 1, y + 2, 1, h - 4, color, false)
  501. dxDrawRectangle(x + w, y + 2, 1, h - 4, color, false)
  502. end
  503.  
  504.  
  505. function onClientCharacter(character)
  506. if not isCursorShowing() then
  507. return
  508. end
  509. for k,self in pairs(editBox.instances) do
  510. if self.visible and self.input then
  511. if (string.len(self.text)) < self.maxLength then
  512. self.text = self.text..character
  513. end
  514. end
  515. end
  516. end
  517. addEventHandler("onClientCharacter", root, onClientCharacter)
  518.  
  519. function editBox.new()
  520. local self = setmetatable({}, editBox)
  521. self.text = ""
  522. self.maxLength = 20
  523. self.scale = y*0.8
  524. self.state = "normal"
  525. self.font = "sans"
  526. self.color = {255,255,255,220}
  527. self.textColor = {255,255,255,220}
  528. table.insert(editBox.instances, self)
  529. return self
  530. end
  531.  
  532. function editBox:getPosition()
  533. return self.x, self.y, self.w, self.h
  534. end
  535.  
  536. function editBox:setPosition(x,y,w,h)
  537. self.x, self.y, self.w, self.h = x,y,w,h
  538. return true
  539. end
  540.  
  541. function loadLoginFromXML()
  542. local XML = xmlLoadFile ("zapis.xml")
  543. if not XML then
  544. XML = xmlCreateFile("zapis.xml", "konto")
  545. end
  546.  
  547. local usernameNode = xmlFindChild (XML, "login", 0)
  548. if usernameNode then
  549. return xmlNodeGetValue(usernameNode)
  550. else
  551. return ""
  552. end
  553. xmlUnloadFile ( XML )
  554. end
  555.  
  556. function loadLoginFromXML2()
  557. local XML = xmlLoadFile ("zapis.xml")
  558. if not XML then
  559. XML = xmlCreateFile("zapis.xml", "konto")
  560. end
  561.  
  562. local hasloNode = xmlFindChild (XML, "haslo", 0)
  563. if hasloNode then
  564. return xmlNodeGetValue(hasloNode)
  565. else
  566. return ""
  567. end
  568. xmlUnloadFile ( XML )
  569. end
  570.  
  571. function saveLoginToXML(username, hasloo)
  572. local XML = xmlLoadFile ("zapis.xml")
  573. if not XML then
  574. XML = xmlCreateFile("zapis.xml", "konto")
  575. end
  576. if (username ~= "") then
  577. local usernameNode = xmlFindChild (XML, "login", 0)
  578. if not usernameNode then
  579. usernameNode = xmlCreateChild(XML, "login")
  580. end
  581. xmlNodeSetValue (usernameNode, tostring(username))
  582. end
  583. if (hasloo ~= "") then
  584. local haslo = xmlFindChild (XML, "haslo", 0)
  585. if not haslo then
  586. haslo = xmlCreateChild(XML, "haslo")
  587. end
  588. xmlNodeSetValue (haslo, tostring(hasloo))
  589. end
  590. xmlSaveFile(XML)
  591. xmlUnloadFile (XML)
  592. end
  593. addEvent("saveLoginToXML", true)
  594. addEventHandler("saveLoginToXML", root, saveLoginToXML)
  595.  
  596. function removeCamHandler()
  597. if(sm.moov == 1)then
  598. sm.moov = 0
  599. end
  600. end
  601.  
  602. function camRender()
  603. if (sm.moov == 1) then
  604. local x1,y1,z1 = getElementPosition(sm.object1)
  605. local x2,y2,z2 = getElementPosition(sm.object2)
  606. setCameraMatrix(x1,y1,z1,x2,y2,z2)
  607. end
  608. end
  609. addEventHandler("onClientPreRender",root,camRender)
  610.  
  611. function smoothMoveCamera(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time)
  612. if(sm.moov == 1)then return false end
  613. sm.object1 = createObject(1337,x1,y1,z1)
  614. sm.object2 = createObject(1337,x1t,y1t,z1t)
  615. setElementAlpha(sm.object1,0)
  616. setElementAlpha(sm.object2,0)
  617. setObjectScale(sm.object1,0.01)
  618. setObjectScale(sm.object2,0.01)
  619. moveObject(sm.object1,time,x2,y2,z2,0,0,0,"InOutQuad")
  620. moveObject(sm.object2,time,x2t,y2t,z2t,0,0,0,"InOutQuad")
  621. sm.moov = 1
  622. --setTimer(removeCamHandler,time,1)
  623. setTimer(destroyElement,time,1,sm.object1)
  624. setTimer(destroyElement,time,1,sm.object2)
  625. return true
  626. end
  627.  
  628. function shadowText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
  629. dxDrawText(text,x+1,y+1,w+1,h+1,tocolor(0,0,0,color[4]),size,font,xx,yy,x1,x2,x3,x4,x5)
  630. dxDrawText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
  631. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement