RandomRambo Posted March 26, 2019 Share Posted March 26, 2019 (edited) Hello,i just tried to wrote some some dxdraw text and image behind it. So how to hide dxdraw text in this script?Cus i tried to hide it but only image was hidden. Help plsssss Script: Quote statsWindows = guiCreateStaticImage(0.80, 0.20, 0.19, 0.21, "images/deb.png",true) guiSetAlpha(statsWindows,0.8) local screenW,screenH = guiGetScreenSize() local resW,resH = 1280,720 local sW,sH = (screenW/resW), (screenH/resH) function mis () dxDrawText ( "Mission1:",1035*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" ) if getElementData(localPlayer,"package") >= 1 then dxDrawText ( "Completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" ) else dxDrawText ( "Not completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" ) end dxDrawText ( "Mission2:",1035*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" ) if getElementData(localPlayer,"package") >= 1 or getElementData(localPlayer,"package") >= 1 then dxDrawText ( "Completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" ) else dxDrawText ( "Not completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" ) end dxDrawText ( "Mission3:",1035*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" ) if getElementData(localPlayer,"package") >= 1 then dxDrawText ( "Completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" ) else dxDrawText ( "Not completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" ) end end addEventHandler( "onClientRender", root, mis) function showDebugMonitor () local visible = guiGetVisible(statsWindows) guiSetVisible(statsWindows,not visible) local visible2 = guiGetVisible(mis) guiSetVisible(mis,not visible2) end bindKey("7","down",showDebugMonitor) function xds() screenw,screenh = guiGetScreenSize() end addEventHandler ( "onClientRender", getRootElement(), xds ) Edited March 26, 2019 by RandomRambo Link to comment
Oussema Posted March 27, 2019 Share Posted March 27, 2019 statsWindows = guiCreateStaticImage(0.80, 0.20, 0.19, 0.21, "images/deb.png",true) guiSetAlpha(statsWindows,0.8) local screenW,screenH = guiGetScreenSize() local resW,resH = 1280,720 local sW,sH = (screenW/resW), (screenH/resH) local dxText = false function mis () dxDrawText ( "Mission1:",1035*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" ) if getElementData(localPlayer,"package") >= 1 then dxDrawText ( "Completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" ) else dxDrawText ( "Not completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" ) end dxDrawText ( "Mission2:",1035*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" ) if getElementData(localPlayer,"package") >= 1 or getElementData(localPlayer,"package") >= 1 then dxDrawText ( "Completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" ) else dxDrawText ( "Not completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" ) end dxDrawText ( "Mission3:",1035*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" ) if getElementData(localPlayer,"package") >= 1 then dxDrawText ( "Completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" ) else dxDrawText ( "Not completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" ) end end function showDebugMonitor () local visible = guiGetVisible(statsWindows) guiSetVisible(statsWindows,not visible) local visible2 = guiGetVisible(mis) guiSetVisible(mis,not visible2) if dxText ~= true then dxText = false removeEventHandler( "onClientRender", root, mis) else dxText = true addEventHandler( "onClientRender", root, mis) end end bindKey("7","down",showDebugMonitor) Link to comment
RandomRambo Posted March 27, 2019 Author Share Posted March 27, 2019 16 hours ago, Oussema said: statsWindows = guiCreateStaticImage(0.80, 0.20, 0.19, 0.21, "images/deb.png",true) guiSetAlpha(statsWindows,0.8) local screenW,screenH = guiGetScreenSize() local resW,resH = 1280,720 local sW,sH = (screenW/resW), (screenH/resH) local dxText = false function mis () dxDrawText ( "Mission1:",1035*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" ) if getElementData(localPlayer,"package") >= 1 then dxDrawText ( "Completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" ) else dxDrawText ( "Not completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" ) end dxDrawText ( "Mission2:",1035*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" ) if getElementData(localPlayer,"package") >= 1 or getElementData(localPlayer,"package") >= 1 then dxDrawText ( "Completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" ) else dxDrawText ( "Not completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" ) end dxDrawText ( "Mission3:",1035*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" ) if getElementData(localPlayer,"package") >= 1 then dxDrawText ( "Completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" ) else dxDrawText ( "Not completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" ) end end function showDebugMonitor () local visible = guiGetVisible(statsWindows) guiSetVisible(statsWindows,not visible) local visible2 = guiGetVisible(mis) guiSetVisible(mis,not visible2) if dxText ~= true then dxText = false removeEventHandler( "onClientRender", root, mis) else dxText = true addEventHandler( "onClientRender", root, mis) end end bindKey("7","down",showDebugMonitor) Doesn't work,when local dxText = false ,it shows only image,no words,but when local dxText = true it shows words and image and when im trying to hide it it hides only image again and words are still remaining. Link to comment
KillerX Posted March 27, 2019 Share Posted March 27, 2019 (edited) statsWindows = guiCreateStaticImage( 0.80 , 0.20 , 0.19 , 0.21 , "images/deb.png" , true ) guiSetAlpha( statsWindows , 0.8 ) local screenW,screenH = guiGetScreenSize() local resW,resH = 1280,720 local sW,sH = (screenW/resW), (screenH/resH) function mis () dxDrawText ( "Mission1:",1035*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" ) local myData = tonumber( getElementData(localPlayer,"package") ) if ( myData and myData >= 1 ) then dxDrawText ( "Completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" ) else dxDrawText ( "Not completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" ) end dxDrawText ( "Mission2:",1035*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" ) if myData and myData >= 1 then dxDrawText ( "Completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" ) else dxDrawText ( "Not completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" ) end dxDrawText ( "Mission3:",1035*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" ) if myData and myData >= 1 then dxDrawText ( "Completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" ) else dxDrawText ( "Not completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" ) end end addEventHandler( "onClientRender" , root , mis ) local function visible( ) guiSetVisible( statsWindows , not guiGetVisible( statsWindows ) ) if( guiGetVisible( statsWindows ) ) then addEventHandler( "onClientRender" , root , mis ) else removeEventHandler( "onClientRender" , root , mis ) end end bindKey( "7" , "down" , visible ) Edited March 27, 2019 by KillerX 1 Link to comment
RandomRambo Posted March 27, 2019 Author Share Posted March 27, 2019 2 hours ago, KillerX said: statsWindows = guiCreateStaticImage( 0.80 , 0.20 , 0.19 , 0.21 , "images/deb.png" , true ) guiSetAlpha( statsWindows , 0.8 ) local screenW,screenH = guiGetScreenSize() local resW,resH = 1280,720 local sW,sH = (screenW/resW), (screenH/resH) function mis () dxDrawText ( "Mission1:",1035*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" ) local myData = tonumber( getElementData(localPlayer,"package") ) if ( myData and myData >= 1 ) then dxDrawText ( "Completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" ) else dxDrawText ( "Not completed",1200*sW, 180*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" ) end dxDrawText ( "Mission2:",1035*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" ) if myData and myData >= 1 then dxDrawText ( "Completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" ) else dxDrawText ( "Not completed",1200*sW, 200*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" ) end dxDrawText ( "Mission3:",1035*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 255, 0, 255 ), 1.20, "default-bold" ) if myData and myData >= 1 then dxDrawText ( "Completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 0, 255, 64, 255 ), 1.0, "default-bold" ) else dxDrawText ( "Not completed",1200*sW, 220*sH, 130*sW, 27*sH, tocolor ( 255, 64, 0, 255 ), 1.0, "default-bold" ) end end addEventHandler( "onClientRender" , root , mis ) local function visible( ) guiSetVisible( statsWindows , not guiGetVisible( statsWindows ) ) if( guiGetVisible( statsWindows ) ) then addEventHandler( "onClientRender" , root , mis ) else removeEventHandler( "onClientRender" , root , mis ) end end bindKey( "7" , "down" , visible ) Thanks it works 1 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