Closed_Gates_1 = createObject ( 986, 123.599998474120, 1931.800048828100, 15.500000000000, 0, 0, 270 ) 
  
addCommandHandler ( "OG1", 
    function ( Open_Gates_1 ) 
        if isAccountInGroup ( { "Owner", "Admin", "Vip" }, getAccountName ( getPlayerAccount ( Open_Gates_1 ) ) ) then 
            setTimer ( 
                function ( ) 
                    moveObject ( Closed_Gates_1, 5000, 123.59999847412, 1931.800048828100, 10.500000000000 ) 
                end 
                , 1000, 1 
            ) 
        else 
            Err_Msg ( "[iNFO]: You have no acces to that command.", Open_Gates_1 ) 
        end 
    end 
) 
  
addCommandHandler ( "CG1", 
    function ( Close_Gates_1 ) 
        if isAccountInGroup ( { "Owner", "Admin", "Vip" }, getAccountName ( getPlayerAccount ( Open_Gates_1 ) ) ) then 
            setTimer ( 
                function ( ) 
                    moveObject ( Closed_Gates_1, 5000, 123.59999847412, 1931.800048828100, 15.500000000000 ) 
                end 
                ,1000, 1 
            ) 
        else 
            Err_Msg ( "[iNFO]: You have no acces to that command.", Close_Gates_1 ) 
        end 
    end 
) 
  
function isAccountInGroup ( groups, account ) 
    local theGroup = false 
    for _, group in ipairs ( groups ) do 
        if isObjectInACLGroup ( "user.".. account, aclGetGroup ( group ) ) then 
            theGroup = group 
            break 
        end 
    end 
  
    return theGroup 
end