Arsilex Posted August 4, 2012 Share Posted August 4, 2012 function Panel ( ) dxDrawImage(1240.0,163.0,126.0,96.0,"Imagenes/Stats.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawImage(1239.0,1.0,126.0,102.0,"Imagenes/Maps.png",0.0,0.0,0.0,tocolor(255,0,0,255),false) dxDrawRectangle(1238.0,0.0,128.0,767.0,tocolor(0,0,0,160),false) end bindKey ( "F7", "down", function(oldNick, newNick) addEventHandler ( "onClientRender", root, Panel ) bindKey ( "F7", "down", function ( ) removeEventHandler ( "onClientRender", root, Panel ) end ) end ) Como hacer para que con F7 pueda apagar y encender el Panel? es que la primera vez cuando ago F7 si va pero despues no hace nada en debug pone que el evento ya esta encendido y no hace falta encenderlo de nuevo Link to comment
Castillo Posted August 4, 2012 Share Posted August 4, 2012 local state = false function Panel ( ) dxDrawImage(1240.0,163.0,126.0,96.0,"Imagenes/Stats.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) dxDrawImage(1239.0,1.0,126.0,102.0,"Imagenes/Maps.png",0.0,0.0,0.0,tocolor(255,0,0,255),false) dxDrawRectangle(1238.0,0.0,128.0,767.0,tocolor(0,0,0,160),false) end bindKey ( "F7", "down", function ( ) state = ( not state ) removeEventHandler ( "onClientRender", root, Panel ) if ( state ) then addEventHandler ( "onClientRender", root, Panel ) end end ) Link to comment
Recommended Posts