Jump to content

klue

Members
  • Posts

    4
  • Joined

  • Last visited

Details

  • Location
    Hungary
  • Occupation
    Developer

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

klue's Achievements

Vic

Vic (3/54)

0

Reputation

  1. klue

    onClientClick

    local sx, sy = guiGetScreenSize(); local show = false; render = function () -- // alap "kocka" \\ -- dxDrawRectangle(sx*0.38, sy*0.30, sx*0.26, sy*0.5, tocolor(0,0,0,180), false); -- // keret \\ -- dxDrawRectangle(sx*0.38, sy*0.30, sx*0.002, sy*0.5, tocolor(255,0,0,210), false); dxDrawRectangle(sx*0.64, sy*0.30, sx*0.002, sy*0.5, tocolor(255,0,0,210), false); dxDrawRectangle(sx*0.38, sy*0.30, sx*0.26, sy*0.002, tocolor(255,0,0,210), false); dxDrawRectangle(sx*0.38, sy*0.80, sx*0.26, sy*0.002, tocolor(255,0,0,210), false); -- // premium panel irat es doboza \\ -- dxDrawRectangle(sx*0.38, sy*0.30, sx*0.26, sy*0.06, tocolor(0,0,0,150), false); dxDrawText("Prémium Panel", sx*0.38, sy*0.35, sx*0.63, sy*0.36, tocolor(255,255,255), 2, "pricedown", "right", "bottom", false, false, false, false); -- // jármű lehívó \\ -- -- tank -- dxDrawRectangle(sx*0.39, sy*0.38, sx*0.11, sy*0.070, tocolor(180, 102, 88, 178), false); dxDrawImage(sx*0.42, sy*0.40, sx*0.05, sy*0.050, "img/Rhino.png") dxDrawText("Tank", sx*0.62, sy*0.68, sx*0.46, sy*0.41, tocolor(255,255,255), 2, "clear", "right", "bottom", false, false, false, false); -- hydra -- dxDrawRectangle(sx*0.52, sy*0.38, sx*0.11, sy*0.070, tocolor(180, 102, 88, 178), false); -- // fegyverek \\ -- dxDrawText("Exlúzív fegyverek", sx*0.35, sy*0.35, sx*0.59, sy*0.49, tocolor(255,255,255), 2, "clear", "right", "bottom", false, false, false, false); end addEventHandler("onClientRender",root, render); addEventHandler("onClientClick", root, function (button, state) if state then if button == "left" then if isCursorHover(sx*0.39, sy*0.38, sx*0.11, sy*0.070) then -- Ide jön a tank lehívás, amit már megkéne tudnod magadtól csinálni. -- Lényeg: szerver oldalon csinálod, triggerServerEvent (nézz utána wikin) -- ahol van createVehicle (lekéred a játékos pozícióját, és adsz az x kordinátához + 5-t. triggerServerEvent("event neve", localPlayer) end end end end); isCursorHover = function (x, y, w, h) if x and y and w and h then if isCursorShowing() then if not isMTAWindowActive() then local cursorX, cursorY = getCursorPosition() cursorX, cursorY = cursorX * sx, cursorY * sy; if cursorX >= x and cursorX <= x + w and cursorY >= y and cursorY <= y + h then return true; end end end end return false; end bindKey("m", "down", function () showCursor(not isCursorShowing()); end);
  2. I haven't tested it, but it should work. local screenWidth, screenHeight = guiGetScreenSize(); local isVisible = false; local browser = false; loadBrowser = function () loadBrowserURL(source, "https://www.youtube.com"); end addEventHandler("onClientResourceStart", resourceRoot, function () browser = createBrowser(screenWidth, screenHeight, true, true); if browser then addEventHandler("onClientBrowserCreated", browser, loadBrowser); end end); toggleBrowser = function () if isVisible then isVisible = false; removeEventHandler("onClientRender", root, draw); else isVisible = true; addEventHandler("onClientRender", root, draw); end end draw = function () local sx = 800; local sy = 600; local x = (screenWidth - sx) / 2; local y = (screenHeight - sy) / 2; dxDrawImage(x, y, sx, sy, browser); end bindKey("F4", "down", toggleBrowser);
  3. @ironimust local connection; local credentials = { dbname = "-", host = "-", port = "3306", charset = "utf8", username = "-", password = "-", multi_statements = "1" }; addEventHandler("onResourceStart", getResourceRootElement(), function () if isElement(connection) then print(" Error occured - Connection already exists!"); return false; end connection = dbConnect("mysql", "dbname=" .. credentials.dbname .. ";host=" .. credentials.host .. ";port=" .. credentials.port .. ";charset=" .. credentials.charset, credentials.username, credentials.password, "autoreconnect=1;multi_statements=" .. credentials.multi_statements); if not connection then print(" Error occured - Failed to connect!"); return false; else print(" Database connected! (" .. credentials.dbname .. ")"); end end);
×
×
  • Create New...