ManeXi Posted June 18, 2015 Share Posted June 18, 2015 Basically i've got a script to show certain buttons after login, it works perfectly, but i wanted to add a dxImage and i didn't got succesful, this is everything i use to do this actions: login>show buttons This is to show the dxImage. local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawImage(0, 0, screenW, screenH, ":tdm/pics/intro.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end ) This is to hide login window and show the team selection buttons (guiSetVisible(TeamSlct_BTN[1],true)) function hideLoginWindow() --Show Team select panel after login guiSetInputEnabled(false) guiSetVisible(Login_TabPanel[1], false) destroyElement(Login_TabPanel[1]) Login_TabPanel[1] = nil guiSetVisible(TeamSlct_BTN[1],true) guiSetVisible(TeamSlct_BTN[2],true) guiSetVisible(TeamSlct_BTN[3],true) if blackLoginScreen == true then fadeCamera(true,blackScreenTime) end end addEvent("hideLoginWindow", true) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) This are buttons script: TeamSlct_BTN[3] = guiCreateButton(0, (screenH/2) - ((screenH/3)/2), screenW, screenH/3, "PLT", false) guiSetProperty(TeamSlct_BTN[3], "NormalTextColour", "FF0553B3") guiSetFont(TeamSlct_BTN[3], "sa-header") guiSetVisible(TeamSlct_BTN[3],false) If you need anything else to help me ask for it. Thanks for reading. Link to comment
MisterQuestions Posted June 19, 2015 Share Posted June 19, 2015 Use: setElementData getElementData When the player logs-in, set him a data, and at client-side, at drawing use if getElementData("loginExample") then... draw the image. Link to comment
jingzhi Posted June 19, 2015 Share Posted June 19, 2015 Basically i've got a script to show certain buttons after login, it works perfectly, but i wanted to add a dxImage and i didn't got succesful, this is everything i use to do this actions: login>show buttonsThis is to show the dxImage. local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawImage(0, 0, screenW, screenH, ":tdm/pics/intro.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end ) This is to hide login window and show the team selection buttons (guiSetVisible(TeamSlct_BTN[1],true)) function hideLoginWindow() --Show Team select panel after login guiSetInputEnabled(false) guiSetVisible(Login_TabPanel[1], false) destroyElement(Login_TabPanel[1]) Login_TabPanel[1] = nil guiSetVisible(TeamSlct_BTN[1],true) guiSetVisible(TeamSlct_BTN[2],true) guiSetVisible(TeamSlct_BTN[3],true) if blackLoginScreen == true then fadeCamera(true,blackScreenTime) end end addEvent("hideLoginWindow", true) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) This are buttons script: TeamSlct_BTN[3] = guiCreateButton(0, (screenH/2) - ((screenH/3)/2), screenW, screenH/3, "PLT", false) guiSetProperty(TeamSlct_BTN[3], "NormalTextColour", "FF0553B3") guiSetFont(TeamSlct_BTN[3], "sa-header") guiSetVisible(TeamSlct_BTN[3],false) If you need anything else to help me ask for it. Thanks for reading. Can you show the error? Do you have you image in your xml file? Do you have your image with the right path? Link to comment
jingzhi Posted June 19, 2015 Share Posted June 19, 2015 Basically i've got a script to show certain buttons after login, it works perfectly, but i wanted to add a dxImage and i didn't got succesful, this is everything i use to do this actions: login>show buttonsThis is to show the dxImage. local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawImage(0, 0, screenW, screenH, ":tdm/pics/intro.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end ) This is to hide login window and show the team selection buttons (guiSetVisible(TeamSlct_BTN[1],true)) function hideLoginWindow() --Show Team select panel after login guiSetInputEnabled(false) guiSetVisible(Login_TabPanel[1], false) destroyElement(Login_TabPanel[1]) Login_TabPanel[1] = nil guiSetVisible(TeamSlct_BTN[1],true) guiSetVisible(TeamSlct_BTN[2],true) guiSetVisible(TeamSlct_BTN[3],true) if blackLoginScreen == true then fadeCamera(true,blackScreenTime) end end addEvent("hideLoginWindow", true) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) This are buttons script: TeamSlct_BTN[3] = guiCreateButton(0, (screenH/2) - ((screenH/3)/2), screenW, screenH/3, "PLT", false) guiSetProperty(TeamSlct_BTN[3], "NormalTextColour", "FF0553B3") guiSetFont(TeamSlct_BTN[3], "sa-header") guiSetVisible(TeamSlct_BTN[3],false) If you need anything else to help me ask for it. Thanks for reading. Can you show the error? Do you have you image in your xml file? Do you have your image with the right path? Link to comment
ManeXi Posted June 19, 2015 Author Share Posted June 19, 2015 The debug script doesn't show any error, but what happens is that you start displaying the image since the begging and the image is not disabled while login panel is actived, and after clicking in a certain button, it should be disabled, but it stills there. Mainly i need a command like (guiSetVisible(insert GUI stuff name here,true/false)) but for the dxImage Link to comment
Anubhav Posted June 19, 2015 Share Posted June 19, 2015 1. Make it attached to a FUNCTION name. 2. Then removeEventHandler? 3. Profit! Link to comment
jingzhi Posted June 20, 2015 Share Posted June 20, 2015 The debug script doesn't show any error, but what happens is that you start displaying the image since the begging and the image is not disabled while login panel is actived, and after clicking in a certain button, it should be disabled, but it stills there.Mainly i need a command like (guiSetVisible(insert GUI stuff name here,true/false)) but for the dxImage You should use cancleEventHandler to cancle the event handler that attached to onClientRender to draw the image when you clicked certain button Link to comment
Anubhav Posted June 21, 2015 Share Posted June 21, 2015 The debug script doesn't show any error, but what happens is that you start displaying the image since the begging and the image is not disabled while login panel is actived, and after clicking in a certain button, it should be disabled, but it stills there.Mainly i need a command like (guiSetVisible(insert GUI stuff name here,true/false)) but for the dxImage You should use cancleEventHandler to cancle the event handler that attached to onClientRender to draw the image when you clicked certain button No such function, stop giving false answers. + It's not attached to a function, but a function itself created, which has no name, and the name can't be given. It's removeEventHandler. 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