Guest User

Untitled

a guest
Mar 10th, 2019
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.93 KB | None | 0 0
  1. local showLogin = false
  2. local showPanel = false
  3. local loggedIn = false
  4. local admins = {}
  5. local adminrangs = {"Admin 1", "Admin 2", "Admin 3", "Admin 4", "Admin 5", "FőAdmin", "SzuperAdmin", "Tulajdonos", "Fejlesztő", "VezérFejlesztő", "Rendszergazda"}
  6. local admincolors = {"#acd373", "#acd373", "#acd373", "#acd373", "#acd373", "#EFAD5F", "#630460", "#ED1C24", "#32B3EF", "#32B3EF", "#ca5454"}
  7. local selectedAdmin = 0
  8. local selectedProvisions = 0
  9. local clickCount = false
  10.  
  11. local bans = {}
  12.  
  13. function getBansClient(table)
  14. if (table) then
  15. bans = {}
  16. bans = table
  17. end
  18. end
  19. addEvent("getBansClient", true)
  20. addEventHandler("getBansClient", getRootElement(), getBansClient)
  21.  
  22. local kicks = {}
  23.  
  24. function getKicksClient(table)
  25. if (table) then
  26. kicks = {}
  27. kicks = table
  28. end
  29. end
  30. addEvent("getKicksClient", true)
  31. addEventHandler("getKicksClient", getRootElement(), getKicksClient)
  32.  
  33. local jails = {}
  34.  
  35. function getJailsClient(table)
  36. if (table) then
  37. jails = {}
  38. jails = table
  39. end
  40. end
  41. addEvent("getJailsClient", true)
  42. addEventHandler("getJailsClient", getRootElement(), getJailsClient)
  43.  
  44. local maxShow = 8
  45. local scrollingData = 0
  46.  
  47. local font = dxCreateFont("files/Roboto.ttf", 16)
  48. local fontg = guiCreateFont("files/Roboto.ttf", 13)
  49.  
  50. local scSz = {guiGetScreenSize()}
  51.  
  52. local box = {400, 180}
  53. local boxPosition = {(scSz[1]/2)-(box[1]/2), (scSz[2]/2-box[2]/2)}
  54.  
  55. local panel = {1000, 630}
  56. local panelPosition = {(scSz[1]/2)-(panel[1]/2), (scSz[2]/2-panel[2]/2)}
  57.  
  58. function checkCursor()
  59. if not guiGetInputEnabled() and not isMTAWindowActive() and isCursorShowing( ) then
  60. return true
  61. else
  62. return false
  63. end
  64. end
  65.  
  66. function drawLoginPanel()
  67. if showLogin then
  68. roundedRectangle(boxPosition[1], boxPosition[2], box[1], box[2], tocolor(0,0,0,180))
  69. dxDrawRectangle(boxPosition[1],boxPosition[2], box[1], 30, tocolor(0,0,0,180))
  70. dxDrawText("#ffffffSan#acd373MTA #598ED7- Admin #ffffff- Bejelentkezés", boxPosition[1]+5, boxPosition[2]+3, 0, 0, tocolor(255, 255, 255, 255),0.8,font,"left","top", false, false, false, true)
  71. if isInSlot(boxPosition[1]+box[1]-30, boxPosition[2]+3, 20, 20) then
  72. dxDrawImage(boxPosition[1]+box[1]-30, boxPosition[2]+4, 20, 20, "files/cancel.png", 0,0,0, tocolor(202,84,84,200))
  73. --dxDrawText("#ca5454X", boxPosition[1]+box[1]-13, boxPosition[2]+1, 20, 20, tocolor(255, 255, 255, 255),0.7,font,"left","top", false, false, false, true)
  74. else
  75. dxDrawImage(boxPosition[1]+box[1]-30, boxPosition[2]+4, 20, 20, "files/cancel.png", 0,0,0, tocolor(255,255,255,200))
  76. --dxDrawText("#ffffffX", boxPosition[1]+box[1]-13, boxPosition[2]+1, 20, 20, tocolor(255, 255, 255, 255),0.7,font,"left","top", false, false, false, true)
  77. end
  78.  
  79. dxDrawText("Felhasználónév:", boxPosition[1]+5, boxPosition[2]+47, 0, 0, tocolor(255, 255, 255, 255),0.8,font,"left","top", false, false, false, true)
  80. dxDrawText("Jelszó:", boxPosition[1]+5, boxPosition[2]+97, 0, 0, tocolor(255, 255, 255, 255),0.8,font,"left","top", false, false, false, true)
  81.  
  82. dxDrawRectangle(boxPosition[1]+167, boxPosition[2]+37, 225, 35, tocolor(99,99,99,200))
  83. dxDrawRectangle(boxPosition[1]+167, boxPosition[2]+87, 225, 35, tocolor(99,99,99,200))
  84.  
  85. if isInSlot(boxPosition[1]+87,boxPosition[2]+137, 225, 35) then
  86. dxDrawRectangle(boxPosition[1]+87,boxPosition[2]+137, 225, 35, tocolor(89,142,215, 190))
  87. dxDrawText("Bejelentkezés", boxPosition[1]+127,boxPosition[2]+140, 190, 30, tocolor(0,0,0,200),1,font,"left","top", false, false, false, true)
  88. else
  89. dxDrawRectangle(boxPosition[1]+87,boxPosition[2]+137, 225, 35, tocolor(89,142,215, 170))
  90. dxDrawText("Bejelentkezés", boxPosition[1]+127,boxPosition[2]+140, 190, 30, tocolor(0,0,0,200),1,font,"left","top", false, false, false, true)
  91. end
  92. end
  93. end
  94. addEventHandler("onClientRender", getRootElement(), drawLoginPanel)
  95.  
  96. function drawAdminPanel()
  97. if showPanel then
  98. roundedRectangle(panelPosition[1], panelPosition[2], panel[1], panel[2], tocolor(0,0,0,180))
  99. dxDrawRectangle(panelPosition[1],panelPosition[2], panel[1], 30, tocolor(0,0,0,180))
  100. dxDrawText("#ffffffSan #acd373MTA #598ED7- Adminpanel", panelPosition[1]+5, panelPosition[2]+3, 0, 0, tocolor(255, 255, 255, 255),0.8,font,"left","top", false, false, false, true)
  101. if isInSlot(panelPosition[1]+panel[1]-30, panelPosition[2]+3, 20, 20) then
  102. dxDrawImage(panelPosition[1]+panel[1]-30, panelPosition[2]+4, 20, 20, "files/cancel.png", 0,0,0, tocolor(202,84,84,200))
  103. else
  104. dxDrawImage(panelPosition[1]+panel[1]-30, panelPosition[2]+4, 20, 20, "files/cancel.png", 0,0,0, tocolor(255,255,255,200))
  105. end
  106. if loggedIn then
  107. dxDrawRectangle(panelPosition[1]+5, panelPosition[2]+70, 495, 25, tocolor(0,0,0,200))
  108. dxDrawRectangle(panelPosition[1]+5, panelPosition[2]+95, 490, 25, tocolor(0,0,0,130))
  109. dxDrawRectangle(panelPosition[1]+5, panelPosition[2]+120, 490, 25, tocolor(0,0,0,155))
  110. dxDrawRectangle(panelPosition[1]+5, panelPosition[2]+145, 490, 25, tocolor(0,0,0,130))
  111. dxDrawRectangle(panelPosition[1]+5, panelPosition[2]+170, 490, 25, tocolor(0,0,0,155))
  112. dxDrawRectangle(panelPosition[1]+5, panelPosition[2]+195, 490, 25, tocolor(0,0,0,130))
  113. dxDrawRectangle(panelPosition[1]+5, panelPosition[2]+220, 490, 25, tocolor(0,0,0,155))
  114. dxDrawRectangle(panelPosition[1]+5, panelPosition[2]+245, 490, 25, tocolor(0,0,0,130))
  115. dxDrawRectangle(panelPosition[1]+495, panelPosition[2]+95, 5, 175, tocolor(0,0,0,255))
  116. dxDrawText("Adminnév", panelPosition[1]+7, panelPosition[2]+74, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  117. dxDrawText("Admin szint", panelPosition[1]+100, panelPosition[2]+74, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  118.  
  119. dxDrawRectangle(panelPosition[1]+500, panelPosition[2]+70, 495, 25, tocolor(0,0,0,200))
  120. dxDrawRectangle(panelPosition[1]+500, panelPosition[2]+95, 490, 25, tocolor(0,0,0,130))
  121. dxDrawRectangle(panelPosition[1]+500, panelPosition[2]+120, 490, 25, tocolor(0,0,0,155))
  122. dxDrawRectangle(panelPosition[1]+500, panelPosition[2]+145, 490, 25, tocolor(0,0,0,130))
  123. dxDrawRectangle(panelPosition[1]+500, panelPosition[2]+170, 490, 25, tocolor(0,0,0,155))
  124. dxDrawRectangle(panelPosition[1]+500, panelPosition[2]+195, 490, 25, tocolor(0,0,0,130))
  125. dxDrawRectangle(panelPosition[1]+500, panelPosition[2]+220, 490, 25, tocolor(0,0,0,155))
  126. dxDrawRectangle(panelPosition[1]+500, panelPosition[2]+245, 490, 25, tocolor(0,0,0,130))
  127. dxDrawRectangle(panelPosition[1]+990, panelPosition[2]+95, 5, 175, tocolor(0,0,0,255))
  128. if selectedProvisions == 1 then
  129. dxDrawText("ID", panelPosition[1]+502, panelPosition[2]+74, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  130. dxDrawText("Játékos", panelPosition[1]+565, panelPosition[2]+74, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  131. dxDrawText("Indok", panelPosition[1]+750, panelPosition[2]+74, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  132. for k, v in ipairs(bans) do
  133. if v[6] == getElementData(selectedAdmin, "dbid") then
  134. dxDrawText("#ffffff" .. v[1], panelPosition[1]+502, panelPosition[2]+74+25*k, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  135. dxDrawText("#ffffff" .. v[9], panelPosition[1]+565, panelPosition[2]+74+25*k, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  136. dxDrawText("#ffffff" .. v[7], panelPosition[1]+750, panelPosition[2]+74+25*k, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  137. end
  138. end
  139. elseif selectedProvisions == 2 then
  140. dxDrawText("ID", panelPosition[1]+502, panelPosition[2]+74, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  141. dxDrawText("Játékos", panelPosition[1]+565, panelPosition[2]+74, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  142. dxDrawText("Indok", panelPosition[1]+750, panelPosition[2]+74, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  143. for k, v in ipairs(kicks) do
  144. if v[3] == getElementData(selectedAdmin, "dbid") then
  145. dxDrawText("#ffffff" .. v[1], panelPosition[1]+502, panelPosition[2]+74+25*k, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  146. dxDrawText("#ffffff" .. v[7], panelPosition[1]+565, panelPosition[2]+74+25*k, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  147. dxDrawText("#ffffff" .. v[4], panelPosition[1]+750, panelPosition[2]+74+25*k, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  148. end
  149. end
  150. elseif selectedProvisions == 3 then
  151. dxDrawText("ID", panelPosition[1]+502, panelPosition[2]+74, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  152. dxDrawText("Játékos", panelPosition[1]+565, panelPosition[2]+74, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  153. dxDrawText("Indok", panelPosition[1]+750, panelPosition[2]+74, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  154. dxDrawText("Hossz", panelPosition[1]+900, panelPosition[2]+74, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  155. for k, v in ipairs(jails) do
  156. if v[7] == getElementData(selectedAdmin, "char:anick") then
  157. dxDrawText("#ffffff" .. v[1], panelPosition[1]+502, panelPosition[2]+74+25*k, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  158. dxDrawText("#ffffff" .. v[8], panelPosition[1]+565, panelPosition[2]+74+25*k, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  159. dxDrawText("#ffffff" .. v[4], panelPosition[1]+750, panelPosition[2]+74+25*k, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  160. dxDrawText("#ffffff" .. v[5] .. " perc", panelPosition[1]+900, panelPosition[2]+74+25*k, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  161. end
  162. end
  163. end
  164.  
  165. dxDrawRectangle(panelPosition[1], panelPosition[2]+315, panel[1], 30, tocolor(0,0,0,155))
  166. if selectedAdmin == 0 then
  167. dxDrawText("Nincs kiválasztva", panelPosition[1]+panel[1]/2-dxGetTextWidth("Nincs kiválasztva", 0.8, font)/2, panelPosition[2]+320, 607, 20, tocolor(255,255,255,255), 0.8, font)
  168. else
  169. dxDrawText("" .. getElementData(selectedAdmin, "char:anick") .. " adatai", panelPosition[1]+panel[1]/2-dxGetTextWidth("" .. getElementData(selectedAdmin, "char:anick") .. " adatai", 0.8, font)/2, panelPosition[2]+320, 607, 20, tocolor(255,255,255,255), 0.8, font)
  170. end
  171.  
  172. local adminGather = 0
  173. for k,v in ipairs(admins) do
  174. if (k > scrollingData and adminGather < maxShow) then
  175. adminGather = adminGather + 1
  176. dxDrawText("#ffffff" .. getElementData(v[1], "char:anick") .. "", panelPosition[1]+7, panelPosition[2]+74+25*adminGather, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  177. dxDrawText("#ffffff" .. adminrangs[getElementData(v[1], "acc:admin")] .. "", panelPosition[1]+100, panelPosition[2]+74+25*adminGather, 607, 20, tocolor(89,142,215, 240), 0.7, font,"left","top",false,false,false,true)
  178. end
  179. end
  180. if selectedAdmin ~= 0 then
  181. dxDrawText("#ffffffAdminnick: #acd373" .. getElementData(selectedAdmin, "char:anick") .. "", panelPosition[1]+7, panelPosition[2]+365, 607, 20, tocolor(89,142,215, 240), 0.8, font,"left","top",false,false,false,true)
  182. dxDrawText("#ffffffJátszott percek: #acd373" .. getElementData(selectedAdmin, "char:playedTime") .. " perc", panelPosition[1]+7, panelPosition[2]+430, 607, 20, tocolor(89,142,215, 240), 0.8, font,"left","top",false,false,false,true)
  183. dxDrawText("#ffffffAdminduty percek: #acd373" .. getElementData(selectedAdmin, "char:name") .. " perc", panelPosition[1]+7, panelPosition[2]+445, 607, 20, tocolor(89,142,215, 240), 0.8, font,"left","top",false,false,false,true)
  184. if isInSlot(panelPosition[1]+80,panelPosition[2]+410, 55, 20) then
  185. dxDrawRectangle(panelPosition[1]+80,panelPosition[2]+410, 55, 20, tocolor(89,142,215, 190))
  186. dxDrawText("BANjai", panelPosition[1]+80,panelPosition[2]+410, 55, 20, tocolor(0,0,0,240),0.8, font,"left","top", false, false, false, true)
  187. if getKeyState("mouse1") and not clickCount then
  188. selectedProvisions = 1
  189. bans = {}
  190. triggerServerEvent("getBansServer", root)
  191. clickCounter()
  192. end
  193. else
  194. dxDrawRectangle(panelPosition[1]+80,panelPosition[2]+410, 55, 20, tocolor(89,142,215, 170))
  195. dxDrawText("BANjai", panelPosition[1]+80,panelPosition[2]+410, 55, 20, tocolor(0,0,0,240),0.8,font,"left","top", false, false, false, true)
  196. end
  197.  
  198. if isInSlot(panelPosition[1]+140,panelPosition[2]+410, 57, 20) then
  199. dxDrawRectangle(panelPosition[1]+140,panelPosition[2]+410, 57, 20, tocolor(89,142,215, 190))
  200. dxDrawText("KICKjei", panelPosition[1]+140,panelPosition[2]+410, 57, 20, tocolor(0,0,0,240),0.8, font,"left","top", false, false, false, true)
  201. if getKeyState("mouse1") and not clickCount then
  202. selectedProvisions = 2
  203. kicks = {}
  204. triggerServerEvent("getKicksServer", root)
  205. clickCounter()
  206. end
  207. else
  208. dxDrawRectangle(panelPosition[1]+140,panelPosition[2]+410, 57, 20, tocolor(89,142,215, 170))
  209. dxDrawText("KICKjei", panelPosition[1]+140,panelPosition[2]+410, 57, 20, tocolor(0,0,0,240),0.8,font,"left","top", false, false, false, true)
  210. end
  211.  
  212. if isInSlot(panelPosition[1]+200,panelPosition[2]+410, 57, 20) then
  213. dxDrawRectangle(panelPosition[1]+200,panelPosition[2]+410, 57, 20, tocolor(89,142,215, 190))
  214. dxDrawText("JAILjai", panelPosition[1]+200,panelPosition[2]+410, 57, 20, tocolor(0,0,0,240),0.8, font,"left","top", false, false, false, true)
  215. if getKeyState("mouse1") and not clickCount then
  216. selectedProvisions = 3
  217. jails = {}
  218. triggerServerEvent("getJailsServer", root)
  219. clickCounter()
  220. end
  221. else
  222. dxDrawRectangle(panelPosition[1]+200,panelPosition[2]+410, 57, 20, tocolor(89,142,215, 170))
  223. dxDrawText("JAILjai", panelPosition[1]+200,panelPosition[2]+410, 57, 20, tocolor(0,0,0,240),0.8,font,"left","top", false, false, false, true)
  224. end
  225. end
  226. end
  227. end
  228. end
  229. addEventHandler("onClientRender", getRootElement(), drawAdminPanel)
  230.  
  231. function clickCounter()
  232. clickCount = true
  233. setTimer(function()
  234. clickCount = false
  235. end, 500, 1)
  236. end
  237.  
  238. function OnClick(button, state, x,y)
  239. if showLogin then
  240. if button == "left" and state == "down" then
  241. if showLogin and isInSlot(boxPosition[1]+box[1]-30, boxPosition[2]+4, 20, 20) then
  242. showLogin = false
  243. setElementData(localPlayer, "toggleInterface", false)
  244. removeEventHandler("onClientRender", getRootElement(), drawLoginPanel)
  245. if isElement(username) then
  246. destroyElement(username)
  247. end
  248. if isElement(usernameedit) then
  249. destroyElement(usernameedt)
  250. end
  251. if isElement(password) then
  252. destroyElement(password)
  253. end
  254. if isElement(passwordedit) then
  255. destroyElement(passwordedit)
  256. end
  257. admins = nil
  258. elseif showLogin and isInSlot(boxPosition[1]+87,boxPosition[2]+137, 225, 35) then
  259. validateAdminLogin()
  260. end
  261. end
  262. elseif showPanel then
  263. if button == "left" and state == "down" then
  264. if showPanel and isInSlot(panelPosition[1]+panel[1]-30, panelPosition[2]+3, 20, 20) then
  265. showPanel = false
  266. setElementData(localPlayer, "toggleInterface", false)
  267. removeEventHandler("onClientRender", getRootElement(), drawAdminPanel)
  268. admins = {}
  269. else
  270. end
  271. end
  272. end
  273. end
  274. addEventHandler("onClientClick", getRootElement(), OnClick)
  275.  
  276. function OnClickSelect(button, state, x,y)
  277. if button == "left" and state == "down" then
  278. if showPanel then
  279. local adminGather = 0
  280. for k,v in ipairs(admins) do
  281. if (k > scrollingData and adminGather < maxShow) then
  282. adminGather = adminGather + 1
  283. if showPanel and (isInSlot(panelPosition[1]+7, panelPosition[2]+74+25*adminGather, 490, 25)) then
  284. selectedAdmin = v[1]
  285. --outputChatBox(getElementData(v[1], "anick"))
  286. end
  287. end
  288. end
  289. end
  290. end
  291. end
  292. addEventHandler("onClientClick", getRootElement(), OnClickSelect)
  293.  
  294. function isInSlot(xS,yS,wS,hS)
  295. if(isCursorShowing()) then
  296. XY = {guiGetScreenSize()}
  297. local cursorX, cursorY = getCursorPosition()
  298. cursorX, cursorY = cursorX*XY[1], cursorY*XY[2]
  299. if(dobozbaVan(xS,yS,wS,hS, cursorX, cursorY)) then
  300. return true
  301. else
  302. return false
  303. end
  304. end
  305. end
  306.  
  307.  
  308. function dobozbaVan(dX, dY, dSZ, dM, eX, eY)
  309. if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then
  310. return true
  311. else
  312. return false
  313. end
  314. end
  315.  
  316. function showAdminPanel()
  317. if loggedIn == false then
  318. showLogin = true
  319. showChat = false
  320. addEventHandler("onClientRender", getRootElement(), drawLoginPanel)
  321. username = guiCreateLabel(boxPosition[1]+170, boxPosition[2]+42, 225, 35, "", false)
  322. guiSetFont(username, fontg)
  323. usernameedit = guiCreateEdit(boxPosition[1]+167, boxPosition[2]+37, 225, 35, "", false)
  324. guiSetAlpha(usernameedit, 0)
  325. addEventHandler("onClientGUIChanged", usernameedit, function(element)
  326. guiSetText( username, guiGetText(usernameedit))
  327. end)
  328.  
  329. password = guiCreateLabel(boxPosition[1]+170, boxPosition[2]+97, 225, 35, "", false)
  330. guiSetFont(password, fontg)
  331. passwordedit = guiCreateEdit(boxPosition[1]+167, boxPosition[2]+87, 225, 35, "", false)
  332. guiSetAlpha(passwordedit, 0)
  333. guiEditSetMasked(passwordedit, true)
  334. addEventHandler("onClientGUIChanged", passwordedit, function(element)
  335. jelszo = guiGetText(passwordedit)
  336. local passwordasd = "", 0
  337. for i=1,#jelszo do
  338. passwordasd = passwordasd .. "*"
  339. end
  340. guiSetText(password, passwordasd)
  341. end)
  342. else
  343. showPanel = true
  344. addEventHandler("onClientRender", getRootElement(), drawAdminPanel)
  345. triggerServerEvent("getBansServer", root)
  346. triggerServerEvent("getKicksServer", root)
  347. triggerServerEvent("getJailsServer", root)
  348. for k, v in ipairs(getElementsByType("player")) do
  349. if getElementData(v, "acc:admin") >= 1 then
  350. admins[#admins+1] = {v}
  351. end
  352. end
  353. end
  354. end
  355. addCommandHandler("adminpanel", showAdminPanel)
  356.  
  357. function loginAdminClient ()
  358. showLogin = false
  359. showPanel = true
  360. addEventHandler("onClientRender", getRootElement(), drawAdminPanel)
  361. triggerServerEvent("getBansServer", root)
  362. triggerServerEvent("getKicksServer", root)
  363. triggerServerEvent("getJailsServer", root)
  364. --triggerServerEvent("sendMessageToPolice", root, "#ffffff" .. getPlayerName(localPlayer):gsub("_", " ") .. " #ca5454(" .. getVehiclePlateText(vehicle) .. ") #ffffffbejelentkezett az #598ED7MDCbe#ffffff.")
  365. loggedIn = true
  366. for k, v in ipairs(getElementsByType("player")) do
  367. if getElementData(v, "acc:admin") >= 1 then
  368. admins[#admins+1] = {v}
  369. end
  370. end
  371. removeEventHandler("onClientRender", getRootElement(), drawLoginPanel)
  372. if isElement(username) then
  373. destroyElement(username)
  374. end
  375. if isElement(usernameedit) then
  376. destroyElement(usernameedit)
  377. end
  378. if isElement(password) then
  379. destroyElement(password)
  380. end
  381. if isElement(passwordedit) then
  382. destroyElement(passwordedit)
  383. end
  384. end
  385. addEvent("loginAdminClient", true)
  386. addEventHandler("loginAdminClient", getRootElement(), loginAdminClient)
  387.  
  388. function validateAdminLogin()
  389. if not isTimer(theTimer) then
  390. theTimer = setTimer(function() end, 10000, 1)
  391. if guiGetText(usernameedit) ~= "" and guiGetText(passwordedit) ~= "" then
  392. triggerServerEvent("adminLoginServer", localPlayer, guiGetText(usernameedit), guiGetText(passwordedit))
  393. else
  394. outputChatBox("fail")
  395. end
  396. end
  397. end
  398.  
  399. function roundedRectangle(x, y, w, h, borderColor, bgColor, postGUI)
  400. if (x and y and w and h) then
  401. if (not borderColor) then
  402. borderColor = tocolor(0, 0, 0, 200);
  403. end
  404.  
  405. if (not bgColor) then
  406. bgColor = borderColor;
  407. end
  408.  
  409. --> Background
  410. dxDrawRectangle(x, y, w, h, bgColor, postGUI);
  411.  
  412. --> Border
  413.  
  414. dxDrawRectangle(x-2, y, 2, h+2, tocolor(0, 0, 0, 255), postGUI);
  415. dxDrawRectangle(x-2, y-2, w+4, 2, tocolor(0, 0, 0, 255), postGUI);
  416. dxDrawRectangle(x+w, y, 2, h, tocolor(0, 0, 0, 255), postGUI);
  417. dxDrawRectangle(x, y+h, w+2, 2, tocolor(0, 0, 0, 255), postGUI);
  418. end
  419. end
  420.  
  421. bindKey("mouse_wheel_down", "down",
  422. function()
  423. if showPanel then
  424. if scrollingData < #admins - maxShow then
  425. scrollingData = scrollingData + 1
  426. end
  427. end
  428. end
  429. )
  430.  
  431. bindKey("mouse_wheel_up", "down",
  432. function()
  433. if showPanel then
  434. if scrollingData > 0 then
  435. scrollingData = scrollingData - 1
  436. end
  437. end
  438. end
  439. )
  440.  
  441. bindKey("mouse_wheel_down", "down",
  442. function()
  443. if showPanel and selectedProvision == 1 then
  444. if scrollingData < #bans - maxShowBtk then
  445. scrollingData = scrollingData + 1
  446. end
  447. end
  448. end
  449. )
  450.  
  451. bindKey("mouse_wheel_up", "down",
  452. function()
  453. local vehicle = getPedOccupiedVehicle(localPlayer)
  454. if showPanel and selectedProvision == 1 then
  455. if scrollingData > 0 then
  456. scrollingData = scrollingData - 1
  457. end
  458. end
  459. end
  460. )
  461.  
  462. bindKey("mouse_wheel_down", "down",
  463. function()
  464. if showPanel and selectedProvision == 2 then
  465. if scrollingData < #kicks - maxShow then
  466. scrollingData = scrollingData + 1
  467. end
  468. end
  469. end
  470. )
  471.  
  472. bindKey("mouse_wheel_up", "down",
  473. function()
  474. if showPanel and selectedProvision == 2 then
  475. if scrollingData > 0 then
  476. scrollingData = scrollingData - 1
  477. end
  478. end
  479. end
  480. )
  481.  
  482. bindKey("mouse_wheel_down", "down",
  483. function()
  484. if showPanel and selectedProvision == 3 then
  485. if scrollingData < #jails - maxShow then
  486. scrollingData = scrollingData + 1
  487. end
  488. end
  489. end
  490. )
  491.  
  492. bindKey("mouse_wheel_up", "down",
  493. function()
  494. if showPanel and selectedProvision == 3 then
  495. if scrollingData > 0 then
  496. scrollingData = scrollingData - 1
  497. end
  498. end
  499. end
  500. )
Add Comment
Please, Sign In to add comment