Fox, if you're using MTA DayZ 0.95a. Add this to "DayZ/group/group.slua"  
  
function isPlayerInGroup(player, group) 
    if GAC[GetAccount(player)][1] == group then 
        return true 
    else 
        return false 
    end 
end 
  
 
Now your script.  
  
    local gate = createObject ( 10828, 276.60000610352, 2503.3000488281, 28.10000038147, 0, 0, 90 ) 
    local state = 0 
    local group = "TheGroupYouWant" 
      
    addCommandHandler ( "gate", 
        function ( ) 
            if isPlayerInGroup ( source, group ) then 
                if state == 0 then 
                    moveObject ( gate, 4000, 276.5, 2537.1999511719, 28.10000038147) 
                    state = 1 
                elseif state == 1 then 
                    moveObject ( gate, 4000, 276.60000610352, 2503.3000488281, 28.10000038147) 
                    state = 0 
                end 
            end 
        end 
    )