Jump to content

[طلب] لوحة تسجيل دخول دي اكس


Recommended Posts

ض1 بس سؤالي كيف اخلي متلا لوحة دي اكس متل حقت اللوحة عادية يعني اقدر ادمج معها اديت بوكس وزر وكل شئ

لانه انا لما احط زر فوق الدي اكس ينزل تحتها ومايبان يعني مايندمج معها اتمنى تكون فهمتني

Link to comment

استخدم الفنكشن هذا

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 

وسوي تحقق ان الحدث ماهب مضاف وضيفه عن طريق

addEventHandler 'onClientRender' 

وتحقق ان الحدث مضاف واحذفه عن طريق

removeEventHandler 'onClientRender' 
Link to comment
كيف اخلي

لوحة دي اكس تتقفل متلا

dxSetVisible

زي كده ادري انه مب موجود بس كيف اسوي لها زي كده

بالنسبة لذا الفنكشن ترا موجود لكنه فنكشن مفيد

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
 
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

Edited by Guest
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...