Jump to content

Cursor


joedajoester

Recommended Posts

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

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

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