Jump to content

طلب كود يخلي الا الادمن يفتح المود


Recommended Posts

-- server --

addEventHandler ( 'onResourceStart', resourceRoot, 
    function ( )  
        local players = getElementsByType ( 'player' ) 
        for i,v in ipairs (players) do 
            local acc = getAccountName ( getPlayerAccount ( v ) ) 
            if isObjectInACLGroup ( 'user.'..acc, aclGetGroup ( 'Admin' ) ) then 
                setElementData ( v, 'allowed', true ) 
            end 
        end 
    end 
) 

-- client --

Key = 'زر فتح النافذة' 
  
bindKey ( Key, 'down', function ( ) 
    if getElementData ( localPlayer, 'allowed' ) == true then 
        local visible = guiGetVisible ( النافذة ) 
        guiSetVisible ( النافذة, not visible ) 
        showCursor ( visible ) 
    end 
end 
) 

Link to comment
-- server --
addEventHandler ( 'onResourceStart', resourceRoot, 
    function ( )  
        local players = getElementsByType ( 'player' ) 
        for i,v in ipairs (players) do 
            local acc = getAccountName ( getPlayerAccount ( v ) ) 
            if isObjectInACLGroup ( 'user.'..acc, aclGetGroup ( 'Admin' ) ) then 
                setElementData ( v, 'allowed', true ) 
            end 
        end 
    end 
) 

-- client --

Key = 'زر فتح النافذة' 
  
bindKey ( Key, 'down', function ( ) 
    if getElementData ( localPlayer, 'allowed' ) == true then 
        local visible = guiGetVisible ( النافذة ) 
        guiSetVisible ( النافذة, not visible ) 
        showCursor ( visible ) 
    end 
end 
) 

showCursor ( not visible ) 

Link to comment
-- server --

addEventHandler ( 'onResourceStart', resourceRoot, 
    function ( )  
        local players = getElementsByType ( 'player' ) 
        for i,v in ipairs (players) do 
            local acc = getAccountName ( getPlayerAccount ( v ) ) 
            if isObjectInACLGroup ( 'user.'..acc, aclGetGroup ( 'Admin' ) ) then 
                setElementData ( v, 'allowed', true ) 
            end 
        end 
    end 
) 

-- client --

Key = 'زر فتح النافذة' 
  
bindKey ( Key, 'down', function ( ) 
    if getElementData ( localPlayer, 'allowed' ) == true then 
        local visible = guiGetVisible ( النافذة ) 
        guiSetVisible ( النافذة, not visible ) 
        showCursor ( visible ) 
    end 
end 
) 

الكود مآهو غريب علي ومعدل فية :lol:

بس لازم تسوي تأكيد يوم يسجل دخولة ( =

Link to comment
الكود مآهو غريب علي ومعدل فية :lol:

! حرام عليك والله اني مسويه بنفسي

+

بس لازم تسوي تأكيد يوم يسجل دخولة ( =

كلامك صح

-- server --

addEventHandler ( 'onPlayerLogin', root, 
    function ( _,acc ) 
        local accName = getAccountName ( acc ) 
        if isObjectInACLGroup ( 'user.'..accName, aclGetGroup ( 'Admin' ) ) then 
            setElementData ( source, 'allowed', true ) 
        end 
    end 
) 
  
  
addEventHandler ( 'onPlayerLogout', root, 
    function ( ) 
        setElementData ( source, 'allowed', false ) 
    end 
) 

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