Gallagher Posted January 22, 2014 Share Posted January 22, 2014 hi guys I want to make a bind when I press "f5" the createText1 disappear if I hit f5 again to reappear. or is it not possible to do this with dx? local screenWidth,screenHeight = guiGetScreenSize() function createText1 ( ) if getElementData(getLocalPlayer(), "stamine") >= 6000 then elementblood2 = dxDrawImage(screenWidth * 0.84, screenHeight * 0.85, screenHeight * 0.070, screenHeight * 0.070, "s8.png", 0, 0, 0, tocolor(250, 150,150)) end if getElementData(getLocalPlayer(), "stamine") >= 8000 then elementblood1 = dxDrawImage(screenWidth * 0.84, screenHeight * 0.85, screenHeight * 0.070, screenHeight * 0.070, "s10.png", 0, 0, 0, tocolor(255, 255, 255)) end end function HandleTheRendering ( ) addEventHandler ( "onClientRender", root, createText1 ) end addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering ) Link to comment
Alexs Posted January 22, 2014 Share Posted January 22, 2014 local screenWidth,screenHeight = guiGetScreenSize() local render = false function createText1 ( ) if getElementData(getLocalPlayer(), "stamine") >= 6000 then elementblood2 = dxDrawImage(screenWidth * 0.84, screenHeight * 0.85, screenHeight * 0.070, screenHeight * 0.070, "s8.png", 0, 0, 0, tocolor(250, 150,150)) end if getElementData(getLocalPlayer(), "stamine") >= 8000 then elementblood1 = dxDrawImage(screenWidth * 0.84, screenHeight * 0.85, screenHeight * 0.070, screenHeight * 0.070, "s10.png", 0, 0, 0, tocolor(255, 255, 255)) end end function HandleTheRendering ( ) if render then removeEventHandler ( "onClientRender", root, createText1 ) render = false else addEventHandler ( "onClientRender", root, createText1 ) render = true end end addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering ) bindKey( 'F5', 'down', HandleTheRendering ) Link to comment
Gallagher Posted January 23, 2014 Author Share Posted January 23, 2014 local screenWidth,screenHeight = guiGetScreenSize() local render = false function createText1 ( ) if getElementData(getLocalPlayer(), "stamine") >= 6000 then elementblood2 = dxDrawImage(screenWidth * 0.84, screenHeight * 0.85, screenHeight * 0.070, screenHeight * 0.070, "s8.png", 0, 0, 0, tocolor(250, 150,150)) end if getElementData(getLocalPlayer(), "stamine") >= 8000 then elementblood1 = dxDrawImage(screenWidth * 0.84, screenHeight * 0.85, screenHeight * 0.070, screenHeight * 0.070, "s10.png", 0, 0, 0, tocolor(255, 255, 255)) end end function HandleTheRendering ( ) if render then removeEventHandler ( "onClientRender", root, createText1 ) render = false else addEventHandler ( "onClientRender", root, createText1 ) render = true end end addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering ) bindKey( 'F5', 'down', HandleTheRendering ) thanks 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