GerardWay Posted July 25, 2013 Posted July 25, 2013 None of these images are showing up when I start the resource. Could anyone help please? client.lua function draw() dxDrawImage(1049, 696, 13, 34, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 674, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 726, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 696, 20, 35, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end ) function HandleTheRendering ( ) addEventHandler("onClientRender", getRootElement(), draw) end addEventHandler("onClientResourceStart",resourceRoot, HandleTheRendering) Meta.xml <meta> <info author="Booker" name="image" version="0.1" type="script"/> <script src="client.lua" type="client" /> <!-- gameplay icons --> <file src="mtalogo.png" /> </meta>
MIKI785 Posted July 25, 2013 Posted July 25, 2013 (edited) Why the onClientResourceStart? Why? function draw() dxDrawImage(1049, 696, 13, 34, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 674, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 726, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 696, 20, 35, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end addEventHandler("onClientRender", getRootElement(), draw) The same thing... i don't think the problem was in that, the debug doesn't output anything? EDIT: You had ')' in the code that didn't close anything. Edited July 25, 2013 by Guest Lua Scripter Owner of mshost.cz MTA portal.
MIKI785 Posted July 25, 2013 Posted July 25, 2013 What about the debug? Lua Scripter Owner of mshost.cz MTA portal.
Alen141 Posted July 25, 2013 Posted July 25, 2013 addEventHandler("onClientRender", root, function () dxDrawImage(1049, 696, 13, 34, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 674, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 726, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 696, 20, 35, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end )
MIKI785 Posted July 25, 2013 Posted July 25, 2013 addEventHandler("onClientRender", root, function () dxDrawImage(1049, 696, 13, 34, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 674, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 726, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 696, 20, 35, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end ) You didn't change anything there... the same code. Lua Scripter Owner of mshost.cz MTA portal.
Alen141 Posted July 25, 2013 Posted July 25, 2013 addEventHandler("onClientRender", root, function () dxDrawImage(1049, 696, 13, 34, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 674, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 726, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 696, 20, 35, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end ) You didn't change anything there... the same code. it should work anyway ( one or another ).. Once I had same problem, but when I changed code to this it worked
Alen141 Posted July 25, 2013 Posted July 25, 2013 Nope. still nothing. try something silly.. if this dosen't work, maybe your coords aren't alright : addEventHandler("onClientResourceStart", resourceRoot, function() end ) addEventHandler("onClientRender", root, function () dxDrawImage(1049, 696, 13, 34, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 674, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 726, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 696, 20, 35, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end )
MIKI785 Posted July 25, 2013 Posted July 25, 2013 The debug must output something then, you still didn't reply on the debug.... Lua Scripter Owner of mshost.cz MTA portal.
Alen141 Posted July 25, 2013 Posted July 25, 2013 The debug must output something then, you still didn't reply on the debug.... it's possible that he didn't set type="client" in meta
Castillo Posted July 25, 2013 Posted July 25, 2013 addEventHandler ( "onClientRender", root, function ( ) outputChatBox ( "RENDERING IMAGES" ) dxDrawImage(1049, 696, 13, 34, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 674, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 726, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 696, 20, 35, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end ) Use that and see what it outputs to the chat box. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
GerardWay Posted July 26, 2013 Author Posted July 26, 2013 Nothing, didn't work and it failed to output anything to the Chatbox, thanks anyway.
iMr.3a[Z]eF Posted July 26, 2013 Posted July 26, 2013 Show us the meta. To Visit Us Press Here: mtasa://5.9.206.180:22002
GerardWay Posted July 26, 2013 Author Posted July 26, 2013 meta.xml "Booker" name="image" version="0.1" type="script"/>
iMr.3a[Z]eF Posted July 26, 2013 Posted July 26, 2013 "Booker" name="image" version="0.1" type="script"/> To Visit Us Press Here: mtasa://5.9.206.180:22002
Baseplate Posted July 26, 2013 Posted July 26, 2013 lol, deleting this from the meta will make the script work! great thinking, my friend! <!-- gameplay icons --> And this scripts works, except there was an extra ")" near the end of "draw" function. function draw() dxDrawImage(1049, 696, 13, 34, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 674, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 726, 656, 32, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(406, 696, 20, 35, "mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end function HandleTheRendering ( ) addEventHandler("onClientRender", getRootElement(), draw) end addEventHandler("onClientResourceStart",resourceRoot, HandleTheRendering)
MTA Team qaisjp Posted July 26, 2013 MTA Team Posted July 26, 2013 lol, deleting this from the meta will make the script work! great thinking, my friend! <!-- gameplay icons --> That, should NOT be the case.
GerardWay Posted July 26, 2013 Author Posted July 26, 2013 Thanks for all of your help guys, abxf sent me the solution through Facebook and it works now.
Castillo Posted July 26, 2013 Posted July 26, 2013 Well, and what was the problem? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Baseplate Posted July 26, 2013 Posted July 26, 2013 And this scripts works, except there was an extra ")" near the end of "draw" function.
Castillo Posted July 26, 2013 Posted July 26, 2013 So, that means that he never used my code at all, which has no errors. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Baseplate Posted July 26, 2013 Posted July 26, 2013 I dunno, I just deleted the extra ")" from his code, he tested it and it works.
Alen141 Posted July 27, 2013 Posted July 27, 2013 So, that means that he never used my code at all, which has no errors. he probably failed at copy/paste
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