H20 Posted Thursday at 12:02 Share Posted Thursday at 12:02 Hi guys , I don't know what's wrong with my code, I'm trying to load instagram , but nothing worked! Here's my code: local screenW, screenH = guiGetScreenSize() local resW, resH = 1366, 768 local x, y = (screenW / resW), (screenH / resH) requestBrowserDomains({"instagram.com"}) local font = dxCreateFont("files/fontt4.ttf", y * 10) local font2 = dxCreateFont("files/fontt5.ttf", y * 8) local webBrowser local isBrowserOpen = false function openInstagram() if isBrowserOpen then return end -- Prevent multiple instances webBrowser = guiCreateBrowser(0, 0, screenW, screenH, false, true, false) local browser = guiGetBrowser(webBrowser) addEventHandler("onClientBrowserCreated", browser, function() showCursor(true) loadBrowserURL(browser, "http://www.instagram.com") end) isBrowserOpen = true end function closeInstagram() if isBrowserOpen and isElement(webBrowser) then showCursor(false) destroyElement(webBrowser) webBrowser = nil isBrowserOpen = false end end function drawInterface() local time = getRealTime() local Hora = string.format("%02d", time.hour) local Minuto = string.format("%02d", time.minute) -- Draw background and UI elements efficiently local backgroundImage = getElementData(localPlayer, "ZN-CellCfgNPert") and "files/4.png" or "files/3.png" dxDrawImage(x * 1100, y * 150, x * 250, y * 500, "files/fundo3.png", 0, 0, 0, tocolor(31, 44, 52)) dxDrawImage(x * 1100, y * 151, x * 247, y * 500, backgroundImage, 0, 0, 0, tocolor(255, 255, 255)) dxDrawText(Hora .. ":" .. Minuto, x * 1120, y * 303, x * 1120, y * 40, tocolor(255, 255, 255), 1.0, font2, "left", "center", false, false, false, true, false) end -- Command to toggle the browser addCommandHandler("insta", function() if isBrowserOpen then closeInstagram() else openInstagram() end end) Link to comment
Question
H20
Hi guys , I don't know what's wrong with my code, I'm trying to load instagram , but nothing worked!
Here's my code:
Link to comment
0 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now