#StrOnG_,) Posted December 12, 2015 Share Posted December 12, 2015 السلام عليكم .. أبي كود فتح لوحة الدي أكس بزر .. وشكرآ .. Link to comment
iMr.Omar Posted December 12, 2015 Share Posted December 12, 2015 تفضل هاذي طريقة مختصره State = false addEventHandler('onClientRender',root, function ( ) if ( State ) then dxDrawRectangle (0,0,800,600,tocolor(0,0,0,190),false) end end) bindKey('f3','down', function ( ) State = not State showCursor ( State ) end) Link to comment
#StrOnG_,) Posted December 12, 2015 Author Share Posted December 12, 2015 تفضل هاذي طريقة مختصره State = false addEventHandler('onClientRender',root, function ( ) if ( State ) then dxDrawRectangle (0,0,800,600,tocolor(0,0,0,190),false) end end) bindKey('f3','down', function ( ) State = not State showCursor ( State ) end) تمت الافادة مشكور <3 Link to comment
Me[Z]oO Posted December 12, 2015 Share Posted December 12, 2015 السلام عليكم .. أبي كود فتح لوحة الدي أكس بزر .. وشكرآ .. او addEventHandler removeEventHandler Link to comment
Rockyz Posted December 12, 2015 Share Posted December 12, 2015 هذي الطريقة تستهلك CPU اتوقع جرب الفنكشنات ذي dxGetVisible dxSetVisible Syntax : dxGetVisible ( functionName ) dxSetVisible ( functionName, visible = true ) الفنكشنات واضحين من الاسم Source Code : dxGetVisible : function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end -- isEventHandlerAdded By Dawi function dxGetVisible (fun) if (fun and type (fun) == "function") then if (isEventHandlerAdded ("onClientRender", root, fun)) then return true else return false end end end dxSetVisible : function dxSetVisible (fun, vis) if (fun and vis) then if (type (fun) == "function") then if (vis == true or vis == false) then if (vis == true) then addEventHandler ("onClientRender", root, fun) else removeEventHandler ("onClientRender", root, fun) end else error ("Bad Argument At #2 Got "..type (vis)) end else error ("Bad Argument At #1 Got "..type (fun)) end end end Example : bindKey ( "F6", "down", function ( ) if ( dxGetVisible ( functionName ) == false ) then dxSetVisible ( functionName, true ) showCursor ( true ) else dxSetVisible ( functionName, false ) showCursor ( false ) end end ) طبعا بتقولي مافيه فايدة فيه فايدة لان ناس مايعرفون للدي اكس author : xiRocK 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