Jump to content

طلب+شرح كود unbindKey <~[تمـــت الأفــادة]~>


Recommended Posts

توضيح حق الكود هذا

-- Server Side 
unbindKey ( player, key, keyState, functionName ) 

Ex.:

unbindKey ( source, "f2", "down", openWindow ) 

ولو تبي مثل المناطق وتقفل لوحات ..

Data استخدم

setElementData 
getElementData 

Ex.:

-- Client Side 
lockWindow = false 
addCommandHandler ( "lock", 
    function ( ) 
        lockWindow = not lockWindow  
        setElementData ( localPlayer, "Locked", lockWindow ) 
    end 
) 
  
bindKey ( "f2", "down", 
    function ( ) 
        if getElementData ( localPlayer, "Locked" ) then 
            -- Nothing ..... 
        else 
            guiSetVisible ( Window, not guiGetVisible ( Window ) ) 
        end 
    end 
) 

Link to comment
local colshape = createColCuboid(....) -- نسوي كول شيب 
  
function onColHit(hitElem) -- وظيفة حدث الدخول الى الكول شيب 
    if hitElem == localPlayer then -- اذا الداخل الى الكول شيب هو اللاعب 
        guiSetVisible(النافذة, false) -- يخفي النافذة الي تبيها 
    end 
end 
addEventHandler("onClientColShapeHit", colshape, onColHit) -- اضافة الحدث .. 

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