Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.36 KB | None | 0 0
  1. if getElementData(localPlayer, "player:uid") then return end
  2.  
  3. local blurStrength = 20
  4.  
  5.  
  6. local myScreenSource = dxCreateScreenSource(screenWidth, screenHeight)
  7. blurShader, blurTec = dxCreateShader("shaders/BlurShader.fx")
  8.  
  9.  
  10. function renderblur()
  11. if blur == true then
  12. dxUpdateScreenSource(myScreenSource)
  13.  
  14. dxSetShaderValue(blurShader, "ScreenSource", myScreenSource);
  15. dxSetShaderValue(blurShader, "BlurStrength", blurStrength);
  16. dxSetShaderValue(blurShader, "UVSize", screenWidth, screenHeight);
  17.  
  18. dxDrawImage(0, 0, screenWidth, screenHeight, blurShader)
  19. end
  20. end
  21. addEventHandler("onClientRender", root, renderblur)
  22.  
  23. addEventHandler("onClientResourceStop", resourceRoot,
  24. function()
  25. if (blurShader) then
  26. destroyElement(blurShader)
  27. blurShader = nil
  28. end
  29. end)
  30.  
  31. local root = getRootElement()
  32. local dxfont0_fontbold = dxCreateFont("font-bold.ttf", 20)
  33. local dxfont1_fontbold = dxCreateFont("font-bold.ttf", 26)
  34. local resourceRoot = getResourceRootElement(getThisResource())
  35. local screenWidth, screenHeight = guiGetScreenSize()
  36. screenW, screenH = guiGetScreenSize()
  37.  
  38. local sx,sy=guiGetScreenSize()
  39. local data={ showed=nil, button={}, info=nil, misc=nil, tick=getTickCount() }
  40.  
  41. function isMouseIn(psx,psy,pssx,pssy,abx,aby)
  42. if not isCursorShowing() then return end
  43. cx,cy=getCursorPosition()
  44. cx,cy=cx*sx,cy*sy
  45. if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
  46. return true,cx,cy
  47. else
  48. return false
  49. end
  50. end
  51.  
  52.  
  53. dist = 300
  54. angler = 25
  55. function getPointFromDistanceRotation(x, y, dist, angler)
  56. local losuj = math.random(0, 360)
  57. local a = math.rad(60 - angler)
  58. local dx = math.cos(a) * dist;
  59. local dy = math.sin(a) * dist;
  60. return x+dx, y+dy;
  61. end
  62.  
  63. function getCenter(sx,sy)
  64. local screenW, screenH = guiGetScreenSize()
  65. local x, y = (screenW - sx) /2,(screenH - sy) /2
  66. return x, y
  67. end
  68. posx,posy=getCenter(740,462)
  69. function getCenter(sx,sy)
  70. local screenW, screenH = guiGetScreenSize()
  71. local x, y = (screenW - sx) /2,(screenH - sy) /2
  72. return x, y
  73. end
  74. posxx,posyy=getCenter(365,30)
  75.  
  76. mojeW,mojeH = 1920,1080
  77. sW,sH = guiGetScreenSize()
  78. w, h = (sW/mojeW), (sH/mojeH)
  79.  
  80. local x,y = guiGetScreenSize()
  81. local f = x / 1024
  82. local nY = y*f
  83.  
  84. function roundedRectangle(x, y, w, h, color)
  85. dxDrawRectangle(x, y, w, h, color, false)
  86. dxDrawRectangle(x + 2, y - 1, w - 4, 1, color, false)
  87. dxDrawRectangle(x + 2, y + h, w - 4, 1, color, false)
  88. dxDrawRectangle(x - 1, y + 2, 1, h - 4, color, false)
  89. dxDrawRectangle(x + w, y + 2, 1, h - 4, color, false)
  90. end
  91.  
  92. aktualnie="logowanie"
  93. function renderLoginBox()
  94.  
  95. function math.round(number, decimals, method)
  96. decimals = decimals or 0
  97. local factor = 10 ^ decimals
  98. if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor
  99. else return tonumber(("%."..decimals.."f"):format(number)) end
  100. end
  101.  
  102. local a = interpolateBetween(0,0,0,255,255,255,((getTickCount()-tick)/1300),"Linear")
  103. local a2 = interpolateBetween(0,0,0,151,151,151,((getTickCount()-tick)/1300),"Linear")
  104. local a3 = interpolateBetween(0,0,0,45,45,45,((getTickCount()-tick)/1300),"Linear")
  105.  
  106. --dxDrawImage(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000, ":er-pobieranie/images/bg.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  107.  
  108. roundedRectangle(screenW * 0.0000, screenH * 0.3000, screenW * 1.0000, screenH * 0.4000, tocolor(0, 0, 0, a2), false)
  109.  
  110. local bt = getSoundFFTData(data.misc,2048,230)
  111. if(not bt) then return end
  112. for i,v in pairs(bt) do
  113. tlo = math.round((v*320),0)>100 and 100 or math.round((v*320),0)
  114. dxDrawImage(screenW * 0.4000, screenH * 0.3300, screenW * 0.2000, screenH * 0.3500, ":er-logowanie/img/logo_tlo.png", 0, 0, 0, tocolor(255, 255, 255, tlo/2.2), false) -- to co miga za logo
  115. end
  116. dxDrawImage(screenW * 0.4000, screenH * 0.3300, screenW * 0.2000, screenH * 0.3500, ":er-logowanie/logo.png", 0, 0, 0, tocolor(255, 255, 255, a), false) -- zwyczajne logo
  117.  
  118. if(not bt) then return end
  119. for i,v in pairs(bt) do
  120. skoki = math.round((v*320),0)>100 and 100 or math.round((v*320),0)
  121. odleglosc = 0.3700
  122. --dxDrawRectangle(screenW * 0.0000+(i * screenW * 0.0210*odleglosc), screenH * 0.2995, screenH * 0.0416*odleglosc, screenH * 0.0020 * skoki*-1, tocolor(90,90,90, a2), false)
  123. --dxDrawRectangle(screenW * 0.0000+(i * screenW * 0.0210*odleglosc), screenH * 0.7005, screenH * 0.0416*odleglosc, screenH * 0.0020 * skoki*1, tocolor(90,90,90, a2), false)
  124. end
  125.  
  126. dxDrawRectangle(screenW * 0.0600, screenH * 0.6250, screenW * 0.2700, screenH * 0.0600, tocolor(90,90,90, a), false) -- button od logowania
  127. dxDrawRectangle(screenW * 0.0200, screenH * 0.3175, screenW * 0.3500, screenH * 0.0600, tocolor(90,90,90, a), false) -- logowanie
  128.  
  129. dxDrawRectangle(screenW * 0.6700, screenH * 0.6250, screenW * 0.2700, screenH * 0.0600, tocolor(90,90,90, a), false) -- button od rejestracji
  130. dxDrawRectangle(screenW * 0.6300, screenH * 0.3175, screenW * 0.3500, screenH * 0.0600, tocolor(90,90,90, a), false) -- rejestracja
  131.  
  132. local hype2 = interpolateBetween(0, 0, 0, -15, 100, 0, ((getTickCount() - tick) / 2500), "SineCurve")
  133.  
  134. dxDrawText("Muzyka: Zaza - Be Together [NCS Release]", screenW * 0.0000, screenH * 0.8300 + hype2, screenW * 1.0000, screenH * 0.0600, tocolor(255, 255, 255, a3), 0.75*w, dxfont0_fontbold, "center", "top", false, false, false, false, false)
  135.  
  136. dxDrawText("Logowanie", screenW * 0.0900, screenH * 0.3300, screenW * 0.2950, screenH * 0.0600, tocolor(255, 255, 255, a), 1*w, dxfont0_fontbold, "center", "top", false, false, false, false, false)
  137. dxDrawImage(screenW * 0.0200, screenH * 0.4250, screenW * 0.0219, screenH * 0.0361, ":er-logowanie/user.png", 0, 0, 0, tocolor(255,255,255, a), false)
  138. dxDrawImage(screenW * 0.0200, screenH * 0.5500, screenW * 0.0219, screenH * 0.0361, ":er-logowanie/pass.png", 0, 0, 0, tocolor(255,255,255, a), false)
  139. dxDrawText("Zaloguj się", screenW * 0.0900, screenH * 1.2500, screenW * 0.2950, screenH * 0.0600, tocolor(255, 255, 255, a), 1*w, dxfont0_fontbold, "center", "center", false, false, false, false, false)
  140.  
  141. dxDrawText("Rejestracja", screenW * 1.3300, screenH * 0.3300, screenW * 0.2950, screenH * 0.0600, tocolor(255, 255, 255, a), 1*w, dxfont0_fontbold, "center", "top", false, false, false, false, false)
  142. dxDrawImage(screenW * 0.6300, screenH * 0.4250, screenW * 0.0219, screenH * 0.0361, ":er-logowanie/user.png", 0, 0, 0, tocolor(255,255,255, a), false)
  143. dxDrawImage(screenW * 0.6300, screenH * 0.5500, screenW * 0.0219, screenH * 0.0361, ":er-logowanie/pass.png", 0, 0, 0, tocolor(255,255,255, a), false)
  144. dxDrawText("Załóż konto", screenW * 1.3300, screenH * 1.2500, screenW * 0.2950, screenH * 0.0600, tocolor(255, 255, 255, a), 1*w, dxfont0_fontbold, "center", "center", false, false, false, false, false)
  145.  
  146. --local polozenie_kamery = interpolateBetween(0, 0, 0, 1, 6, 0, ((getTickCount() - tick) / 6500), "SineCurve")
  147. --setCameraMatrix(54.71, 98.51, 69.31+polozenie_kamery, 237.86, -129.06, 2.04+polozenie_kamery)
  148. local x,y=getPointFromDistanceRotation(230.27,-125.07, dist, angler)
  149. setCameraMatrix(x,y,50+0.9,230.27,-125.07,1.43+0.9)
  150. angler=(angler+0.0015+skoki/4550)
  151.  
  152. if data.info then
  153. dxDrawText(data.info, (screenW * 9.3000) + 1, (screenH * 0.7519) + 1, (screenW * 0.7047) + 1, (screenH * 0.2481) + 1, tocolor(0, 0, 0, a), 1*w, dxfont0_fontbold, "center", "center", false, false, false, false, false)
  154. dxDrawText(data.info, screenW * 9.3000, screenH * 0.7519, screenW * 0.7047, screenH * 0.2481, tocolor(229, 0, 0, a), 1*w, dxfont0_fontbold, "center", "center", false, false, false, false, false)
  155. end
  156.  
  157. setTimer(function()
  158. showChat(false)
  159. end, 50, 10)
  160.  
  161. end
  162.  
  163.  
  164.  
  165.  
  166.  
  167. addEventHandler("onClientClick", root, function(btn,state)
  168. if btn=="left" and state=="down" then
  169. if isMouseIn(screenW * 0.0600, screenH * 0.6250, screenW * 0.2700, screenH * 0.0600) and data.showed then
  170. local login=guiGetText(data.button[1])
  171. local pass=guiGetText(data.button[2])
  172. if string.len(login) > 22 or string.len(pass) > 22 and string.len(login) < 3 or string.len(pass) < 3 then
  173. exports["er-notyfikacje"]:showBox("error", "Login oraz hasło muszą posiadać od 3 do 22 znaków!")
  174. data.tick=getTickCount()+5000
  175. return
  176. end
  177. if string.find(login, "#") ~= nil or string.find(login, "@") ~= nil or string.find(login, "?") ~= nil or string.find(login, "!") ~= nil then
  178. exports["er-notyfikacje"]:showBox("error", "Posiadasz niedozwolony znak w Twoim loginie!")
  179. data.tick=getTickCount()+5000
  180. return
  181. end
  182. triggerServerEvent("logging:checkAccount", resourceRoot, login, pass)
  183. end
  184. if isMouseIn(screenW * 0.6700, screenH * 0.6250, screenW * 0.2700, screenH * 0.0600) and data.showed then
  185. local login=guiGetText(data.button[3])
  186. local pass=guiGetText(data.button[4])
  187. if string.len(login) > 22 or string.len(pass) > 22 and string.len(login) < 3 or string.len(pass) < 3 then
  188. exports["er-notyfikacje"]:showBox("error", "Login oraz hasło muszą posiadać od 3 do 22 znaków!")
  189. data.tick=getTickCount()+5000
  190. return
  191. end
  192. if string.find(login, "#") ~= nil or string.find(login, "@") ~= nil or string.find(login, "?") ~= nil or string.find(login, "!") ~= nil then
  193. exports["er-notyfikacje"]:showBox("error", "Posiadasz niedozwolony znak w Twoim loginie!")
  194. data.tick=getTickCount()+5000
  195. return
  196. end
  197. triggerServerEvent("logging:newAccount", resourceRoot, login, pass)
  198. end
  199. end
  200. end)
  201.  
  202. addEvent("logging:result", true)
  203. addEventHandler("logging:result", resourceRoot, function(value,info)
  204. if not info then info="" end
  205. if value then
  206. data.showed=false
  207. showZones(data.misc)
  208. destroyElement(data.button[1])
  209. destroyElement(data.button[2])
  210. destroyElement(data.button[3])
  211. destroyElement(data.button[4])
  212. removeEventHandler("onClientRender", root, renderLoginBox)
  213. else
  214. data.info=info
  215. data.tick=getTickCount()+5000
  216. end
  217. end)
  218.  
  219. addEventHandler("onClientResourceStart", resourceRoot, function()
  220. setTime(22, 0)
  221. tick = getTickCount()
  222. data.misc=playSound("http://ts-zagadaj.pl/test.mp3",true)
  223. addEventHandler("onClientRender", root, renderLoginBox)
  224. showChat(false)
  225. showCursor(true)
  226. fadeCamera(true)
  227. data.showed=true
  228. setElementAlpha(localPlayer,0)
  229. setSoundVolume(data.misc, 0.6)
  230. showPlayerHudComponent("all",false)
  231. showPlayerHudComponent("radar", false)
  232. guiSetInputMode("no_binds_when_editing")
  233. setElementData(localPlayer,"status","Loguje się")
  234. data.button[1] = guiCreateEdit(0.055, 0.423, 0.315, 0.04, "", true)
  235. data.button[2] = guiCreateEdit(0.055, 0.548, 0.315, 0.04, "", true)
  236. data.button[3] = guiCreateEdit(0.665, 0.423, 0.315, 0.04, getPlayerName(localPlayer):gsub("#%x%x%x%x%x%x",""), true)
  237. data.button[4] = guiCreateEdit(0.665, 0.548, 0.315, 0.04, "", true)
  238. guiEditSetMasked(data.button[2], true)
  239. guiEditSetMasked(data.button[4], true)
  240. end)
  241.  
  242. function filedelet ()
  243. if fileExists("c_logging.lua") then
  244. fileDelete("c_logging.lua")
  245. end
  246. end
  247. addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), filedelet)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement