joedajoester Posted January 23, 2012 Share Posted January 23, 2012 How would you make it so you press a button and it shows a cursor and you can click a object and it will do a function like outputchatbox? Link to comment
Kenix Posted January 23, 2012 Share Posted January 23, 2012 https://wiki.multitheftauto.com/wiki/OnElementClicked ? Link to comment
BriGhtx3 Posted January 23, 2012 Share Posted January 23, 2012 function initGUI( ) -- Create our button btnOutput = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Output!", true ) -- And attach our button to the outputEditBox function addEventHandler ( "onClientGUIClick", btnOutput, outputEditBox, false ) -- Create an edit box and define it as "editBox". editBox = guiCreateEdit( 0.3, 0.1, 0.4, 0.1, "Type your message here!", true ) guiEditSetMaxLength ( editBox, 128 ) -- The max chatbox text length is 128, so force this end addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( ) ), initGUI ) -- Setup our function to output the message to the chatbox function outputEditBox ( button ) if button == "left" then local text = guiGetText ( editBox )-- Get the text from the edit box outputChatBox ( text ) -- Output that text end end this is from the wiki Link to comment
Castillo Posted January 23, 2012 Share Posted January 23, 2012 That's not what he asked for. button = guiCreateButton(100, 100, 50, 50, "Click me!", false) addEventHandler("onClientGUIClick",button, function () showCursor(not isCursorShowing()) end,false) Then for click object, you have two options: One: this one is client side only. https://wiki.multitheftauto.com/wiki/OnClientClick Two: this one is server side only. https://wiki.multitheftauto.com/wiki/OnElementClicked 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