Jumper_Mych Posted January 29, 2011 Share Posted January 29, 2011 Hi all i'm back 1.How mouse can click object turn on GUI Text and Gui in Button Close to Close the gui 2.Press M look mouse Link to comment
Castillo Posted January 30, 2011 Share Posted January 30, 2011 ... who you think you are? the U.S President or what? You could ask it nicely and you would get replys faster. P.S: what are you trying to do? when click a object show a GUI? if yes use the event onClientClick and showCursor/bindKey for the mouse stuff. https://wiki.multitheftauto.com/wiki/OnClientClick Link to comment
Jumper_Mych Posted January 30, 2011 Author Share Posted January 30, 2011 (edited) I found! https://wiki.multitheftauto.com/wiki/OnClientClick local myLabel = guiCreateLabel ( 0, 0, 1, 1, "", true ) Can change to createObject? Will it work? Edited January 30, 2011 by Guest Link to comment
Jumper_Mych Posted January 30, 2011 Author Share Posted January 30, 2011 huh.. doesn't work type /mouse next nothing function Mouse ( player ) showCursor ( player, true ) else showCursor ( player, false ) addCommandHandler ( "mouse", Mouse) Doesn't work local myobject = createObject ( 1300, 2188.064453125, 40.50089263916, 25.705852508545, 0, 0, 0 ) function addObjectOnClick ( button, state, clickedElement ) if ( clickedElement ) then local elementType = getElementType ( clickedElement ) guiSetText ( myobject, elementType ) guiwin = guiCreateWindow ( 0, 0, 0.5, 0.4, "Information", true ) button = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Close", true, guiwin ) guiSetVisible ( clickedElement, false ) else guiSetVisible ( clickedElement, true ) end end addEventHandler ( "onClientClick", getRootElement(), addObjectOnClick ) Link to comment
SDK Posted January 30, 2011 Share Posted January 30, 2011 Seriously, you should learn LUA. Not random typing. Where's if-then-else -end? function Mouse ( player ) if not isCursorShowing ( player ) then showCursor ( player, true ) else showCursor ( player, false ) end end addCommandHandler ( "mouse", Mouse) This is wrong, check https://wiki.multitheftauto.com/wiki/OnClientClick function addObjectOnClick ( button, state, clickedElement ) ... addEventHandler ( "onClientClick", getRootElement(), addObjectOnClick ) Wtf is this? You're setting text on an object? guiSetText works ONLY on gui labels (guiCreateLabel) local myobject = createObject ( 1300, 2188.064453125, 40.50089263916, 25.705852508545, 0, 0, 0 ) ... guiSetText ( myobject, elementType ) How is this supposed to work? function addObjectOnClick ( button, state, clickedElement ) if ( clickedElement ) then ... guiSetVisible ( clickedElement, false ) else guiSetVisible ( clickedElement, true ) end end Link to comment
Jumper_Mych Posted January 30, 2011 Author Share Posted January 30, 2011 Sorry change to dxDrawText not gui And my code doesn't work local screenWidth, screenHeight = guiGetScreenSize() -- Get the screen resolution local myobject = createObject ( 1300, 2188.064453125, 40.50089263916, 25.705852508545, 0, 0, 0 ) function addObjectOnClick ( player ) if theButton == "left" then dxDrawText( "Object id 1300", 44, screenHeight-41, screenWidth, screenHeight, tocolor(255,200,0,255), 1.02, "clear" ) guiSetVisible ( theButton, false ) else guiSetVisible ( theButton, true ) end end addEventHandler ( "onClientClick", getRootElement(), addObjectOnClick ) Own worth learning LUA. because week for me I was not at my home because forgotten lua Maybe explained to me how work because i weak gui therefore teach me maybe understand Link to comment
proracer Posted January 30, 2011 Share Posted January 30, 2011 Sorry change to dxDrawText not gui And my code doesn't work local screenWidth, screenHeight = guiGetScreenSize() -- Get the screen resolution local myobject = createObject ( 1300, 2188.064453125, 40.50089263916, 25.705852508545, 0, 0, 0 ) function addObjectOnClick ( player ) if theButton == "left" then dxDrawText( "Object id 1300", 44, screenHeight-41, screenWidth, screenHeight, tocolor(255,200,0,255), 1.02, "clear" ) guiSetVisible ( theButton, false ) else guiSetVisible ( theButton, true ) end end addEventHandler ( "onClientClick", getRootElement(), addObjectOnClick ) Own worth learning LUA. because week for me I was not at my home because forgotten lua Maybe explained to me how work because i weak gui therefore teach me maybe understand And where is the button? Link to comment
Jumper_Mych Posted January 30, 2011 Author Share Posted January 30, 2011 mouse click press to object Link to comment
SDK Posted January 30, 2011 Share Posted January 30, 2011 He means, where is the "theButton" variable. Cause you have the wrong variables defined in your function ( again ...): >> https://wiki.multitheftauto.com/wiki/OnClientClick << Link to comment
proracer Posted January 30, 2011 Share Posted January 30, 2011 1. You can't use dxDrawText and than guiSetVisible because it requires a GUI element. 2. You are missing some paremeters for the function. 3. I don't understand what you want to do but if you want that text stay on the player's screen all the time use onClientRender.If you do not provide it, the text will be rendered for one frame. Link to comment
Jumper_Mych Posted January 30, 2011 Author Share Posted January 30, 2011 1. example 2. Mouse click on green house include dxdrawtext 3. do you know? Link to comment
Aibo Posted January 30, 2011 Share Posted January 30, 2011 im not sure a pickup element generates click events, since it has no collision. but i maybe wrong. imo, you should start with simple pickup handler to display your window. Link to comment
Jumper_Mych Posted January 30, 2011 Author Share Posted January 30, 2011 okay do not need a mouse button and i want only display your window EDIT: Help me only example Link to comment
SDK Posted January 30, 2011 Share Posted January 30, 2011 https://wiki.multitheftauto.com/wiki/OnPickupHit this has an example, just replace the outputChatBox with your window code Link to comment
Jumper_Mych Posted January 30, 2011 Author Share Posted January 30, 2011 EDIT: Other doesn't pickup i want black board and type Link to comment
Aibo Posted January 30, 2011 Share Posted January 30, 2011 stop pressing all the buttons you can find, it will get you nowhere. and i doubt anyone will understand your «Report» anyway Link to comment
Jumper_Mych Posted January 30, 2011 Author Share Posted January 30, 2011 sorry my fault because earlier no i was check the onPickupHit but not is black board. I Want help me black board and type Did you will help me? My bad send report Link to comment
Jumper_Mych Posted January 30, 2011 Author Share Posted January 30, 2011 black board this dxDrawText/Line or gui Link to comment
proracer Posted January 30, 2011 Share Posted January 30, 2011 If you mean the house system, it's probably made with dxDrawRectangle and dxDrawText but Im not sure. Link to comment
Jumper_Mych Posted January 30, 2011 Author Share Posted January 30, 2011 house system is dxDrawImage also Im not sure. Link to comment
Castillo Posted January 30, 2011 Share Posted January 30, 2011 omfg, i don't get a word of this guy.. what he's trying to do? Link to comment
12p Posted January 31, 2011 Share Posted January 31, 2011 "Noob" language translation to english: "Hello, here I am and I want to make a house system with pickups that must be clicked to open the house status window. And I want DX Drawing objects in the 3D world like in Dakilla's House System. Can you help me?" Jumper_Mych: http://www.ajaxtrans.com Link to comment
Jumper_Mych Posted January 31, 2011 Author Share Posted January 31, 2011 Sure weak language translation to english Look you my picture? and black card and text? How this function? Link to comment
Castillo Posted January 31, 2011 Share Posted January 31, 2011 What the...? now i'm really confused Link to comment
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