elian sweed Posted July 10, 2020 Share Posted July 10, 2020 This is my script _________________________________________________________ local screenW, screenH = guiGetScreenSize() function showthepanelwithtime() setTimer ( function() addEventHandler("onClientRender",root,test) end, 2000, 1 ) end addCommandHandler("test1",showthepanelwithtime) function test() dxDrawText("اخلع حزام الامان للنزول", (screenW * 0.0057) - 1, (screenH * 0.4597) - 1, (screenW * 0.1838) - 1, (screenH * 0.5040) - 1, tocolor(0, 0, 0, 255), 2.00, "default", "left", "top", true, true, true, true, false) dxDrawText("اخلع حزام الامان للنزول", (screenW * 0.0057) + 1, (screenH * 0.4597) - 1, (screenW * 0.1838) + 1, (screenH * 0.5040) - 1, tocolor(0, 0, 0, 255), 2.00, "default", "left", "top", true, true, true, true, false) dxDrawText("اخلع حزام الامان للنزول", (screenW * 0.0057) - 1, (screenH * 0.4597) + 1, (screenW * 0.1838) - 1, (screenH * 0.5040) + 1, tocolor(0, 0, 0, 255), 2.00, "default", "left", "top", true, true, true, true, false) dxDrawText("اخلع حزام الامان للنزول", (screenW * 0.0057) + 1, (screenH * 0.4597) + 1, (screenW * 0.1838) + 1, (screenH * 0.5040) + 1, tocolor(0, 0, 0, 255), 2.00, "default", "left", "top", true, true, true, true, false) dxDrawText("اخلع حزام الامان للنزول", screenW * 0.0057, screenH * 0.4597, screenW * 0.1838, screenH * 0.5040, tocolor(255, 0, 0, 255), 2.00, "default", "left", "top", true, true, true, true, false) end _________________________________________________________ I need it after 2 seconds to disappear how i do that ?? please someone help me Link to comment
NONAME_1224 Posted July 11, 2020 Share Posted July 11, 2020 Just remove the EventHandler with this line: removeEventHandler("onClientRender",root,test) Just a tip... if you post a topic you can use the Code function from the tool list (7th in the first line) Link to comment
MTA Team 0xCiBeR Posted July 12, 2020 MTA Team Share Posted July 12, 2020 local screenW, screenH = guiGetScreenSize() function showthepanelwithtime() -- Show the text in 2 seconds setTimer(addEventHandler, 2000, 1, "onClientRender", root, test) -- Remove it in another 2 seconds. 2000+2000=4000(4sec) setTimer(removeEventHandler, 4000, 1, "onClientRender", root, test) end addCommandHandler("test1",showthepanelwithtime) function test() dxDrawText("اخلع حزام الامان للنزول", (screenW * 0.0057) - 1, (screenH * 0.4597) - 1, (screenW * 0.1838) - 1, (screenH * 0.5040) - 1, tocolor(0, 0, 0, 255), 2.00, "default", "left", "top", true, true, true, true, false) dxDrawText("اخلع حزام الامان للنزول", (screenW * 0.0057) + 1, (screenH * 0.4597) - 1, (screenW * 0.1838) + 1, (screenH * 0.5040) - 1, tocolor(0, 0, 0, 255), 2.00, "default", "left", "top", true, true, true, true, false) dxDrawText("اخلع حزام الامان للنزول", (screenW * 0.0057) - 1, (screenH * 0.4597) + 1, (screenW * 0.1838) - 1, (screenH * 0.5040) + 1, tocolor(0, 0, 0, 255), 2.00, "default", "left", "top", true, true, true, true, false) dxDrawText("اخلع حزام الامان للنزول", (screenW * 0.0057) + 1, (screenH * 0.4597) + 1, (screenW * 0.1838) + 1, (screenH * 0.5040) + 1, tocolor(0, 0, 0, 255), 2.00, "default", "left", "top", true, true, true, true, false) dxDrawText("اخلع حزام الامان للنزول", screenW * 0.0057, screenH * 0.4597, screenW * 0.1838, screenH * 0.5040, tocolor(255, 0, 0, 255), 2.00, "default", "left", "top", true, true, true, true, false) end Link to comment
elian sweed Posted July 13, 2020 Author Share Posted July 13, 2020 Thank you very much 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