Jump to content

Testing browser with local html (404)


ViRuZGamiing

Recommended Posts

<meta>
	<script src="client.lua" type="client" />

	<min_mta_version server="1.5.0-9.07439" />
</meta>

Client:

local x, y = guiGetScreenSize()
local browser = createBrowser(x, y, true)

addCommandHandler("lgn", function()
  loadBrowserURL(browser, "http://mta/local/login.html")

  addEventHandler("onClientRender", getRootElement(), function()
    dxDrawImage(0, 0, x, y, browser, 0, 0, 0, tocolor(255, 255, 255), true)
  end)
end)

Clipboardimage2016-12-13230816.png

File tree being:

Clipboardimage2016-12-13230904.png

Link to comment
35 minutes ago, pa3ck said:

You must include all files, including JS, CSS, HTML in your meta. Also, your resource is called test, why is it not this then:  loadBrowserURL(browser, "http://mta/test/login.html")

And I quote;

'resourceName: The resource name, local is a special name for the current resource'

https://wiki.multitheftauto.com/wiki/Local_Scheme_Handler

That's why. didn't knew I had to add it to the Meta tho. Script or file tag?

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...