lolman Posted August 6, 2015 Share Posted August 6, 2015 (edited) Hello, I want to setTimers on dxDrawText because I want to make a conversation script (animation with just some text shown). I tried to do it but I can only see the text but it doesnt get removed... local x, y = guiGetScreenSize() function togglePanel() dxDrawRectangle(x*0, y*0, x*1, y*0.17, tocolor(0, 0, 0, 255), true) dxDrawRectangle(x*0, y*0.83, x*1, y*0.17, tocolor(0, 0, 0, 255), false) setTimer(tekst1, 1500, 1) end function drawPanel() addEventHandler("onClientPreRender", root, togglePanel) end addEvent("drawPanel", true) addEventHandler("drawPanel", getRootElement(), drawPanel) function hidepanel() removeEventHandler("onClientPreRender", root, togglePanel) end addEvent("hidepanel", true) addEventHandler("hidepanel", getRootElement(), hidepanel) function tekst1() dxDrawText("Test", x*0.67, y*0.8, x*0.38, y*0.05, tocolor(255, 255, 255, 255), 2, "default", "center", "center", false, false, true, false, false) end As you can see in this script, there is a setTimer function but it only shows the text after that time but I want it also to remove it with timer... Edited August 6, 2015 by Guest Link to comment
HUNGRY:3 Posted August 6, 2015 Share Posted August 6, 2015 setTimer(removeEventHandler, 2500, 1, "onClientPreRender", root, tekst1) Link to comment
lolman Posted August 6, 2015 Author Share Posted August 6, 2015 I fixed it by my self (so quickly) but thanks for the fast reply 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