Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.75 KB | None | 0 0
  1. local sx, sy = guiGetScreenSize()
  2. local currentPanel = nil
  3. local loginEdits = false
  4. local loginNevActive = false
  5. local loginNevTime = 0
  6. local loginJelszoActive = false
  7. local loginJelszoTime = 0
  8. local currentNem = 0
  9. local characterEdits = false
  10. local tableAccounts = nil
  11. local font = dxCreateFont("files/font.ttf", 10)
  12. local font2 = dxCreateFont("files/font.ttf", 20)
  13. login = playSound( "files/login.mp3", true)
  14. local components = { "weapon", "ammo", "health", "clock", "money", "breath", "armour", "wanted", "radar" }
  15. local created = false
  16.  
  17. addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),function()
  18. triggerServerEvent("join",localPlayer)
  19. end
  20. )
  21.  
  22. addEvent("startlogin",true)
  23. addEventHandler("startlogin",root, function()
  24.     setPlayerHudComponentVisible("all", false )
  25.     setCameraMatrix(2098.5517578125, 1285.4072265625, 71.978401184082, 2173.1533203125, 1285.568359375, 27.976778030396)
  26.     currentPanel = "playerLogin"
  27.     showCursor(true)
  28.     showChat(false)
  29.     fadeCamera(true)
  30.     executeCommandHandler("togradar", playerSource)
  31.     executeCommandHandler("toghud", playerSource)
  32.     executeCommandHandler("togooc", playerSource)
  33.     guiSetInputMode("no_binds_when_editing")
  34. end)
  35.  
  36. function render ()
  37.     if currentPanel == "playerLogin" then
  38.         --dxDrawText("#e64343once#ffffffMTA", sx/2 - 275/2 + 275, sy/2 - 350/2 - 50, sx/2 - 275/2, sy/2 - 350/2, tocolor(255, 255, 255, 255), 1, font2, "center", "center", false, false, false, true)
  39.         --dxDrawText("#FFFFFF2#e64343k#ffffff17", sx/2 - 275/2 + 275, sy/2 - 350/2 - 200, sx/2 - 275/2, sy/2 - 350/2, tocolor(255, 255, 255, 255), 1, font2, "center", "center", false, false, false, true)
  40.         dxDrawRectangle(sx/2 - 250, sy/2 - 200, 500, 45,tocolor(0,0,0,50))
  41.         dxDrawRectangle(sx/2 - 245, sy/2 - 195, 490, 35,tocolor(0,0,0,130))
  42.         dxDrawImage(sx/2 - 235, sy/2 - 200, 500, 45, "/files/loginimage.png")
  43.         dxDrawRectangle(sx/2 - 250, sy/2 - 145, 500, 300,tocolor(0,0,0,50))
  44.         dxDrawRectangle(sx/2 - 245, sy/2 - 140, 490, 290, tocolor(0,0,0,130))
  45.         dxDrawText("Üdvözlünk a szerveren! Kellemes időtöltést kívánunk a szerverünkön. ;)", sx/2 - 10/2 + 2 + 110 - 4, sy/2 - 300, sx/2 - 200/2 + 2, sy/2 + 50 + 2, tocolor(255,255, 255, 255), 1, "default-bold", "center", "center", false, false, false, true)
  46.         dxDrawText("#e64343Figyelem!! #FFFFFFA szerverre történő regisztrációval elfogadod a szerver szabályzatát.", sx/2 - 10/2 + 2 + 110 - 4, sy/2 + 200, sx/2 - 200/2 + 2, sy/2 + 50 + 2, tocolor(255, 255, 255, 255), 1, "default-bold", "center", "center", false, false, false, true)
  47.         dxDrawImage(sx/2 - 140, sy/2 - 100, 30, 30, "/files/user.png")
  48.         dxDrawImage(sx/2 - 140, sy/2 - 45, 30, 30, "/files/pass.png")
  49.             if not loginEdits then
  50.             loginEdits = true
  51.             loginNev = guiCreateEdit(sx/2 - 200/2, sy/2 - 350/2 + 75, 200, 30, "", true)
  52.             loginJelszo = guiCreateEdit(sx/2 - 200/2, sy/2 - 350/2 + 130, 200, 30, "", true)
  53.  
  54.             guiEditSetMaxLength(loginNev, 15)
  55.             guiEditSetMaxLength(loginJelszo, 20)
  56.         end
  57.  
  58.         local accountNameText = guiGetText(loginNev)
  59.         local accountPassText = guiGetText(loginJelszo)
  60.  
  61.         if accountNameText == "" then
  62.             accountNameText = "Felhasználónév"
  63.         end
  64.  
  65.         local username = ""
  66.         local password = ""
  67.         local password2 = ""
  68.         for i = 1, string.len(accountPassText) do
  69.             password = password .. "•"
  70.         end
  71.  
  72.         if password == "" then
  73.             password = "Jelszó"
  74.         end
  75.  
  76.         if loginNevActive then
  77.             loginNevTime = loginNevTime + 1
  78.             if loginNevTime >= 100 and loginNevTime < 200 then
  79.                 username = "#FFFFFF|"
  80.             elseif loginNevTime == 200 then
  81.                 loginNevTime = 0
  82.             elseif loginNevTime == 0 then
  83.                 username = ""
  84.             end
  85.         end
  86.  
  87.         if loginJelszoActive then
  88.             loginJelszoTime = loginJelszoTime + 1
  89.             if loginJelszoTime >= 100 and loginJelszoTime < 200 then
  90.                 password2 = "#FFFFFF|"
  91.             elseif loginJelszoTime == 200 then
  92.                 loginJelszoTime = 0
  93.             elseif loginJelszoTime == 0 then
  94.                 password2 = ""
  95.             end
  96.         end
  97.  
  98.         local loginGomb = 0
  99.         local regisztracioGomb = 0
  100.  
  101.         if isCursorInRectangle(sx/2 - 200/2, sy/2 + 50, 95, 30) then
  102.             loginGomb = 150
  103.         elseif isCursorInRectangle(sx/2 - 200/2, sy/2 + 50, 210, 30) then
  104.             regisztracioGomb = 150
  105.         end
  106.  
  107.         dxDrawRectangle(sx/2 - 200/2, sy/2 - 350/2 + 75, 200, 30, tocolor(120, 120, 120, 50))
  108.         dxDrawText(accountNameText, sx/2 - 200/2 + 5, sy/2 - 350/2 + 75 + 7, 0, 0, tocolor(255, 255, 255, 255), 1, font, "left", "top")
  109.         dxDrawText(username, sx/2 - 200/2 + 5 + dxGetTextWidth(accountNameText, 1, font), sy/2 - 350/2 + 75 + 7, 0, 0, tocolor(255, 255, 255, 255), 1, font, "left", "top", false, false, false, true)
  110.  
  111.         dxDrawRectangle(sx/2 - 200/2, sy/2 - 350/2 + 130, 200, 30, tocolor(120, 120, 120, 50))
  112.         dxDrawText(password, sx/2 - 200/2 + 5, sy/2 - 350/2 + 130 + 7, 0, 0, tocolor(255, 255, 255, 255), 1, font, "left", "top")
  113.         dxDrawText(password2, sx/2 - 200/2 + 5 + dxGetTextWidth(password, 1, font), sy/2 - 350/2 + 130 + 7, 0, 0, tocolor(255, 255, 255, 255), 1, font, "left", "top", false, false, false, true)
  114.  
  115.         dxDrawRectangle(sx/2 - 200/2, sy/2 + 50, 95, 30, tocolor(120, 120, 120, 50))
  116.         dxDrawRectangle(sx/2 - 200/2 + 2, sy/2 + 50 + 2, 95 - 4, 30 - 4, tocolor(230, 67, 67, loginGomb))
  117.         dxDrawText("Bejelentkezés", sx/2 - 200/2 + 2 + 95 - 4, sy/2 + 50 + 2 + 30 - 4, sx/2 - 200/2 + 2, sy/2 + 50 + 2, tocolor(255, 255, 255, 255), 1, font, "center", "center", false, false, false, true)
  118.  
  119.         dxDrawRectangle(sx/2 - -10/2, sy/2 + 50, 95, 30, tocolor(120, 120, 120, 50))
  120.         dxDrawRectangle(sx/2 - -10/2 + 2, sy/2 + 50 + 2, 95 - 4, 30 - 4, tocolor(230, 67, 67, regisztracioGomb))
  121.         dxDrawText("Regisztráció", sx/2 - 10/2 + 2 + 210 - 4, sy/2 + 50 + 2 + 30 - 4, sx/2 - 200/2 + 2, sy/2 + 50 + 2, tocolor(255, 255, 255, 255), 1, font, "center", "center", false, false, false, true)
  122.     elseif currentPanel == "characterCreate" then
  123.         if not characterEdits then
  124.             characterEdits = true
  125.             charName = guiCreateEdit(30, sy/2 - 400/2 + 25, 315, 30, "", false)
  126.             charKor = guiCreateEdit(30, sy/2 - 400/2 + 80, 315, 30, "", false)
  127.             charSuly = guiCreateEdit(30, sy/2 - 400/2 + 135, 315, 30, "", false)
  128.             charMagassag = guiCreateEdit(30, sy/2 - 10, 315, 30, "", false)
  129.  
  130.             guiEditSetMaxLength(charName, 36)
  131.             guiEditSetMaxLength(charKor, 2)
  132.             guiEditSetMaxLength(charSuly, 2)
  133.             guiEditSetMaxLength(charMagassag, 3)
  134.  
  135.             guiSetAlpha(charName, 0)
  136.             guiSetAlpha(charKor, 0)
  137.             guiSetAlpha(charSuly, 0)
  138.             guiSetAlpha(charMagassag, 0)
  139.         end
  140.  
  141.         local nameText = guiGetText(charName)
  142.         local korText = guiGetText(charKor)
  143.         local sulyText = guiGetText(charSuly)
  144.         local magassagText = guiGetText(charMagassag)
  145.  
  146.         local ferfiAlpha = 0
  147.         local noAlpha = 0
  148.         if isCursorInRectangle(30 + 2, sy/2 + 45 + 2, 145 - 4, 30 - 4) then
  149.             ferfiAlpha = 150
  150.         elseif isCursorInRectangle(200 + 2, sy/2 + 45 + 2, 145 - 4, 30 - 4) then
  151.             noAlpha = 150
  152.         end
  153.  
  154.         if currentNem == 0 then
  155.             ferfiAlpha = 150
  156.         else
  157.             noAlpha = 150
  158.         end
  159.         dxDrawRectangle(25, sy/2 - 380/2, 325, 220, tocolor(0, 0, 0, 120))
  160.  
  161.         dxDrawRectangle(30, sy/2 - 400/2 + 25, 315, 30, tocolor(0, 0, 0, 150)) -- NÉV
  162.         dxDrawText("Név", 30, sy/2 - 400/2 + 10, 0, 0, tocolor(255, 255, 255, 255), 1, font, "left", "top")
  163.         dxDrawText(nameText, 30 + 5, sy/2 - 400/2 + 25 + 9, 0, 0, tocolor(255, 255, 255, 255), 1, font, "left", "top")
  164.  
  165.         dxDrawRectangle(30, sy/2 - 400/2 + 80, 315, 30, tocolor(0, 0, 0, 150)) -- KOR
  166.         dxDrawText("Kor", 30, sy/2 - 400/2 + 65, 0, 0, tocolor(255, 255, 255, 255), 1, font, "left", "top")
  167.         dxDrawText(korText, 30 + 5, sy/2 - 400/2 + 80 + 9, 0, 0, tocolor(255, 255, 255, 255), 1, font, "left", "top")
  168.  
  169.         dxDrawRectangle(30, sy/2 - 400/2 + 135, 315, 30, tocolor(0, 0, 0, 150)) -- SÚLY
  170.         dxDrawText("Súly", 30, sy/2 - 400/2 + 120, 0, 0, tocolor(255, 255, 255, 255), 1, font, "left", "top")
  171.         dxDrawText(sulyText, 30 + 5, sy/2 - 400/2 + 135 + 9, 0, 0, tocolor(255, 255, 255, 255), 1, font, "left", "top")
  172.  
  173.         dxDrawRectangle(30, sy/2 - 10, 315, 30, tocolor(0, 0, 0, 150)) -- MAGASSÁG
  174.         dxDrawText("Magasság", 30, sy/2 - 25, 0, 0, tocolor(255, 255, 255, 255), 1, font, "left", "top")
  175.         dxDrawText(magassagText, 30 + 5, sy/2 - 10 + 9, 0, 0, tocolor(255, 255, 255, 255), 1, font, "left", "top")
  176.  
  177.         dxDrawRectangle(30, sy/2 + 45, 145, 30, tocolor(0, 0, 0, 150)) -- FÉRFI
  178.         dxDrawRectangle(30 + 2, sy/2 + 45 + 2, 145 - 4, 30 - 4, tocolor(230, 67, 67, ferfiAlpha))
  179.         dxDrawText("Férfi", 30 + 2 + 145 - 4, sy/2 + 45 + 2 + 30 - 4, 30 + 2, sy/2 + 45 + 2, tocolor(255, 255, 255, 255), 1, font, "center", "center")
  180.  
  181.         dxDrawRectangle(200, sy/2 + 45, 145, 30, tocolor(0, 0, 0, 150)) -- NŐ
  182.         dxDrawRectangle(200 + 2, sy/2 + 45 + 2, 145 - 4, 30 - 4, tocolor(230, 67, 67, noAlpha))
  183.         dxDrawText("Nő", 200 + 2 + 145 - 4, sy/2 + 45 + 2 + 30 - 4, 200 + 2, sy/2 + 45 + 2, tocolor(255, 255, 255, 255), 1, font, "center", "center")
  184.  
  185.         dxDrawRectangle(115, sy/2 + 85, 146, 32, tocolor(0, 0, 0, 150)) -- Gomb
  186.         dxDrawRectangle(115, sy/2 + 85, 145, 30, tocolor(230, 67, 67, 150)) -- Gomb
  187.         dxDrawText("Létrehozás", 25 + 325, sy/2 - 400/2 + 600, 25, sy/2 - 400/2, tocolor(255, 255, 255, 255), 1, font, "center", "center")
  188.  
  189.     elseif currentPanel == "characterPanel" then
  190.         if created == true then
  191.             dxDrawRectangle(25, sy/2 - 400/2, 325, 200, tocolor(0, 0, 0, 150))
  192.             dxDrawRectangle(25 + 2, sy/2 - 400/2 + 2, 325 - 4, 26 - 4, tocolor(0, 0, 0, 150))
  193.                 local charname = characterdeatil[1]:gsub("_"," ")
  194.                 --local cked =
  195.                 --local area =
  196.                 local age = characterdeatil[2]
  197.                 local gender = characterdeatil[3]
  198.                 --local factionName =
  199.                 --local factionRank =
  200.                 local skinID = characterdeatil[4]
  201.                 --local difference =
  202.                 if gender == 0 then
  203.                     gender = "Férfi"
  204.                 else
  205.                     gender = "Nő"
  206.                 end
  207.                 dxDrawText(charname, 25 + 325, sy/2 - 400/2 + 26, 25, sy/2 - 400/2, tocolor(255, 255, 255, 255), 1, font, "center", "center")
  208.                 --dxDrawText("Tartózkodási hely:#e64343 " .. area, 30, sy/2 - 170, 0, 0, tocolor(255, 255, 255, 255), 1, font, "left", "top", false, false, false, true)
  209.                 dxDrawText("Kor:#e64343 " .. age .. " éves", 30, sy/2 - 150, 0, 0, tocolor(255, 255, 255, 255), 1, font, "left", "top", false, false, false, true)
  210.                 dxDrawText("Nem:#e64343 " .. gender, 30, sy/2 - 130, 0, 0, tocolor(255, 255, 255, 255), 1, font, "left", "top", false, false, false, true)
  211.                 --dxDrawText("Szervezet:#e64343 " .. factionName, 30, sy/2 - 110, 0, 0, tocolor(255, 255, 255, 255), 1, font, "left", "top", false, false, false, true)
  212.                 --dxDrawText("Szervezetbeli rang:#e64343 " .. factionRank, 30, sy/2 - 90, 0, 0, tocolor(255, 255, 255, 255), 1, font, "left", "top", false, false, false, true)
  213.                 dxDrawText("Skin:#e64343 " .. skinID, 30, sy/2 - 70, 0, 0, tocolor(255, 255, 255, 255), 1, font, "left", "top", false, false, false, true)
  214.  
  215.                 dxDrawRectangle(25, sy/1.99, 325, 26 - 4, tocolor(230, 67, 67, 150))
  216.                 dxDrawText("Belépéshez kattints ide!" ,25 + 325, sy/2 - 400/2 + 430, 25, sy/2 - 400/2, tocolor(255, 255, 255, 255), 1, font, "center", "center")
  217.         else
  218.  
  219.             dxDrawRectangle(25, sy/2 - 225/2, 225, 225, tocolor(0, 0, 0, 150))
  220.  
  221.             local letrehozasAlpha = 0
  222.             if isCursorInRectangle(25 + 15 + 2, sy/2 - 30/2 + 2, 200 - 4, 30 - 4) then
  223.                 letrehozasAlpha = 150
  224.             end
  225.  
  226.             dxDrawRectangle(25 + 15, sy/2 - 400/2 + 100, 200, 30, tocolor(0, 0, 0, 150))
  227.             dxDrawText("Jelenleg nincs karaktered!", 25 + 15 + 200, sy/2 - 400/2 + 100 + 30, 25 + 15, sy/2 - 400/2 + 100, tocolor(255, 255, 255, 255), 1, font, "center", "center")
  228.  
  229.             dxDrawRectangle(25 + 15, sy/2 - 30/2, 200, 30, tocolor(0, 0, 0, 150))
  230.             dxDrawRectangle(25 + 15 + 2, sy/2 - 30/2 + 2, 200 - 4, 30 - 4, tocolor(230, 67, 67, letrehozasAlpha))
  231.             dxDrawText("Létrehozás", 25 + 15 + 2 + 200 - 4, sy/2 - 30/2 + 2 + 30 - 4, 25 + 15 + 2, sy/2 - 30/2 + 2, tocolor(255, 255, 255, 255), 1, font, "center", "center")
  232.         end
  233.     end
  234. end
  235. addEventHandler("onClientRender", root, render)
  236.  
  237. addEvent("showCharacterUI", true)
  238. addEventHandler("showCharacterUI", root, function()
  239.     currentPanel = "characterPanel"
  240.     setCameraInterior(1)
  241.     setCameraMatrix(2.8955078125, 29.984375, 1199.778125, 2.439453125, 29.501953125, 1199.6011962891)
  242.     toggleAllControls(false, true, false)
  243.     local width, height = 420, 400
  244.     triggerServerEvent("reganim",localPlayer)
  245. end)
  246.  
  247. addEvent("showCharacter", true)
  248. addEventHandler("showCharacter", root, function(input)
  249.     currentPanel = "characterPanel"
  250.     created = true
  251.     characterdeatil = input
  252. end)
  253.  
  254. addEvent("hideCharacterUI", true)
  255. addEventHandler("hideCharacterUI", root, function()
  256.     removeEventHandler("onClientRender", getRootElement(), render)
  257.     removeEventHandler("onClientRender", root, click)
  258.     showCursor(false)
  259.     showChat(true)
  260.     toggleAllControls(true)
  261.     stopSound(login)
  262. end)
  263. addEventHandler("onClientKey", root, function(g, s)
  264.     if currentPanel == "playerLogin" then
  265.         if g == "tab" and s then
  266.             if loginNevActive then
  267.                 loginNevActive = false
  268.                 loginJelszoActive = true
  269.                 loginJelszoTime = 0
  270.             elseif loginJelszoActive then
  271.                 loginJelszoActive = false
  272.                 loginNevActive = true
  273.                 loginNevTime = 0
  274.             end
  275.         end
  276.     end
  277. end)
  278.  
  279. function click (g, s, x, y)
  280.     if g == "left" and s == "down" then
  281.         if currentPanel == "playerLogin" then
  282.             if inBox(sx/2 - 200/2, sy/2 - 350/2 + 75, 200, 30, x, y) then
  283.                 if loginJelszoActive then loginJelszoActive = false end
  284.  
  285.                 loginNevActive = true
  286.                 loginNevTime = 0
  287.                 if guiEditSetCaretIndex(loginNev, string.len(guiGetText(loginNev))) then
  288.                     guiBringToFront(loginNev)
  289.                 end
  290.             elseif inBox(sx/2 - 200/2, sy/2 - 350/2 + 130, 200, 30, x, y) then
  291.                 if loginNevActive then loginNevActive = false end
  292.  
  293.                 loginJelszoActive = true
  294.                 loginJelszoTime = 0
  295.                 if guiEditSetCaretIndex(loginJelszo, string.len(guiGetText(loginJelszo))) then
  296.                     guiBringToFront(loginJelszo)
  297.                 end
  298.             elseif not inBox(sx/2 - 200/2, sy/2 - 350/2 + 75, 200, 30, x, y) or not inBox(sx/2 - 200/2, sy/2 - 350/2 + 130, 200, 30, x, y) then
  299.                 if loginNevActive then loginNevActive = false end
  300.                 if loginJelszoActive then loginJelszoActive = false end
  301.             end
  302.  
  303.             if inBox(sx/2 - 200/2 + 2, sy/2 + 50 + 2, 95 - 4, 30 - 4, x, y) then
  304.                 --outputChatBox("login")
  305.                 local accountNameText = guiGetText(loginNev)
  306.                 local accountPassText = guiGetText(loginJelszo)
  307.                 if string.len(accountNameText) >= 3 and string.len(accountPassText) >= 6 then
  308.                     triggerServerEvent("login", localPlayer, localPlayer, accountNameText, accountPassText)
  309.                 end
  310.             end
  311.  
  312.             if inBox(sx/2 - -10/2 + 2, sy/2 + 50 + 2, 210 - 4, 30 - 4, x, y) then
  313.                 --outputChatBox("register")
  314.                 local accountNameText = guiGetText(loginNev)
  315.                 local accountPassText = guiGetText(loginJelszo)
  316.                 if string.len(accountNameText) >= 3 and string.len(accountPassText) >= 6 then
  317.                     triggerServerEvent("register", localPlayer, localPlayer, accountNameText, accountPassText)
  318.                 end
  319.             end
  320.         elseif currentPanel == "characterPanel" then
  321.             if created == true then
  322.                 if inBox(25, sy/1.99, 325 - 4, 26 - 4, x, y) then
  323.                     showCursor(false)
  324.                     executeCommandHandler ( "togradar", playerSource )
  325.                     executeCommandHandler ( "toghud", playerSource )
  326.                     executeCommandHandler ( "togooc", playerSource )
  327.                     stopSound(login)
  328.                     showChat(true)
  329.                     triggerServerEvent("logincar", localPlayer)
  330.                 end
  331.             else
  332.                 if inBox(25 + 15 + 2, sy/2 - 30/2 + 2, 200 - 4, 30 - 4, x, y) then
  333.                     currentPanel = "characterCreate"
  334.                 end
  335.             end
  336.         elseif currentPanel == "characterCreate" then
  337.             if inBox(30 + 2, sy/2 + 45 + 2, 145 - 4, 30 - 4, x, y) then
  338.                 currentNem = 0
  339.                 setElementModel(localPlayer, 0)
  340.                 triggerServerEvent("reganim",localPlayer)
  341.             elseif inBox(200 + 2, sy/2 + 45 + 2, 145 - 4, 30 - 4, x, y) then
  342.                 currentNem = 1
  343.                 setElementModel(localPlayer, 56)
  344.                 triggerServerEvent("reganim",localPlayer)
  345.             end
  346.  
  347.             if inBox(250/2 - 15, sy/2 + 200/2 - 13, dxGetTextWidth("Létrehozáshoz kattints ide!", 1, font) + 20, 26, x, y) then
  348.                 --outputChatBox("Létrehozás")
  349.                 local nameText = guiGetText(charName)
  350.                 local korText = guiGetText(charKor)
  351.                 local sulyText = guiGetText(charSuly)
  352.                 showChat(false)
  353.                 local magassagText = guiGetText(charMagassag)
  354.                 triggerServerEvent("registercar", localPlayer, nameText, currentNem, sulyText, magassagText, korText, getElementModel(localPlayer))
  355.             end
  356.         end
  357.     end
  358. end
  359. addEventHandler("onClientClick", root, click)
  360.  
  361. function inBox(dX, dY, dSZ, dM, eX, eY)
  362.     if( eX >= dX and eX <= dX + dSZ and eY >= dY and eY <= dY + dM ) then
  363.         return true
  364.     else
  365.         return false
  366.     end
  367. end
  368.  
  369. function isCursorInRectangle(x,y,w,h)
  370.     if isCursorShowing() then
  371.     local mx,my = getCursorPosition()
  372.     local cursorx,cursory = mx*sx,my*sy
  373.         if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
  374.             return true
  375.         else
  376.             return false
  377.         end
  378.     end
  379. end
  380.  
  381. addCommandHandler("poss", function()
  382.     local x, y, z, x2, y2, z2 = getCameraMatrix()
  383.     outputChatBox(x .. ", " .. y .. ", " .. z .. ", " .. x2 .. ", " .. y2 .. ", " .. z2)
  384. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement