Jump to content

Error Loading image


gravgor

Recommended Posts

Hello, today I experienced a problem related to the failure of the picture. Everything is written in meta.xml and the picture exists in this folder.

	local sw, sh = guiGetScreenSize()
local w, h = (sw/1366), (sh/768)
	local gui = {
    login = guiCreateEdit(459, 393, 290, 30, "", false),
    pass  = guiCreateEdit(459, 448, 290, 30, "", false)
    --tlo = dxDrawImage(402, 159, 655, 511, "logowanie6.png", 0, 0, 0, tocolor(255, 255, 255, 255), false),
    --przycisk1 = dxDrawImage(447, 578, 194, 32, "logowanie1.png", 0, 0, 0, tocolor(255, 255, 255, 255), false),
    --przycisk2 = dxDrawImage(450, 622, 91, 33, "logowanie2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false),
    --text1 = dxDrawText("Zaloguj lub zarejestruj się!", 476, 255*h, 730*w, 373*h, tocolor(15, 14, 14, 255), 2.00, "default", "left", "top", false, false, false, false, false),
    --text2 = dxDrawText("Zaloguj się", 460*w, 628*h, 531*w, 650*h, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false),
   -- text3 = dxDrawText("Zarejestruj się", 470*w, 588*h, 620*w, 605*h, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false),
}
	function renderGuiDX()
dxDrawImage(399, 181, 690, 496, "img/tlo.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(447, 578, 194, 32, "logowanie1.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(450, 622, 91, 33, "logowanie2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawText("Zaloguj lub zarejestruj się!", 476, 255*h, 730*w, 373*h, tocolor(15, 14, 14, 255), 2.00, "default", "left", "top", false, false, false, false, false)
dxDrawText("Zaloguj się", 460*w, 628*h, 531*w, 650*h, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false)
dxDrawText("Zarejestruj się", 470*w, 588*h, 620*w, 605*h, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false)
end
	addEventHandler("onClientResourceStart", resourceRoot, function()
    showGUI(true)
    fadeCamera(true)
    guiEditSetMasked(gui.pass, true)
end)
	
addEvent("closePanel", true)
addEventHandler("closePanel", resourceRoot, function()
    showGUI(false)
end)
	addEventHandler("onClientClick", root, function(btn,state)
    local login = guiGetText(gui.login)
    local pass = guiGetText(gui.pass)
    if guiGetVisible(gui.login) and guiGetVisible(gui.pass) then
        if btn == "left" and state == "up" then
            if isMouseInPosition(460*w, 628*h, 531*w, 650*h) then
                triggerServerEvent("logowanie:checkPlayer", resourceRoot, login, pass)
            elseif isMouseInPosition(470*w, 588*h, 620*w, 605*h) then
                if #login >= 3 and #pass >= 3 then
                    triggerServerEvent("zarejestuj:addAccount", resourceRoot, login, pass)
                else
                    outputChatBox("Login i/lub hasło muszą mieć minimalnie 3 znaki!")
                end
            end
        end
    end
end)
	function showGUI(value)
    if value then
        showCursor(true)
        setPlayerHudComponentVisible("all", false)
    --    s = playSound("files/intro.mp3")
	        addEventHandler("onClientRender", root, renderGuiDX)
        guiSetVisible(gui.login, true)
        guiSetVisible(gui.pass, true)
    else
        showCursor(false)
        setPlayerHudComponentVisible("all", true)
        destroyElement(s)
	        removeEventHandler("onClientRender", root, renderDX)
        guiSetVisible(gui.login, false)
        guiSetVisible(gui.pass, false)
    end
end
	 
	function isMouseInPosition(x,y,width,height)
    if not isCursorShowing() then return false end
	    local sx,sy = guiGetScreenSize()
    local cx,cy = getCursorPosition()
    local cx,cy = (cx * sx), (cy * sy)
    if (cx >= x and cx <= x + width) and (cy >= y and cy <= y + height) then
        return true
    else
        return false
    end
end
	

 

dxDrawImage(399, 181, 690, 496, "img/tlo.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)

- This line is not loading

Link to comment

Could you tell us precisely what error/problem this is rather than what it's related to? And are you absolutely 100% sure the image is in meta.xml? Did you make sure to save it properly (it often that people don't realise their meta.xml wasn't saved, or that they didn't update the changes on the remote server). Check whether the file got downloaded by your client, that would be in MTA client directory/mods/deathmatch/resources/<your resource name> - make sure to look for it on your client, not on the server. If it's not there, then almost surely your meta.xml is wrong.

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...