mint3d Posted November 12, 2013 Posted November 12, 2013 I need help it doesn't close the dx local x,y = guiGetScreenSize() local playerName = getPlayerName ( localPlayer ) local MOTDText = "Welcome to our server!" function drawStuff () dxDrawRectangle ( x/3.8, y/3.8, x/2.02, y/2, tocolor ( 0, 0, 0, 150 ) ) dxDrawText ( "Welcome " .. playerName, x/3.5, y/3.6, x, y, tocolor ( 255, 255, 255, 255 ), 1, "bankgothic" ) dxDrawText ( MOTDText, x/3.6, y/3, x, y, tocolor ( 255, 255, 255, 255 ), 1, "clear" ) -- Create MOTD text. end addEventHandler("onClientRender", getRootElement(), drawStuff) function closedrawStuff () removeEventHandler("onClientRender",getRootElement(),drawStuff) end addEventHandler("onClientGUIClick",bLogin,closedrawStuff) Skype: Jordan_Nymph
Castillo Posted November 12, 2013 Posted November 12, 2013 Where's "bLogin" defined? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
mint3d Posted November 12, 2013 Author Posted November 12, 2013 (edited) the same script bLogin = guiCreateButton(50, 200, 210, 46, "Login", false, wLogin) guiSetFont(bLogin, "default-bold-small") addEventHandler("onClientGUIClick", bLogin, LoginScreen_validateLogin, false) Edited November 12, 2013 by Guest Skype: Jordan_Nymph
Castillo Posted November 12, 2013 Posted November 12, 2013 Add an outputChatBox to see if the function is being executed. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
mint3d Posted November 12, 2013 Author Posted November 12, 2013 local x,y = guiGetScreenSize() local playerName = getPlayerName ( localPlayer ) local MOTDText = "Welcome to our server!" function drawStuff () dxDrawRectangle ( x/3.8, y/3.8, x/2.02, y/2, tocolor ( 0, 0, 0, 150 ) ) dxDrawText ( "Welcome " .. playerName, x/3.5, y/3.6, x, y, tocolor ( 255, 255, 255, 255 ), 1, "bankgothic" ) dxDrawText ( MOTDText, x/3.6, y/3, x, y, tocolor ( 255, 255, 255, 255 ), 1, "clear" ) -- Create MOTD text. end addEventHandler("onClientRender", getRootElement(), drawStuff) function closedrawStuff () removeEventHandler("onClientRender",getRootElement(),drawStuff) outputChatBox ( "#FF0000Hello #00FF00World", getRootElement(), 255, 255, 255, true ) end addEventHandler("onClientGUIClick",bLogin,closedrawStuff) Didn't out put anything Skype: Jordan_Nymph
Castillo Posted November 12, 2013 Posted November 12, 2013 Do you get any errors on the debugscript? is "bLogin" created outside any function? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
mint3d Posted November 12, 2013 Author Posted November 12, 2013 bLogin is created in a different function and its created on the gui function which is this function LoginScreen_openLoginScreen() Skype: Jordan_Nymph
Castillo Posted November 12, 2013 Posted November 12, 2013 Then, put the onClientGUIClick addEventHandler after you create the button ( inside the same function ). San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted November 14, 2013 Posted November 14, 2013 You're welcome. 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