Jump to content

OnClientGuiClick - Whats happening after the function runs


Recommended Posts

Posted

i've got the following code:

  
  
function buttonClicked(button, state) 
    if button == oyuncuYonetimiBtn then 
        --- 
    elseif button == aracYonetimiBtn then 
        --- 
    elseif button == sunucuYonetimiBtn then 
        --- 
    elseif button == sirketYonetimiBtn then 
        --- 
    end 
end 
         
addEventHandler("onClientGUIClick", anyButton, buttonClicked, false) 

if the function "buttonClicked" called, will be that eventHandler deleted? Or should I remove that eventHandler manually? and how?

--and second question:

in the function "buttonClicked",

should I set the button "anyButton" invisible and set it as nil?

do I need it?

Don´t let your fears stand in the way of your dreams!

Posted

'button' isn't the GUI element, is the mouse button clicked ( right, left ).

'source' would be the GUI element.

And no, the event handler remains.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

i have got guiCreateButton. how can i remove both, the button and eventhandler? (in that function)

Don´t let your fears stand in the way of your dreams!

Posted
destroyElement -- To destroy the button. 
removeEventHandler -- To remove the event handler. 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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