Genius Posted June 28, 2012 Posted June 28, 2012 I have problem with register system 79:Bad argument "addEventHandler[Expected element at argument 2,got nil] function clientRegister(button, state) if button == "left" and state == "up" then local username = guiGetText(registerEdit) local password = guiGetText(registerEdit) if username and password then triggerServerEvent("register",localPlayer, username, password) end end end its 79 line: addEventHandler("onClientGUIClick", registerButton, clientRegister, false) MTA Scripter. If you want scripter PM me and i will accept every job for fair price.
Jaysds1 Posted June 28, 2012 Posted June 28, 2012 remove the false at the end, it's only needed for click event handlers. try this: function clientRegister(button, state) if button == "left" and state == "up" then local username = guiGetText(registerEdit) local password = guiGetText(registerEdit) if username~="" and password~="" then --check if there's a string it them triggerServerEvent("register",localPlayer, username, password) end end end addEventHandler("onClientGUIClick", registerButton, clientRegister) --false not needed My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Castillo Posted June 28, 2012 Posted June 28, 2012 getPropagated: A boolean representing whether the handler will be triggered if the event was propagated down or up the element tree (starting from the source), and not triggered directly on attachedTo (that is, handlers attached with this argument set to false will only be triggered if source == this). If you don't set that to "false", when you click on another GUI, it'll trigger that function. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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